Compare commits

..
485 Commits
Author SHA1 Message Date
sc ed61970ffa Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-07-03 23:48:58 +08:00
sc 192d8c7841 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-07-03 23:48:56 +08:00
sc 529aa29677 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-07-01 00:27:52 +08:00
sc 8a383bf4d1 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-07-01 00:27:49 +08:00
sc fb65c392c8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-30 13:36:42 +08:00
sc bbf2871230 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-30 13:36:40 +08:00
sc 37bcbd8aea Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-30 10:58:14 +08:00
sc ce0f43a583 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-30 10:58:10 +08:00
sc 1c925c5c95 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 23:29:12 +08:00
sc c49ac6c885 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 23:29:10 +08:00
sc de56564372 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 23:20:38 +08:00
sc 83a38deaa6 mvvm模式升级从 packages.config 迁移到 PackageReference 2024-06-29 23:20:36 +08:00
sc 9ff4a7d035 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 23:10:54 +08:00
sc ec9eaedc64 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 23:10:53 +08:00
sc 6adc2ae527 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 23:05:55 +08:00
sc cb6facf0d4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 23:05:53 +08:00
sc 827e9cc387 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 22:56:13 +08:00
sc f57cb897fb Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 22:56:11 +08:00
sc 9fcb61fa52 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 22:46:37 +08:00
sc 0f0f2bfb30 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 22:46:35 +08:00
sc 8515d2b100 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 21:56:29 +08:00
sc 86ae16fa94 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 21:56:26 +08:00
sc f58bd85164 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-29 00:00:35 +08:00
sc 85bcc41e58 注册码显示逻辑修改 2024-06-29 00:00:33 +08:00
sc 9580a0f60c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-28 22:07:43 +08:00
sc 280062d86c 修改tcp的ip选择逻辑 2024-06-28 22:07:41 +08:00
sc 959392786e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-27 23:19:58 +08:00
sc df7bc3bae6 修改网络信息获取方式 2024-06-27 23:19:57 +08:00
sc edd40f136d Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-27 23:15:46 +08:00
sc dc4dfecf15 去除无效变量 2024-06-27 23:15:45 +08:00
sc 03f77e45c9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-27 23:13:38 +08:00
sc bc0c921d85 去除无效变量 2024-06-27 23:13:35 +08:00
sc 36af454eff Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-27 23:09:30 +08:00
sc 5474b42e7e 关闭程序逻辑bug处理 2024-06-27 23:09:28 +08:00
sc 3ea5a91776 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-27 23:01:24 +08:00
sc 6a706ea804 修改日志文件函数调用逻辑 2024-06-27 23:01:22 +08:00
sc e96e537d5e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-27 00:14:14 +08:00
sc 53fd4909ee Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-27 00:14:13 +08:00
sc 31ba1bad4c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-26 22:49:49 +08:00
sc adb98a0f46 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-26 22:49:46 +08:00
sc c1712f1368 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-25 22:42:23 +08:00
sc deb1e1bbe9 tcp 2024-06-25 22:42:21 +08:00
sc b6f3533709 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-25 21:01:34 +08:00
sc 785bacc182 添加tcp&udp 2024-06-25 21:01:31 +08:00
sc 263bb90b3d Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-25 11:27:53 +08:00
sc 2c1d2c0e5f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-25 11:27:38 +08:00
sc 0328ddfcd6 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-24 15:32:55 +08:00
sc 81e335fc62 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-24 15:32:52 +08:00
sc 1b6777f8ad Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-19 23:34:51 +08:00
sc d3a021dcf0 许可证安全检查逻辑调整 2024-06-19 23:34:48 +08:00
sc 5c929d8cc9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-06-12 09:26:38 +08:00
sc 8530d3d750 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-06-12 09:26:35 +08:00
sc 6c18a79a7b Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-20 23:24:45 +08:00
sc 3bffc936be Exchange页面完成 2024-05-20 23:24:44 +08:00
sc fc217d6448 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-20 20:49:24 +08:00
sc dd6bb40912 LOG日志修改 2024-05-20 20:49:22 +08:00
sc 85028a60bc Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-20 17:37:26 +08:00
sc 9f89693f97 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-20 17:37:25 +08:00
sc d8c9c8111c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-20 16:27:52 +08:00
sc 0c3fa8fd24 添加转换日志查询 2024-05-20 16:27:49 +08:00
sc f39cfd5cbd Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-20 15:45:38 +08:00
sc aa1b08f6c4 EX添加日志记录 2024-05-20 15:45:35 +08:00
sc fda9b5210a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-20 14:25:38 +08:00
sc 1ef3b73f5a 添加登录页面工作日志 2024-05-20 14:25:37 +08:00
sc abc214763c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-20 14:24:31 +08:00
sc efb99dcf3f 添加登录页面工作日志 2024-05-20 14:24:27 +08:00
sc baee6c4a5f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-20 14:04:44 +08:00
sc 2b50338365 添加报错记录 2024-05-20 14:04:41 +08:00
sc 57549329fe Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-18 17:31:33 +08:00
sc d59701122e 打印设置页面完成 2024-05-18 17:31:31 +08:00
sc cd1b5f6fb4 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-06 23:28:31 +08:00
sc ce4835ad11 添加表单选择 2024-05-06 23:28:29 +08:00
sc f2e356f8a2 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-06 19:21:48 +08:00
sc e70c0d3da2 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-06 19:21:45 +08:00
sc de1f6970e7 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-05-06 14:20:51 +08:00
sc 457eb5121a Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-06 14:20:49 +08:00
sc e12a692dce Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-05 00:04:38 +08:00
sc 7b5fed19c0 添加模板增减 2024-05-05 00:04:36 +08:00
sc 9ff4b10ed9 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-04 15:02:10 +08:00
sc 07e660a317 填加打印模板预览 2024-05-04 15:02:08 +08:00
sc 9551a3145e Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-04 14:07:22 +08:00
sc 502d657a0f Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-04 14:07:20 +08:00
sc d1921ced6c Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-03 23:19:14 +08:00
sc 1754131d54 打印模板选择修改 2024-05-03 23:19:12 +08:00
sc 5a7dee6b48 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-03 23:04:44 +08:00
sc 926b15bd4d Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-03 23:04:42 +08:00
sc 14bd70ce48 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-03 19:09:41 +08:00
sc 30e742f33a FASTREPORT语言包 2024-05-03 19:09:39 +08:00
sc 872e179104 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-03 19:00:36 +08:00
sc 4e0e102381 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-03 19:00:34 +08:00
sc c21d5df123 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-03 14:25:33 +08:00
sc 98ca46db07 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-05-03 14:25:25 +08:00
sc 2b274a6502 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-27 23:56:16 +08:00
sc d8276da446 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-27 23:56:14 +08:00
sc c8f7f01340 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-27 23:51:06 +08:00
sc 5a1df6c8c6 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-27 23:51:00 +08:00
sc cd632545bd Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-26 21:33:07 +08:00
sc fe5566f730 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-26 21:33:05 +08:00
sc d580eed74e Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-25 23:24:02 +08:00
sc 7567cce849 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-25 23:24:00 +08:00
sc 89cd7d3e6b Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-22 22:01:43 +08:00
sc ff58075e7b Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-22 22:01:41 +08:00
sc e0bdc68e8e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-18 17:09:58 +08:00
sc 8fc4999ccc 添加新单号清屏 2024-04-18 17:09:57 +08:00
sc 701c3abf26 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-18 16:13:17 +08:00
sc be7cfcdcaf 原料代码输入判定 2024-04-18 16:13:14 +08:00
sc 3b65c73608 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-18 15:39:38 +08:00
sc 3e7638a199 清楚后部输入空格 2024-04-18 15:39:37 +08:00
sc 57b2d5b356 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-18 15:30:36 +08:00
sc 6471eec033 目标重量换算问题修复 2024-04-18 15:30:34 +08:00
sc 3c41c2f150 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-18 14:47:23 +08:00
sc 7c3d3ecf3a 修改重复原料判断逻辑 2024-04-18 14:47:22 +08:00
sc ca2d99f28b Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-18 13:28:23 +08:00
sc 7ccfe7ba81 添加ex生效状态判断 2024-04-18 13:28:21 +08:00
sc 97c12e373b Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-15 21:59:20 +08:00
sc ca3156e314 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-15 21:59:18 +08:00
sc 41f15e168d Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-15 20:48:13 +08:00
sc 84ef66268e Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-15 20:48:11 +08:00
sc ec55b35065 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-14 23:32:49 +08:00
sc bf8f9a368a Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-14 23:32:48 +08:00
sc f3e9acf822 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-14 23:15:55 +08:00
sc ee4bc611ea 添加Code128(包含128A,128B,128C)类 2024-04-14 23:15:53 +08:00
sc 958279bd74 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-14 22:38:37 +08:00
sc 4928ff1178 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-14 22:38:32 +08:00
sc a5942b3285 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 23:14:12 +08:00
sc f3b5d1eca2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 23:14:07 +08:00
sc 1e2bfad5a1 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 23:07:19 +08:00
sc 0af25953b6 添加扩展程序状态显示 2024-04-03 23:07:17 +08:00
sc 505dfebd05 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 22:32:05 +08:00
sc 3c0270843f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 22:32:04 +08:00
sc c54ccea98c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 22:19:52 +08:00
sc 3d267018b1 添加ex页面 2024-04-03 22:19:50 +08:00
sc 6903e2264c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 21:02:32 +08:00
sc 4ba15a8e69 修改引导事件 2024-04-03 21:02:30 +08:00
sc 94ad77a58b Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 13:58:30 +08:00
sc 03810f8e10 提醒页面倒计时60秒Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 13:58:28 +08:00
sc fceb6cdea2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 13:57:55 +08:00
sc a6c37286f9 注册提示页面提前提醒 2024-04-03 13:57:53 +08:00
sc 900b9e59e9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 13:46:03 +08:00
sc eab45768e4 注册提醒页面关闭倒计时 2024-04-03 13:46:01 +08:00
sc 6ce7ce1cc2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-03 13:08:58 +08:00
sc c17474c77f 添加注册到期提示页面 2024-04-03 13:08:56 +08:00
sc de5d7202c2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-04-02 15:42:20 +08:00
sc 59ba780070 CDKEY提示修改 2024-04-02 15:41:45 +08:00
sc 9dafd3115e Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-04-01 00:15:06 +08:00
sc 8a4d7c6d4f CDKEY保存逻辑修改 2024-04-01 00:15:05 +08:00
sc 3af7ead309 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-31 23:50:34 +08:00
sc 8c38e3e12b 增加注册码功能 2024-03-31 23:50:31 +08:00
sc f7ec9127b6 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-29 21:07:21 +08:00
sc bfa5b59496 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-29 21:07:20 +08:00
sc 4d261383e3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-29 18:11:28 +08:00
sc 81c98ec936 添加CRC16校验 2024-03-29 18:11:25 +08:00
sc c8ed59e183 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-29 15:36:18 +08:00
sc 169753f266 添加CDKEY界面 2024-03-29 15:36:17 +08:00
sc 17d66e2bf2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-29 15:26:54 +08:00
sc 3d553d1eed Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-29 15:26:52 +08:00
sc 87980cc2da Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-27 23:32:18 +08:00
sc 424b63f0c5 修改SQL查询语句 2024-03-27 23:32:17 +08:00
sc d0131a2795 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-27 22:58:28 +08:00
sc 16f0c6ecf4 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-27 22:58:27 +08:00
sc 1b60fe900b Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-27 22:57:40 +08:00
sc e6d467057a 添加颜色名称页面 2024-03-27 22:57:39 +08:00
sc 714168f47f Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-27 22:24:35 +08:00
sc f558f56d42 添加客户管理页面 2024-03-27 22:24:33 +08:00
sc f8ec8a6759 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-27 21:52:40 +08:00
sc 4324fdd74b sql语句修改 2024-03-27 21:52:38 +08:00
sc a5efa3ca59 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-26 23:36:46 +08:00
sc e7dd94bb39 添加去除空白字符串代码(TrimEnd()) 2024-03-26 23:36:45 +08:00
sc 714de60f95 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-26 23:30:57 +08:00
sc 861d823ce9 添加布种管理页面 2024-03-26 23:30:56 +08:00
sc 254d5db8ef Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-26 00:01:53 +08:00
sc 2d4314a07f 添加登录者日志 2024-03-26 00:01:52 +08:00
sc a3477a1f1a Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-25 23:23:50 +08:00
sc 9f75476c47 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-25 23:23:49 +08:00
sc 48d8ecd8ca Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-25 23:01:38 +08:00
sc 292e41a5c4 添加RECIPE配方管理页面 2024-03-25 23:01:36 +08:00
sc d8abe646b7 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-03-25 20:31:22 +08:00
sc 693f291adc Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-25 20:31:19 +08:00
sc d3527f0f5c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-25 19:32:07 +08:00
sc 9858f2fcaf Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-25 19:32:04 +08:00
sc b524ca8050 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-24 17:24:18 +08:00
sc 621ea71c97 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-24 17:24:16 +08:00
sc 3a54fe47c5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-24 13:21:20 +08:00
sc 33f6e28cfa Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-24 13:21:18 +08:00
sc 165f707221 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-24 12:38:11 +08:00
sc b2e0d05648 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-24 12:38:08 +08:00
sc 8e64f6b27d Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-24 11:14:52 +08:00
sc b215016d91 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-24 11:14:50 +08:00
sc b69ee37cbb Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-20 13:49:18 +08:00
sc e7053ceab3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-20 13:49:16 +08:00
sc 4c2f130667 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-20 13:46:11 +08:00
sc 28c61a4255 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-20 13:46:09 +08:00
sc 5b3c4bd41a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-20 11:14:26 +08:00
sc ef749b4aab Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-03-20 11:14:24 +08:00
sc a708429adf Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2024-01-10 16:18:09 +08:00
sc d68355c547 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2024-01-10 16:18:07 +08:00
sc 3edea50871 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-27 23:32:18 +08:00
sc d02f6ebc0a 打印设置更改 2023-12-27 23:32:17 +08:00
sc 9f5ec7cb82 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-27 23:08:55 +08:00
sc 2e3daa042f 添加打印机查找 2023-12-27 23:08:53 +08:00
sc 691055f487 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-27 23:03:05 +08:00
sc e35c278cb2 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-27 23:02:56 +08:00
sc 0ea58e23c1 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-27 22:25:30 +08:00
sc b4e7e04a9e Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-27 22:25:29 +08:00
sc 3e0a2616b9 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-27 21:10:22 +08:00
sc a9675ed171 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-27 21:10:20 +08:00
sc de9487e1eb Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-25 00:13:58 +08:00
sc 25540082cf Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-25 00:13:54 +08:00
sc ec9380df5f Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-24 20:40:59 +08:00
sc fb76ba2bf1 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-24 20:40:58 +08:00
sc a1a993f7f1 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-12-24 20:31:37 +08:00
sc d2ecf44013 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-24 20:31:34 +08:00
sc 097c04f0a8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-13 23:59:48 +08:00
sc 5526e61fee Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-13 23:59:46 +08:00
sc e9bc3d2e3b Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-01 16:09:27 +08:00
sc d070d8b712 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-01 16:09:25 +08:00
sc 8c9743851f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-01 16:02:39 +08:00
sc f5ca4ba3d4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-01 16:02:38 +08:00
sc 4b08942fc0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-01 14:43:15 +08:00
sc 163f3e650a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-12-01 14:43:12 +08:00
sc cfaf6431c7 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-30 16:44:59 +08:00
sc f660b695f0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-30 16:44:56 +08:00
sc 55a30f9514 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-30 01:25:48 +08:00
sc 2726aa01ac Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-30 01:25:46 +08:00
sc 5618024f94 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-30 01:20:08 +08:00
sc a63feef32f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-30 01:20:06 +08:00
sc b0dadf8bf8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-29 22:11:29 +08:00
sc f430282fc4 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-29 22:11:27 +08:00
sc 0b8658dec7 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-27 22:56:30 +08:00
sc 6a902ef19c Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-27 22:56:28 +08:00
sc 8432928b6c Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-27 22:44:19 +08:00
sc 7303741ea4 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-27 22:44:17 +08:00
sc d1ddd96758 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-26 20:47:23 +08:00
sc 695f724c14 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-26 20:47:21 +08:00
sc 1494b59a3a Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-26 19:06:10 +08:00
sc 9301771bf9 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-26 19:06:08 +08:00
sc 65498580be Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-25 18:54:40 +08:00
sc 21ccf736d7 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-25 18:54:39 +08:00
sc a110d93acc Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-25 18:54:00 +08:00
sc e816a7d56c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-25 18:53:58 +08:00
sc 86f7958ed3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-25 16:27:44 +08:00
sc ae7ff52abf Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-25 16:27:43 +08:00
sc 3796012bcf Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-25 13:22:43 +08:00
sc 741704c8aa Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-25 13:22:41 +08:00
sc a0aa6ccbf5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 23:47:51 +08:00
sc bc9ec7d4bb Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 23:47:49 +08:00
sc 75e646e193 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 23:04:08 +08:00
sc 8aee8752ff Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 23:04:05 +08:00
sc 0445103ac0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 21:14:46 +08:00
sc acebf38128 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 21:14:44 +08:00
sc 6b58182ae9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 17:06:57 +08:00
sc 7e7987e8f4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 17:06:56 +08:00
sc 9175f12802 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 16:58:40 +08:00
sc 02582f4c90 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 16:58:38 +08:00
sc a5826b80e8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 16:35:33 +08:00
sc d6e4e0dd60 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 16:35:31 +08:00
sc 0df634ed6e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 02:10:24 +08:00
sc c120a2164f 配方列表编辑 2023-11-24 02:10:23 +08:00
sc cf69c71d3e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 01:51:47 +08:00
sc a3fdfef542 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 01:51:45 +08:00
sc e290681cee Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 00:45:34 +08:00
sc fa7882c34a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-24 00:45:33 +08:00
sc e324cd18ff Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 23:35:04 +08:00
sc 3cdcbed934 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 23:35:02 +08:00
sc fa77666ffb Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 23:07:40 +08:00
sc 1d6e6816f3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 23:07:39 +08:00
sc c8b271de12 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 18:40:45 +08:00
sc 656f120984 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 18:40:42 +08:00
sc ab557a192f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 18:25:27 +08:00
sc 8432d6391a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 18:25:25 +08:00
sc f64e213305 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 17:40:40 +08:00
sc 022876ce01 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 17:40:39 +08:00
sc 1b4c17bc7c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 17:36:47 +08:00
sc 92e5e0e268 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 17:36:45 +08:00
sc 2d92d624d0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 17:27:01 +08:00
sc 49376cdf02 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 17:26:59 +08:00
sc cbe00f5d93 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 17:25:08 +08:00
sc fedcf6abdc 记录当前单序号 2023-11-23 17:25:06 +08:00
sc 9ff7988cce 记录当前单序号 2023-11-23 13:46:49 +08:00
sc 5d2e2140b3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-23 00:30:43 +08:00
sc 1e84406190 更改原料页面类型选择框 2023-11-23 00:30:42 +08:00
sc ae559b8082 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 23:55:37 +08:00
sc bd64153d83 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 23:55:35 +08:00
sc 23f5f5e5ca Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 23:37:26 +08:00
sc 25a5a4836e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 23:37:24 +08:00
sc dab2f14ce3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 16:24:35 +08:00
sc d8f1c487d5 添加一个新类DataGridHelper,用于更新datagrid 2023-11-22 16:24:34 +08:00
sc 8d75eeb92c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 14:32:13 +08:00
sc c494f25c85 系统时间修改为DataContext数据层通知改变 2023-11-22 14:32:11 +08:00
sc d4b9a8b295 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 14:30:14 +08:00
sc f5bf396be5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 14:30:11 +08:00
sc 0bad135850 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 14:02:16 +08:00
sc ae35c93165 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 14:02:15 +08:00
sc de98aeeebb Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 13:38:29 +08:00
sc 020fdc37c8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 13:38:27 +08:00
sc eeea77ec27 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 00:41:13 +08:00
sc c6a3e931d9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-22 00:41:11 +08:00
sc 41e0c801a2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-21 17:19:36 +08:00
sc 50197a0a89 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-21 17:19:35 +08:00
sc 1827407b1f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-21 17:17:32 +08:00
sc c884ef0c34 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-21 17:17:30 +08:00
sc 5def852456 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-21 00:18:03 +08:00
sc 13b13e817a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-21 00:18:01 +08:00
sc f0c8a79abd Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-20 17:17:10 +08:00
sc 64e43048a2 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-20 17:17:07 +08:00
sc 8721f77c24 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-19 13:54:54 +08:00
sc 057a9dde63 增加溶解流程设置 2023-11-19 13:54:53 +08:00
sc 708d54ac0c Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-19 12:05:06 +08:00
sc 3f3aa0c817 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-19 12:05:05 +08:00
sc 15a43d59df Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-19 11:28:07 +08:00
sc c300cad9de Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-19 11:28:06 +08:00
sc b8839af3fa Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-19 11:23:13 +08:00
sc a3c807f02e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-19 11:23:11 +08:00
sc 4a4740ab44 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-17 23:24:22 +08:00
sc 589a453438 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-17 23:24:20 +08:00
sc aee1102b44 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-17 19:51:47 +08:00
sc 2679b72009 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-17 19:51:30 +08:00
sc aed2d7e654 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-17 16:23:11 +08:00
sc 75cc5dc5c3 原料离子类型选项调整 2023-11-17 16:23:08 +08:00
sc d1f72ca351 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-17 00:09:32 +08:00
sc 8c922d5cc0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-17 00:09:31 +08:00
sc aba38a4e3b Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-16 22:35:55 +08:00
sc 5bad675f46 添加原料离子类型项目 2023-11-16 22:35:52 +08:00
sc 5ac90e6e7f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-15 23:56:19 +08:00
sc 7833f7c34b Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-15 23:56:18 +08:00
sc 2ebe614f43 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-15 23:51:18 +08:00
sc a1d6e62944 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-15 23:51:15 +08:00
sc 44ac7618f3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 23:22:58 +08:00
sc d6150ae461 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 23:22:56 +08:00
sc 44de55a6b6 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 16:55:13 +08:00
sc 06d048ad85 账号是否启用管理 2023-11-14 16:55:11 +08:00
sc 9b679dc162 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 16:31:02 +08:00
sc 55deb51005 login功能加入用户登录及下拉框显示使用者 2023-11-14 16:30:57 +08:00
sc 16442b5ec0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 13:01:18 +08:00
sc 47b35b5afc Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 13:01:16 +08:00
sc 26b8ac1be4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 10:31:36 +08:00
sc 778b231542 机台设置及选择 2023-11-14 10:31:33 +08:00
sc eef6960d7a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 01:18:18 +08:00
sc 9407221589 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-14 01:18:15 +08:00
sc 847437fc2e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-13 00:13:44 +08:00
sc e2e5e66ac5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-13 00:13:42 +08:00
sc b8364c82a8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 22:40:55 +08:00
sc 9e4d938ef8 机台设置页面 2023-11-12 22:40:53 +08:00
sc f4355aad6e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 17:01:25 +08:00
sc 380165b4d6 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 17:01:23 +08:00
sc 6f7a4de477 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 01:41:21 +08:00
sc c5732e0603 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 01:41:19 +08:00
sc 99de404e7a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 01:35:06 +08:00
sc 9cc6f92ae2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 01:35:04 +08:00
sc c338f2450a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 01:15:10 +08:00
sc 97bef42947 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-12 01:15:08 +08:00
sc bef1833f70 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-11 23:00:44 +08:00
sc e4ea1d3d51 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-11 23:00:40 +08:00
sc 4dce33bf3e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-11 01:42:36 +08:00
sc 1e5fa12a7d Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-11 01:42:34 +08:00
sc 2e3d2edcbc Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-11 00:20:48 +08:00
sc c16e2e6f8d Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-11 00:20:46 +08:00
sc d9a02ed561 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 23:15:00 +08:00
sc 59e729b7e8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 23:14:59 +08:00
sc 6563a8dcb9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 22:19:53 +08:00
sc 1f667114a2 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 22:19:50 +08:00
sc 5bd17e4885 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 17:36:18 +08:00
sc 8944a781d0 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 17:36:17 +08:00
sc 15fb366f45 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 17:23:33 +08:00
sc 3f43ee4713 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 17:23:30 +08:00
sc cd81d4b29a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 00:05:14 +08:00
sc 2c46319d3c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-10 00:05:12 +08:00
sc aa652ada77 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-09 00:54:09 +08:00
sc 6327dd3e96 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-09 00:52:36 +08:00
sc 8f8c7e057d Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-08 00:25:01 +08:00
sc cc85c54dc3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-08 00:24:59 +08:00
sc 0ffe2c89b4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-08 00:15:15 +08:00
sc e8eedd0b1e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-08 00:15:12 +08:00
sc f66738f6dc Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-07 11:19:21 +08:00
sc 4dc2a56f13 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-07 11:19:19 +08:00
sc 27577fe321 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-07 10:22:34 +08:00
sc ff2d884109 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-07 10:22:32 +08:00
sc 7cc9d3ce94 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 23:34:40 +08:00
sc d072c0bc4d Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 23:34:39 +08:00
sc 27e851c242 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 23:32:21 +08:00
sc ab88512990 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 23:32:18 +08:00
sc 81f0f2c75f Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 23:24:21 +08:00
sc a2ead4ec4d Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 23:24:20 +08:00
sc 29eab2294a Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 20:12:41 +08:00
sc 87f724dfb7 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 20:12:40 +08:00
sc 84803ef813 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 19:48:40 +08:00
sc e628bc2575 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 19:48:39 +08:00
sc 42a47d299d Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 19:41:43 +08:00
sc 933db8739a Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 19:41:42 +08:00
sc eb1c07a908 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 19:09:10 +08:00
sc fd5df0a376 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-06 19:09:08 +08:00
sc 5b7912c4c9 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-05 23:03:00 +08:00
sc 40132a66cd Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-05 23:02:59 +08:00
sc 1b3a89df61 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-05 18:36:06 +08:00
sc 2df829ae72 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-05 18:36:05 +08:00
sc 34eec896fb Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-05 18:26:30 +08:00
sc a6fe8b2115 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-05 18:26:28 +08:00
sc 09c274d837 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-05 00:26:10 +08:00
sc 3bdeeb028d log信息添加 2023-11-05 00:26:08 +08:00
sc 0f07f926d6 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 22:54:43 +08:00
sc ea50ab692f data表格ID列调整 2023-11-04 22:54:41 +08:00
sc 11ad65de8f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 22:54:03 +08:00
sc 6613ff1b2e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 22:54:00 +08:00
sc 8959e752de Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 20:58:31 +08:00
sc de559186a4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 20:58:30 +08:00
sc 9090170cc3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 20:41:12 +08:00
sc 7fae8d82be Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 20:41:10 +08:00
sc de7527ae5a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 19:09:55 +08:00
sc e4e9ffa99f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 19:09:52 +08:00
sc aefde8c66a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 00:51:06 +08:00
sc 8759072722 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-04 00:51:05 +08:00
sc 348e02613f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-03 23:51:01 +08:00
sc 717e23fe3f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-03 23:50:59 +08:00
sc 98f459c14d Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-11-03 23:22:42 +08:00
sc 538ef707db Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-11-03 23:22:40 +08:00
sc a8b0f34d0e Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-31 23:44:48 +08:00
sc a90d2ff03e Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-31 23:44:47 +08:00
sc 7c4826761a Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-31 23:10:15 +08:00
sc 7e16bed67b Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-31 23:10:14 +08:00
sc a91f6213e0 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-31 22:42:57 +08:00
sc bcf132dd6c Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-31 22:42:54 +08:00
sc 19c276db37 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-31 19:59:11 +08:00
sc 223a40ce5f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-31 19:59:09 +08:00
sc 7430bfb3f5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-31 00:58:59 +08:00
sc 681f25ab5f Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-31 00:58:58 +08:00
sc 60d9ec6cc6 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 23:48:40 +08:00
sc 75d5fb5ec3 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 23:48:38 +08:00
sc 2d673f9109 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 23:00:54 +08:00
sc 14c659f7a9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 23:00:52 +08:00
sc 83a52afca7 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 20:57:57 +08:00
sc e68dda7e00 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 20:57:56 +08:00
sc 9eded69ecf Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 20:35:25 +08:00
sc 77998062dc Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 20:35:19 +08:00
sc 7322ff0ebc Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 20:06:30 +08:00
sc b2ecc00ff9 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 20:06:28 +08:00
sc 2393e31f93 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 20:00:08 +08:00
sc e4f563662e Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 20:00:06 +08:00
sc 652f8a62ae Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 19:47:40 +08:00
sc 1bfbd9cc8d Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-30 19:45:51 +08:00
sc 025c38f4db Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-28 00:20:07 +08:00
sc 91a6ef1356 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-28 00:20:05 +08:00
sc 5602b26eb1 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-27 22:44:31 +08:00
sc 1142a796c8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-27 22:44:29 +08:00
sc 0cc814626a Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-27 00:46:29 +08:00
sc 16fd9e5457 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-27 00:46:27 +08:00
sc 0ed98e98b4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-26 22:57:56 +08:00
sc 624c09864c Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-26 22:57:54 +08:00
sc a161a7d5b5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-26 22:57:24 +08:00
sc 5e93a8c7d5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-26 22:57:23 +08:00
sc 89b09ce3ab Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-26 20:03:51 +08:00
sc 10e8a355ec Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-26 20:03:45 +08:00
sc 96dee20469 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-25 23:46:09 +08:00
sc 1cc7eaf243 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-25 23:46:07 +08:00
sc f1d5d82a5a Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-25 19:04:59 +08:00
sc 487b5d8b78 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-25 19:04:57 +08:00
sc 5ca457e990 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-25 18:23:13 +08:00
sc 8b65d6f4b4 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-25 18:23:12 +08:00
sc 09b4615871 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 23:18:01 +08:00
sc 26085f9971 数据库备份还原功能 2023-10-24 23:18:00 +08:00
sc 54ca2b6791 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 23:06:23 +08:00
sc e49884f1c2 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 23:06:21 +08:00
sc 679d9cff9f Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 20:53:58 +08:00
sc 52f788088b Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-24 20:53:56 +08:00
sc 2cb0127500 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-24 14:49:14 +08:00
sc 33e984f4e0 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 14:48:57 +08:00
sc 529f8086f7 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 00:21:36 +08:00
sc d1326804ab Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 00:21:35 +08:00
sc 50159dde60 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 00:14:26 +08:00
sc d73d6ceed9 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-24 00:14:25 +08:00
sc 1507cb3ceb Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-23 23:37:36 +08:00
sc 3638b18a78 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-23 23:37:30 +08:00
sc 7f4fa2b468 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-23 21:58:55 +08:00
sc c2c5e1bca5 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-23 21:58:53 +08:00
sc 5b9adcb133 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-23 19:24:02 +08:00
sc 050685b856 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-23 19:24:00 +08:00
sc e05e8b2ea8 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-23 12:35:36 +08:00
sc 45a8729dd5 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-23 12:35:34 +08:00
sc 16197631d4 Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage 2023-10-23 12:28:02 +08:00
sc ec49beb061 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-23 12:28:00 +08:00
sc 4f8d4b2796 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-22 22:28:05 +08:00
sc d6e6e25f91 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-22 22:28:02 +08:00
sc 8bc6822eaf Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-22 22:11:29 +08:00
sc 004529ebb1 添加软件设置页面 2023-10-22 22:11:27 +08:00
sc 1de6e0b914 Merge branch 'master' of http://192.168.0.12:13000/sc/formula_manage 2023-10-22 20:32:39 +08:00
sc 6a46c0a1e2 SQL设置页面完成 2023-10-22 20:32:36 +08:00
114 changed files with 58465 additions and 264 deletions

No files matched your search

+90 -2
View File
@@ -1,6 +1,94 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup> </startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Xceed.Wpf.AvalonDock" publicKeyToken="3e4669d2f30244f4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.6.0.0" newVersion="4.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="FastReport.Compat" publicKeyToken="406e1f4c3c8ef97e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2024.1.0.0" newVersion="2024.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="FastReport.Compat" publicKeyToken="5ceb240df42bf6e8" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2024.2.2.0" newVersion="2024.2.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.7.0" newVersion="2.0.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetty.Transport" publicKeyToken="bc13ca065fa06c29" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.7.6.0" newVersion="0.7.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetty.Buffers" publicKeyToken="bc13ca065fa06c29" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.7.6.0" newVersion="0.7.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetty.Codecs.Http" publicKeyToken="bc13ca065fa06c29" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.7.6.0" newVersion="0.7.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetty.Common" publicKeyToken="bc13ca065fa06c29" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.7.6.0" newVersion="0.7.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetty.Codecs" publicKeyToken="bc13ca065fa06c29" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.7.6.0" newVersion="0.7.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.17.0" newVersion="2.0.17.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.2" newVersion="8.0.0.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>
+7 -2
View File
@@ -2,8 +2,13 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:formula_manage" xmlns:local="clr-namespace:formula_manage"
StartupUri="Login.xaml"> Startup="Application_Startup"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
d1p1:Ignorable="d" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
>
<Application.Resources> <Application.Resources>
<ResourceDictionary>
<vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" xmlns:vm="clr-namespace:formula_manage.ViewModel" />
</ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>
+65 -16
View File
@@ -1,9 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.IO;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
namespace formula_manage namespace formula_manage
@@ -12,7 +8,11 @@ namespace formula_manage
/// App.xaml 的交互逻辑 /// App.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class App : Application public partial class App : Application
{ { /// <summary>
///公共变量来自Login的用户名
/// </summary>
public static string USER_Purview { get; set; }
public App() public App()
{ {
this.Startup += new StartupEventHandler(App_Startup); this.Startup += new StartupEventHandler(App_Startup);
@@ -40,25 +40,74 @@ namespace formula_manage
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{ {
e.Handled = true; e.Handled = true;
if (e.Exception.InnerException == null) if (e.Exception.InnerException == null)
{ {
MessageBox.Show("发生了一个无法处理的错误!请联系SUNLIGHT处理!" + Environment.NewLine MessageBox.Show("发生了一个无法处理的错误!请联系SUNLIGHT处理!"
// + "(2)错误源:" + e.Exception.Source + Environment.NewLine + "(1)错误" + Environment.NewLine
+ "详细信息:" + e.Exception.Message + Environment.NewLine + "(2)错误源:" + e.Exception.Source + Environment.NewLine
// + "(4)报错区域:" + e.Exception.StackTrace // + (3)详细信息:" + e.Exception.Message + Environment.NewLine
// + "(4)报错区域:" + e.Exception.StackTrace
); );
} }
else else
{ {
MessageBox.Show("发生了一个无法处理的错误!请联系SUNLIGHT处理!" + Environment.NewLine MessageBox.Show("发生了一个无法处理的错误!请联系SUNLIGHT处理!"
// + "(2)错误源:" + e.Exception.InnerException.Source + Environment.NewLine + "(1)错误" + Environment.NewLine
+ "错误信息:" + e.Exception.Message + Environment.NewLine // + "(2)错误源:" + e.Exception.InnerException.Source + Environment.NewLine
// + "(4)详细信息:" + e.Exception.InnerException.Message + Environment.NewLine + "(3)错误信息:" + e.Exception.Message + Environment.NewLine
// + "(5)报错区域:" + e.Exception.InnerException.StackTrace // + "(4)详细信息:" + e.Exception.InnerException.Message + Environment.NewLine
// + "(5)报错区域:" + e.Exception.InnerException.StackTrace
); );
} }
string Log_time = DateTime.Now.ToString("yyyy-MM-dd");
string logpath = System.Environment.CurrentDirectory + "\\ERR";//日志文件目录
//string logPathtxt = "" + System.Environment.CurrentDirectory + "\\Log\\"+ Log_time + "Log.txt";//日志文件
// System.IO.DirectoryInfo log = new System.IO.DirectoryInfo();//生成日志文件目录
string log_path = logpath + "\\ERR" + Log_time + ".txt";
string Log_timehms = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
if (Directory.Exists(logpath))//检查日志路径
{
if (!File.Exists(log_path))//检查文件并写入
{
FileStream fs = new FileStream(log_path, FileMode.CreateNew, FileAccess.Write);//创建文件
StreamWriter wr = new StreamWriter(fs);//创建文件
wr.Close();
FileStream fil = new FileStream(log_path, FileMode.Append, FileAccess.Write);//创建写入文件
StreamWriter wfil = new StreamWriter(fil);//创建文件
wfil.WriteLine("[" + Log_timehms + "];[Error] ||" + Environment.NewLine.ToString());
wfil.WriteLine("[" + Log_timehms + "];[Error source] ||" + e.Exception.Source.ToString() + Environment.NewLine.ToString());
wfil.WriteLine("[" + Log_timehms + "];[Error message] ||" + e.Exception.Message.ToString() + Environment.NewLine.ToString());
wfil.WriteLine("[" + Log_timehms + "];[Error area] ||" + e.Exception.StackTrace.ToString());
wfil.Close();
} }
else
{
FileStream fs = new FileStream(log_path, FileMode.Append, FileAccess.Write);//创建写入文件
StreamWriter wr = new StreamWriter(fs);//创建文件
wr.WriteLine("[" + Log_timehms + "];[Error] ||" + Environment.NewLine.ToString());
wr.WriteLine("[" + Log_timehms + "];[Error source] ||" + e.Exception.Source.ToString() + Environment.NewLine.ToString());
wr.WriteLine("[" + Log_timehms + "];[Error message] ||" + e.Exception.Message.ToString() + Environment.NewLine.ToString());
wr.WriteLine("[" + Log_timehms + "];[Error area] ||" + e.Exception.StackTrace.ToString());
wr.Close();
}
}
else
{
DirectoryInfo directoryInfo = new DirectoryInfo(logpath);
directoryInfo.Create();
}
}
/// <summary>
/// 启动初始页面
/// </summary>
private void Application_Startup(object sender, StartupEventArgs e)
{
Application.Current.StartupUri = new Uri("Login.xaml", UriKind.Relative);//和MainWindwo同一目录
//Application.Current.StartupUri = new Uri("EX/ExProgram.xaml", UriKind.Relative);//在目录下
}
} }
} }
+74
View File
@@ -0,0 +1,74 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace formula_manage.ConvertMoels
{
/// <summary>
/// 设备类型数值转换器
///
/// </summary>
internal class CategoriesSQLConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string Categories = System.Convert.ToString(value);
if (Categories == "0")//类型
{
return "溢流";
}
else
{
if (Categories == "1")
{
return "气流";
}
else
{
if (Categories == "2")
{
return "轧染";
}
else
{
if (Categories == "3")
{
return "卷染";
}
else
{
if (Categories == "4")
{
return "喷染";
}
else
{
if (Categories == "5")
{
return "筒纱";
}
else
{
if (Categories == "7")
{
return "成衣";
}
else
{
return "未知类型";
}
}
}
}
}
}
}
}
/// <summary>
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}
+8 -5
View File
@@ -1,14 +1,17 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Windows.Data;
using System.Text;
using System.Threading.Tasks;
namespace formula_manage.ConvertMoels namespace formula_manage.ConvertMoels
{ {
internal class ColorSQLConvert /// <summary>
/// RGB色彩数值转换器
/// 将色彩数值转换为ARGB代码返回
/// </summary>
public class ColorSQLConvert : IValueConverter
{ {
/// <summary>
/// </summary>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {
if (value != null) if (value != null)
+28
View File
@@ -0,0 +1,28 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace Audit.ConvertMoels
{
internal class DeviationConvert : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
string a = System.Convert.ToString(values[0]);//转换数组1的信息
string b = System.Convert.ToString(values[1]);//转换数组2的信息
if (a != "" && b != "")
{
string c = (System.Convert.ToSingle(b) - System.Convert.ToSingle(a)).ToString("0.0");//计算值1和2的差值并返回字符串
//string c = "0";
return c;
}
return null;
}
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
+31
View File
@@ -0,0 +1,31 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace Audit.ConvertMoels
{
/// <summary>
/// 零值标红转换器
/// DispenseGrams为零的单元格文本标红返回
/// </summary>
internal class GramsSQLConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string G = System.Convert.ToString(value);
if (G == "0")//判断单元格值是否为零
{
return "red";//零返回红色
}
else
{
return "black";//非零返回黑色
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}
+46
View File
@@ -0,0 +1,46 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace formula_manage.ConvertMoels
{
/// <summary>
/// 设备数值转换器
///
/// </summary>
internal class IndustrySQLConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string Industry = System.Convert.ToString(value);
if (Industry == "0")//类型
{
return "浸染";
}
else
{
if (Industry == "1")
{
return "连染";
}
else
{
if (Industry == "2")
{
return "印染";
}
else
{
return "未知类型";
}
}
}
}
/// <summary>
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}
+92
View File
@@ -0,0 +1,92 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace formula_manage.ConvertMoels
{
internal class IonSQLConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string stuff_ion = System.Convert.ToString(value);
if (stuff_ion == "0")//类型
{
return "分散";
}
else
{
if (stuff_ion == "1")
{
return "酸性";
}
else
{
if (stuff_ion == "2")
{
return "活性";
}
else
{
if (stuff_ion == "3")
{
return "中性";
}
else
{
if (stuff_ion == "4")
{
return "硫化";
}
else
{
if (stuff_ion == "5")
{
return "阳离子";
}
else
{
if (stuff_ion == "6")
{
return "阴离子";
}
else
{
if (stuff_ion == "7")
{
return "非离子";
}
else
{
if (stuff_ion == "8")
{
return "酞菁";
}
else
{
if (stuff_ion == "9")
{
return "直接";
}
else
{
return "未知类型";
}
}
}
}
}
}
}
}
}
}
}
/// <summary>
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}
+2 -5
View File
@@ -1,13 +1,10 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Windows.Data;
using System.Text;
using System.Threading.Tasks;
namespace formula_manage.ConvertMoels namespace formula_manage.ConvertMoels
{ {
internal class ProductTypeSQLConvert internal class ProductTypeSQLConvert : IValueConverter
{ {
/// <summary> /// <summary>
/// </summary> /// </summary>
+43
View File
@@ -0,0 +1,43 @@
using System;
using System.Windows.Data;
/// <summary>
/// 运行状态变换器
/// 输入:状态码
/// 输出:状态文字
/// </summary>
namespace Audit.ConvertMoels
{
internal class StatenConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
{
return null;
}
else
{
string Staten = null;
string i = value.ToString();
if (i == "101") Staten = "准备就绪";
if (i == "102") Staten = "计量输送";
if (i == "201") Staten = "自动状态";
if (i == "202") Staten = "转入排队";
if (i == "203") Staten = "等待命令";
if (i == "301") Staten = "工单完成";
if (i == "309") Staten = "输送异常";
return Staten;
}
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Windows.Data;
namespace Audit.ConvertMoels
{
internal class StatenERRConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
{
return null;
}
else
{
if (value.ToString() == "309")
{
return "red";//零返回红色
}
else
{
return "black";//非零返回黑色
}
}
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
+44
View File
@@ -0,0 +1,44 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace formula_manage.ConvertMoels
{
internal class UserSQLConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string Capacity = System.Convert.ToString(value);
if (Capacity == "0")//类型
{
return "停用";
}
else
{
if (Capacity == "1")
{
return "限制";
}
else
{
if (Capacity == "2")
{
return "启用";
}
else
{
return "未知类型";
}
}
}
}
/// <summary>
/// </summary>
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}
+22
View File
@@ -0,0 +1,22 @@
<Window x:Class="formula_manage.EX.ExProgram"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.EX"
mc:Ignorable="d"
Title="ExProgram" Height="720" Width="1280" MinHeight="720" MinWidth="1280" Background="#FFE0E0E0">
<Grid>
<RichTextBox x:Name="textLog" Margin="0,300,0,0" IsReadOnly="True" VerticalScrollBarVisibility="Visible" Background="White">
<FlowDocument>
<Paragraph>
<Run Text="TEXTLOG"/>
</Paragraph>
</FlowDocument>
</RichTextBox>
</Grid>
</Window>
+17
View File
@@ -0,0 +1,17 @@
using formula_manage.UserClass;
using System.Windows;
namespace formula_manage.EX
{
/// <summary>
/// ExProgram.xaml 的交互逻辑
/// </summary>
public partial class ExProgram : Window
{
public ExProgram()
{
InitializeComponent();
LogDataRead.SetTextControl(textLog);
}
}
}
+34
View File
@@ -0,0 +1,34 @@
<Window x:Class="formula_manage.EX.Exchange"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.EX"
mc:Ignorable="d"
DataContext="{Binding Source={StaticResource Locator}, Path=Exchange}"
Title="Exchange" Height="720" Width="1280" MinHeight="720" MinWidth="1280" Background="#FFE0E0E0">
<Grid>
<DataGrid x:Name="gridLog" Margin="5,5,0,5" HorizontalAlignment="Left" Width="245" HeadersVisibility ="Column" Background="White" BorderBrush="White"
IsReadOnly="True" AutoGenerateColumns="False" MouseDoubleClick="DataGrid_gridLogClick" >
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTextColumn Binding="{Binding Name}" Header="文件" Width="195" MaxWidth="195" MinWidth="195" CanUserReorder="False"/>
<DataGridTextColumn Binding="{Binding Length}" Header="大小" Width="50" MaxWidth="50" MinWidth="50" CanUserReorder="False"/>
<DataGridTextColumn Binding="{Binding CreationTimeUtc}" Header="创建时间" Width="150" MaxWidth="150" MinWidth="150" CanUserReorder="False"/>
<DataGridTextColumn Binding="{Binding LastWriteTimeUtc}" Header="最后修改时间" Width="150" MaxWidth="150" MinWidth="150" CanUserReorder="False"/>
</DataGrid.Columns>
</DataGrid>
<RichTextBox x:Name="Logtext" Margin="255,5,5,5" IsReadOnly="True" VerticalScrollBarVisibility="Visible" Background="White" SelectionBrush="White">
<FlowDocument>
<Paragraph>
<Run Text="LOG"/>
</Paragraph>
</FlowDocument>
</RichTextBox>
<!--遮罩-->
<Grid Grid.Column="1" x:Name="logR" Margin="0,0,0,0" Background="White" Opacity="0.8" Visibility="Hidden">
<TextBlock Height="50" Margin="0,0,0,150" TextWrapping="Wrap" Text="文件读取中请稍后..." Width="300" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</Grid>
</Window>
+88
View File
@@ -0,0 +1,88 @@
using System;
using System.Data;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
namespace formula_manage.EX
{
/// <summary>
/// Exchange.xaml 的交互逻辑
/// </summary>
public partial class Exchange : Window
{
string Log_time = DateTime.Now.ToString("yyyy-MM-dd");
DataTable logdataTable = new DataTable(); //建立RRODUCT缓存
public Exchange()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
logdataTable.Columns.Add("Name", typeof(string));
logdataTable.Columns.Add("Length", typeof(int));
logdataTable.Columns.Add("CreationTimeUtc", typeof(string));
logdataTable.Columns.Add("LastWriteTimeUtc", typeof(string));
LOG_file();
}
private void LOG_file()//建立列表
{
DirectoryInfo loginfo = new DirectoryInfo(System.Environment.CurrentDirectory + "\\Exchange"); //new文件夹
foreach (var item in loginfo.GetFiles())
{
DataRow FileRow = logdataTable.NewRow();
FileRow["Name"] = item.Name;
FileRow["Length"] = item.Length / 1024;
FileRow["CreationTimeUtc"] = item.CreationTimeUtc;
FileRow["LastWriteTimeUtc"] = item.LastWriteTimeUtc;
logdataTable.Rows.Add(FileRow);
}
gridLog.ItemsSource = logdataTable.DefaultView;
}
private void DataGrid_gridLogClick(object sender, MouseButtonEventArgs e)//数据表双击事件
{
int rownum = gridLog.SelectedIndex;//获取鼠标选中行并定义变量
logR.Visibility = Visibility.Visible; //开启页面遮罩
if (rownum != -1)//判断鼠标定位是否有效
{
/*定位选中行及指定列单元格文本信息*/
LOGDATA_file((gridLog.Columns[0].GetCellContent(gridLog.Items[rownum]) as TextBlock).Text.TrimEnd());//
}
logR.Visibility = Visibility.Hidden;
}
private void LOGDATA_file(string dat) //读取文件显示到前端
{
Logtext.Document = new FlowDocument();
string filePath = System.Environment.CurrentDirectory + "\\Exchange\\";
try
{
// 使用StreamReader读取文件
using (StreamReader reader = new StreamReader(filePath + dat))
{
// 读取文件直到文件的末尾
while (!reader.EndOfStream)
{
// 添加文件的每一行到RichTextBox
Logtext.AppendText(reader.ReadLine() + "\r\n");
}
}
}
catch (Exception ex)
{
// 处理可能发生的任何异常
MessageBox.Show("Error reading file: " + ex.Message);
}
}
}
}
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" DoublePass="true" ReportInfo.Created="05/03/2024 18:43:19" ReportInfo.Modified="05/04/2024 14:44:19" ReportInfo.CreatorVersion="2024.2.2.0">
<Dictionary/>
<ReportPage Name="Page1" Watermark.Font="宋体, 60pt">
<ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8">
<TextObject Name="Text1" Left="283.5" Top="9.45" Width="94.5" Height="18.9" Text="领料单" Font="宋体, 15.75pt"/>
</ReportTitleBand>
<PageHeaderBand Name="PageHeader1" Top="41.8" Width="718.2" Height="28.35"/>
<DataBand Name="Data1" Top="74.15" Width="718.2" Height="75.6"/>
<PageFooterBand Name="PageFooter1" Top="153.75" Width="718.2" Height="18.9"/>
</ReportPage>
</Report>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" DoublePass="true" ReportInfo.Created="05/03/2024 18:43:19" ReportInfo.Modified="05/04/2024 15:07:10" ReportInfo.CreatorVersion="2024.2.2.0">
<Dictionary/>
<ReportPage Name="Page1" PaperWidth="80" Guides="472.5" Watermark.Font="宋体, 60pt">
<ReportTitleBand Name="ReportTitle1" Width="226.8" Height="37.8"/>
<DataBand Name="Data1" Top="41.8" Width="226.8" Height="302.4">
<BarcodeObject Name="Barcode1" Left="529.2" Top="9.45" Width="172" Height="122" Barcode="PDF417" Barcode.AspectRatio="0.5" Barcode.Columns="0" Barcode.Rows="0" Barcode.CodePage="437" Barcode.CompactionMode="Auto" Barcode.ErrorCorrection="Auto" Barcode.PixelSize="2, 8"/>
<BarcodeObject Name="Barcode2" Left="47.25" Top="9.45" Width="126.25" Height="94.5" Barcode="GS1-128 (UCC/EAN-128)" Barcode.AutoEncode="true"/>
</DataBand>
</ReportPage>
</Report>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
Want to create localization for your language? Please drop an email to tz@fast-report.com.
+1 -13
View File
@@ -1,16 +1,4 @@
using System; using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace formula_manage namespace formula_manage
{ {
+11
View File
@@ -0,0 +1,11 @@
namespace formula_manage
{
/// <summary>
/// 查询接口
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IProvider<T> where T : class
{
}
}
+7 -4
View File
@@ -14,13 +14,16 @@
<ImageBrush ImageSource="/sunlight_logotext.jpg"/> <ImageBrush ImageSource="/sunlight_logotext.jpg"/>
</Rectangle.Fill> </Rectangle.Fill>
</Rectangle> </Rectangle>
<ComboBox x:Name="User" Height="24" Margin="60,164,10,0" VerticalAlignment="Top" FontSize="14" IsEditable="True" KeyUp="SearchBox_OnKeyDownd"/> <ComboBox x:Name="User" DisplayMemberPath="UserCode" IsTextSearchEnabled ="False" Height="24" Margin="60,164,10,0" VerticalAlignment="Top" FontSize="14" IsEditable="True" KeyUp="SearchBox_OnKeyDownd"/>
<PasswordBox x:Name="Pasword" Height="24" Margin="60,210,10,0" VerticalAlignment="Top" FontSize="14" KeyUp="SearchBox_OnKeyDownd"/> <PasswordBox x:Name="Pasword" Height="24" Margin="60,210,10,0" VerticalAlignment="Top" FontSize="14" KeyUp="SearchBox_OnKeyDownd"/>
<TextBlock HorizontalAlignment="Left" Height="26" Margin="10,163,0,0" TextWrapping="Wrap" Text="账号:" VerticalAlignment="Top" Width="45" FontSize="20" RenderTransformOrigin="0.833,0.478"/> <TextBlock HorizontalAlignment="Left" Height="26" Margin="10,163,0,0" TextWrapping="Wrap" Text="账号:" VerticalAlignment="Top" Width="45" FontSize="20" RenderTransformOrigin="0.833,0.478"/>
<TextBlock HorizontalAlignment="Left" Height="26" Margin="10,208,0,0" TextWrapping="Wrap" Text="密码:" VerticalAlignment="Top" Width="45" FontSize="20" RenderTransformOrigin="0.833,0.478"/> <TextBlock HorizontalAlignment="Left" Height="26" Margin="10,208,0,0" TextWrapping="Wrap" Text="密码:" VerticalAlignment="Top" Width="45" FontSize="20" RenderTransformOrigin="0.833,0.478"/>
<Button x:Name="logon" Content="登录" HorizontalAlignment="Left" Height="23" Margin="60,264,0,0" VerticalAlignment="Top" Width="44" Click="Button_Click_1" Background="#FFDDDDDD" Foreground="Black" BorderBrush="White"/> <Button x:Name="logon" Content="登录" HorizontalAlignment="Left" Height="33" Margin="40,264,0,0" VerticalAlignment="Top" Width="64" Click="Button_Click_1" Background="#FFDDDDDD" Foreground="Black" BorderBrush="White"/>
<Button Content="退出" HorizontalAlignment="Left" Height="23" Margin="140,264,0,0" VerticalAlignment="Top" Width="44" Click="Button_Click" Background="#FFDDDDDD" Foreground="Black" BorderBrush="White"/> <Button Content="退出" HorizontalAlignment="Right" Height="33" Margin="140,264,40,0" VerticalAlignment="Top" Width="64" Click="Button_Click" Background="#FFDDDDDD" Foreground="Black" BorderBrush="White"/>
<TextBlock Height="30" Margin="15,115,15,0" TextWrapping="Wrap" Text="尚彩科技单据管理系统" VerticalAlignment="Top" FontSize="20"/> <TextBlock Height="30" Margin="15,115,15,0" TextWrapping="Wrap" Text="尚彩科技单据管理系统" VerticalAlignment="Top" FontSize="20"/>
<TextBox x:Name="DISPENLINK" HorizontalAlignment="Left" Height="15" Margin="0,0,0,0" TextWrapping="Wrap" Text="DISPEN" VerticalAlignment="Bottom" Width="50" Background="#FFF1F1F1" BorderBrush="#FF989898" Focusable="False" MaxLines="1" FontSize="11"/>
<TextBox x:Name="DBCLINK" HorizontalAlignment="Left" Height="15" Margin="50,0,0,0" TextWrapping="Wrap" Text="DBC" VerticalAlignment="Bottom" Width="50" Background="#FFF1F1F1" BorderBrush="#FF989898" FontSize="11" MaxLines="1"/>
<TextBox x:Name="EXLINK" HorizontalAlignment="Left" Height="15" Margin="100,0,0,0" TextWrapping="Wrap" Text="EX" VerticalAlignment="Bottom" Width="50" Background="#FFF1F1F1" BorderBrush="#FF989898" FontSize="11" MaxLines="1"/>
<TextBox x:Name="USERLINK" HorizontalAlignment="Left" Height="15" Margin="150,0,0,0" TextWrapping="Wrap" Text="USER" VerticalAlignment="Bottom" Width="98" Background="#FFF1F1F1" BorderBrush="#FF989898" MaxLines="1" FontSize="11"/>
</Grid> </Grid>
</Window> </Window>
+165 -23
View File
@@ -1,20 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Data;
using System.Data.SqlClient;
using System.Linq; using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Runtime.InteropServices;
using System.Data.SqlClient;
namespace formula_manage namespace formula_manage
{ {
@@ -23,30 +14,72 @@ namespace formula_manage
/// </summary> /// </summary>
public partial class Login : Window public partial class Login : Window
{ {
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
DataTable logindataTable = new DataTable(); //建立login缓存
public Login() public Login()
{ {
WindowStartupLocation = WindowStartupLocation.CenterScreen; WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent(); InitializeComponent();
UserClass.LogGing.LogGingDATA("FORMULA_start");
} }
private void Button_Click(object sender, RoutedEventArgs e) //退出按钮事件 private void Button_Click(object sender, RoutedEventArgs e) //退出按钮事件
{ {
this.Close(); UserClass.LogGing.LogGingDATA("FORMULA_LogStop");
Window window = Window.GetWindow(this);
window.Close();
} }
private void Button_Click_1(object sender, RoutedEventArgs e) //登录按钮事件 private void Button_Click_1(object sender, RoutedEventArgs e) //登录按钮事件
{ {
// if ((User.Text == "engineer" || User.Text == "ENGINEER") && (Pasword.Password == "engineer" || Pasword.Password == "ENGINEER")) string user = User.Text;
string pasword = Pasword.Password; ;
if (User.Text == "") //检查用户名输入
{ {
System.Windows.MessageBox.Show("请输入用户名");
return;
}
if ((user == "engineer" || user == "ENGINEER") && (pasword == "engineer" || pasword == "ENGINEER")) //确认账号是否是工程师
{
App.USER_Purview = "ENGINEER";//传入用户名
Window window = Window.GetWindow(this); Window window = Window.GetWindow(this);
MainWindow Main = new MainWindow(); MainWindow Main = new MainWindow();
window.Close(); window.Close();
Main.ShowDialog();//实例化并置顶打开信息窗口
UserClass.LogGing.LogGingDATA("LOGon = ENGINEER");
Main.ShowDialog();//实例化并置顶打开窗口
} }
/* else else
{ {
string var_sql;
if (pasword == "") var_sql = "[UserCode]='" + user + "' and [PassWord] is null"; //查询字符
else var_sql = "[UserCode]='" + user + "' and [PassWord]='" + pasword + "'";
var loginOK = this.logindataTable.Select(var_sql).FirstOrDefault(); //查询账号信息是否正确,不正确返回null
if (loginOK != null)
{
App.USER_Purview = User.Text;//传入用户名
Window window = Window.GetWindow(this);
MainWindow Main = new MainWindow();
window.Close();
UserClass.LogGing.LogGingDATA("LOGon = " + user);
Main.ShowDialog();//实例化并置顶打开窗口
}
else
System.Windows.MessageBox.Show("账号或密码错误"); System.Windows.MessageBox.Show("账号或密码错误");
}*/ }
} }
private void SearchBox_OnKeyDownd(object sender, System.Windows.Input.KeyEventArgs e) //回车跳转功能 private void SearchBox_OnKeyDownd(object sender, System.Windows.Input.KeyEventArgs e) //回车跳转功能
@@ -59,24 +92,57 @@ namespace formula_manage
} }
} }
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini";
string TEXT_SQLIP; string TEXT_SQLIP;
string TEXT_SQLNAME; string TEXT_SQLNAME;
string TEXT_SQMOD; string TEXT_SQMOD;
string TEXT_SQLUSER; string TEXT_SQLUSER;
string TEXT_SQLPASWOR; string TEXT_SQLPASWOR;
string Connstr_SC; string Connstr_SC;
private void Window_Loaded(object sender, RoutedEventArgs e) string Connstr_DBC;
bool SQL2;
private async void Window_Loaded(object sender, RoutedEventArgs e)
{ {
logon.IsEnabled = false; //关闭登录按钮 logon.IsEnabled = false; //关闭登录按钮
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
if (!Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L1")))//连接状态显示是否生效 1有效
{
DISPENLINK.Visibility = Visibility.Hidden; //不显示
DBCLINK.Visibility = Visibility.Hidden;
EXLINK.Visibility = Visibility.Hidden;
USERLINK.Visibility = Visibility.Hidden;
DISPENLINK.Background = Brushes.Red;
}
if (Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L6")))
{
try
{
EXLINK.Background = Brushes.Green;
}
catch (Exception)
{
EXLINK.Background = Brushes.Red;
System.Windows.MessageBox.Show("扩展程序未启动");
UserClass.LogGing.LogGingDATA("EX = FALL_TO_START");
}
}
try
{
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件 TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2"); TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3"); TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4"); TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5"); TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
SQL2 = Boolean.Parse(Configini.IniReadvalue("SQL_SERVER", "SQL6")); //数据库对象2是否生效
}
catch (Exception)
{
System.Windows.MessageBox.Show("配置信息丢失");
}
if (TEXT_SQMOD == "0") //判断连接方式 if (TEXT_SQMOD == "0") //判断连接方式
{ {
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI"; Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
@@ -85,15 +151,91 @@ namespace formula_manage
{ {
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR; Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
} }
SqlConnection conn_SC = new SqlConnection(Connstr_SC);
conn_SC.Open();
// conn_SC.OpenAsync();
conn_SC.Close();
SqlConnection conn_SC = new SqlConnection(Connstr_SC);
try
{
await conn_SC.OpenAsync();
}
catch (Exception)
{
DISPENLINK.Background = Brushes.Red; //连接失败红色
DBCLINK.Background = Brushes.Red;
System.Windows.MessageBox.Show("连接数据库失败");
//Windows.Sql sql = new Windows.Sql();
//sql.ShowDialog();//实例化并置顶打开数据库设置窗口
UserClass.LogGing.LogGingDATA("DISPENLINK = ConnectFailed");
return;
}
conn_SC.Close(); //关闭连接
DISPENLINK.Background = Brushes.Green; //连接成功绿色
if (SQL2) //数据库对象2生效则检查
{
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL7"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL8");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL9");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL10");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL11");
if (TEXT_SQMOD == "0") //判断连接方式
{
Connstr_DBC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_DBC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
}
SqlConnection conn_DBC = new SqlConnection(Connstr_DBC);
try
{
await conn_DBC.OpenAsync();
}
catch (Exception)
{
DBCLINK.Background = Brushes.Red; //连接失败红色
System.Windows.MessageBox.Show("连接数据库失败");
//Windows.Sql sql = new Windows.Sql();
//sql.ShowDialog();//实例化并置顶打开数据库设置窗口
UserClass.LogGing.LogGingDATA("DBCLINK = ConnectFailed");
return;
}
DBCLINK.Background = Brushes.Green; //连接成功绿色
}
logon.IsEnabled = true; //允许登录按钮 logon.IsEnabled = true; //允许登录按钮
UserClass.PressKey.PressKeys(Keys.Tab, false); UserClass.PressKey.PressKeys(Keys.Tab, false);
UserClass.PressKey.PressKeys(Keys.Tab, true); UserClass.PressKey.PressKeys(Keys.Tab, true);
if (DISPENLINK.Background == Brushes.Green)
{
string user_sql = "SELECT UserCode ,PassWord ,UserSetup ,Capacity ,GROUP_CODE ,Note FROM [Dispensing].[dbo].[UserAccount] WHERE Capacity != 0";//查询语句
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter user_data = new SqlDataAdapter(user_sql, Connstr_SC); //查询
user_data.Fill(logindataTable); //查询结果存入缓存
conn_SC.Close(); //关闭连接
User.ItemsSource = logindataTable.DefaultView; //数据加入表格
} }
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败,检查连接");
UserClass.LogGing.LogGingDATA("USER = NoData");
return;
}
}
}
} }
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

+190 -43
View File
@@ -4,41 +4,130 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage" xmlns:local="clr-namespace:formula_manage"
mc:Ignorable="d" xmlns:ViewModel="clr-namespace:formula_manage.ViewModel"
Title="SUNLIGHT" Height="720" Width="1280" BorderBrush="White" Background="#FFE0E0E0"> mc:Ignorable="d" Loaded="Window_MIN"
Title="SUNLIGHT" Height="720" Width="1280" MinHeight="720" MinWidth="1280"
DataContext="{Binding Source={StaticResource Locator}, Path=Main}"
BorderBrush="White" Background="#FFE0E0E0">
<Window.Resources>
<ViewModel:MainWindowViewModel x:Key="MainWindowViewModel"/>
</Window.Resources>
<Grid> <Grid>
<Menu IsTabStop="False"> <Menu IsTabStop="False" Grid.ColumnSpan="1">
<MenuItem Header="_设置" FontSize="16"> <MenuItem x:Name="tab" Header="_文件" FontSize="16" Focusable ="False" >
<MenuItem Header="_数据库设置" FontSize="16" Click="SQL"/> <MenuItem Header="_许可证" Click="CDKEY_SET" FontSize="16"/>
<MenuItem Header="_备份/还原" FontSize="16"/>
<Separator/> <Separator/>
<MenuItem Header="_料单设置" FontSize="16"/> <MenuItem Header="_注销" FontSize="16" Click="logout"/>
<MenuItem Header="_用户设置" FontSize="16"/> </MenuItem>
<MenuItem Header="_设置" FontSize="16" Focusable ="False" >
<MenuItem Header="_数据库设置" FontSize="16" Name="_SQL" Click="SQL" IsEnabled="False"/>
<MenuItem Header="_备份/还原" FontSize="16" Name="_SQLBAK" Click="SQLBAK" IsEnabled="False"/>
<Separator/> <Separator/>
<MenuItem Header="_软件设置" FontSize="16" Name="_SOFTWARE_SET" Click="SOFTWARE_SET" IsEnabled="False"/>
<MenuItem Header="_打印设置" FontSize="16" Name="_PRINT_SET" Click="PRINT_SET" IsEnabled="False"/>
<MenuItem Header="_登录限制" FontSize="16" Name="_USER_log" IsEnabled="False"/>
</MenuItem>
<MenuItem Header="_管理" FontSize="16" Focusable ="False">
<MenuItem Header="_染色机管理" FontSize="16" Name="_MAC_SET" Click="MAC_SET" IsEnabled="False"/>
<MenuItem Header="_原料信息管理" FontSize="16" Name="_STUFF" Click="STUFF" IsEnabled="False"/>
<Separator/>
<MenuItem Header="_预设配方管理" FontSize="16" Name="_RECIPE" Click="RECIPE" IsEnabled="False"/>
<MenuItem Header="_预设工艺管理" FontSize="16" Name="_PROCESS" Click="PROCESS" IsEnabled="False"/>
<Separator/>
<MenuItem Header="_配送流程管理" FontSize="16" Name="_WORKFLOW" Click="WORKFLOW" IsEnabled="False"/>
<MenuItem Header="_流程选择规则" FontSize="16" Name="_WORKFLOWSET" Click="WORKFLOWSET" IsEnabled="False"/>
<Separator />
<MenuItem Header="_布种" FontSize="16" Name="_fabric" Click="fabric" IsEnabled="False"/>
<MenuItem Header="_颜色名" FontSize="16" Name="_color" Click="color" IsEnabled="False"/>
<MenuItem Header="_客户" FontSize="16" Name="_client" Click="client" IsEnabled="False"/>
<Separator />
<MenuItem Header="_用户设置" FontSize="16" Name="_USER_SET" Click="USER_SET" IsEnabled="False"/>
</MenuItem>
<MenuItem Header="_查询" FontSize="16" Focusable ="False">
<MenuItem Header="_领料单据" FontSize="16"/>
<MenuItem Header="_统计" FontSize="16" Name="_statistics" IsEnabled="False"/>
</MenuItem>
<MenuItem Header="_扩展" FontSize="16" Focusable ="False">
<MenuItem Header="_模式" FontSize="16" Name="_WorkingMode" IsEnabled="False"/>
<MenuItem Header="_转换设置" FontSize="16" Name="_EX_SET" Click="EX_SET" IsEnabled="False"/>
<MenuItem Header="_转换历史" FontSize="16" Name="_exchange" Click="EXCHANGE" IsEnabled="False"/>
</MenuItem>
<MenuItem Header="_帮助" FontSize="16" Focusable ="False">
<MenuItem Header="_帮助" FontSize="16" Click="HELP"/> <MenuItem Header="_帮助" FontSize="16" Click="HELP"/>
</MenuItem> </MenuItem>
<MenuItem Header="_管理" FontSize="16">
<MenuItem Header="_染机管理" FontSize="16"/>
<MenuItem Header="_原料管理" FontSize="16" Click="STUFF"/>
<MenuItem Header="_配方管理" FontSize="16"/>
<MenuItem Header="_工艺管理" FontSize="16"/>
<Separator />
<MenuItem Header="其它...">
<MenuItem Header="_品名" FontSize="16"/>
<MenuItem Header="_色号" FontSize="16"/>
<MenuItem Header="_客户" FontSize="16"/>
</MenuItem>
</MenuItem>
<MenuItem Header="_查询" FontSize="16">
<MenuItem Header="_料单查询" FontSize="16"/>
<MenuItem Header="_历史查询" FontSize="16"/>
<MenuItem Header="_统计" FontSize="16"/>
</MenuItem>
</Menu> </Menu>
<DataGrid x:Name="Selectio" AlternationCount="2" IsReadOnly="False"
Margin="5,300,5,100" d:ItemsSource="{d:SampleData ItemCount=200}" AutoGenerateColumns="False" MinColumnWidth="30" <TextBox x:Name="USERTIME" Text="{Binding Sys_Time}" HorizontalAlignment="Right" Height="30" Margin="0,0,5,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="150" FontSize="14"
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/>
<TextBox x:Name="USER" HorizontalAlignment="Right" Height="30" Margin="0,0,155,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="100" FontSize="14"
Background="{x:Null}" BorderBrush="{x:Null}" SelectionBrush="{x:Null}" IsReadOnly="True" IsUndoEnabled="False" MaxLines="1" IsEnabled="False" Grid.Column="1"/>
<Button Content="新工单" HorizontalAlignment="Left" Margin="335,35,0,0" Height="30" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" FontSize="20" Click="Button_NewOrder" Focusable ="False" Grid.Column="1"/>
<Button Content="归属订单" HorizontalAlignment="Left" Margin="300,70,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Order" Grid.Column="1"/>
<Button Content="预设工艺" HorizontalAlignment="Left" Margin="300,105,0,0" Height="30" VerticalAlignment="Top" Width="105" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Technology" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,35,0,0" TextWrapping="Wrap" Text="领料单号:" VerticalAlignment="Top" Width="90" FontSize="20" Background="WhiteSmoke"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,70,0,0" TextWrapping="Wrap" Text="流转订单:" VerticalAlignment="Top" Width="90" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,105,0,0" TextWrapping="Wrap" Text="执行工艺:" VerticalAlignment="Top" Width="90" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,140,0,0" TextWrapping="Wrap" Text="机台:" VerticalAlignment="Top" Width="80" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="5,175,0,0" TextWrapping="Wrap" Text="类型:" VerticalAlignment="Top" Width="90" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="230,140,0,0" TextWrapping="Wrap" Text="总步数:" VerticalAlignment="Top" Width="70" FontSize="20" Grid.ColumnSpan="2"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="230,175,0,0" TextWrapping="Wrap" Text="表单:" VerticalAlignment="Top" Width="70" FontSize="20" Grid.ColumnSpan="2"/>
<ComboBox x:Name="Forms_" HorizontalAlignment="Left" Height="30" Margin="300,175,0,0" VerticalAlignment="Top" Width="105" FontSize="20"/>
<TextBox x:Name="Number" HorizontalAlignment="Left" ToolTip="当前配方的物料单" Height="30" Margin="95,35,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" Grid.ColumnSpan="2"/>
<TextBox x:Name="order" HorizontalAlignment="Left" Height="30" Margin="95,70,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" IsTabStop="False" Grid.ColumnSpan="2"/>
<TextBox x:Name="ReDye" HorizontalAlignment="Left" Height="30" Margin="300,35,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="30" FontSize="20"
MaxLines="1" MaxLength="2" Grid.Column="1" IsReadOnly="True"/>
<TextBox x:Name="Technology" HorizontalAlignment="Left" Height="30" Margin="95,105,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="200" FontSize="20" KeyUp="SearchBox_OnKeyDownd" IsTabStop="False" Grid.ColumnSpan="2"/>
<ComboBox x:Name="Machine" DisplayMemberPath="Name"
ItemsSource="{Binding mac_Machine, Source={StaticResource MainWindowViewModel}}"
HorizontalAlignment="Left" Height="30" Margin="95,140,0,0" VerticalAlignment="Top" Width="120" FontSize="20"
KeyUp="Machine_OnKeyDownd" DropDownClosed="Machine_DropDownClosed" InputMethod.IsInputMethodEnabled="False"/>
<ComboBox x:Name="OrderType" Text="正常单"
HorizontalAlignment="Left" Height="30" Margin="95,175,0,0" VerticalAlignment="Top" Width="120" FontSize="20"
IsTabStop="True" KeyUp="SearchBox_OnKeyDownd" IsEditable="True" IsReadOnly="True">
<ComboBoxItem Content="正常单"></ComboBoxItem>
<ComboBoxItem Content="追加单"></ComboBoxItem>
</ComboBox>
<TextBox x:Name="Procedures_N" HorizontalAlignment="Left" Height="30" Margin="300,140,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="85" FontSize="20"
KeyUp="SearchBox_OnKeyDownd" MaxLines="1" MaxLength="3" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" Grid.Column="1"/>
<Button Content="+" HorizontalAlignment="Left" Height="15" Width="20" Margin="385,140,0,0" VerticalAlignment="Top" FontSize="10"
Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" Click="Button_up" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
<Button Content="-" HorizontalAlignment="Left" Height="15" Width="20" Margin="385,155,0,0" VerticalAlignment="Top" FontSize="10"
Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" Click="Button_dow" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
<Grid Height="150" Width="405" Margin="5,210,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Background="#FFF7F7F7" Grid.ColumnSpan="2">
<Button Content="..." HorizontalAlignment="Left" Margin="370,40,0,0" Height="30" VerticalAlignment="Top" Width="30" Background="#FFF9F9F9" FontSize="20" Focusable ="False" Click="Button_Formula" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="0,5,0,0" TextWrapping="Wrap" Text="步序:" VerticalAlignment="Top" Width="70" FontSize="20"/>
<TextBox x:Name="Procedures_P" HorizontalAlignment="Left" Height="30" Margin="90,5,0,0" TextWrapping="Wrap" Text="1" VerticalAlignment="Top" Width="50" FontSize="20"
KeyUp="SearchBox_OnKeyDownd" MaxLines="1" MaxLength="3" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False"/>
<Button Content="+" HorizontalAlignment="Left" Height="15" Width="20" Margin="140,5,0,0" VerticalAlignment="Top" FontSize="10"
Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" IsTabStop="False" Click="Button_StepUp" Focusable ="False"/>
<Button Content="-" HorizontalAlignment="Left" Height="15" Width="20" Margin="140,20,0,0" VerticalAlignment="Top" FontSize="10"
Background="#FFF1F1F1" BorderBrush="#FFC5C5C5" Padding="0,0,0,0" IsTabStop="False" Click="Button_StepDow" Focusable ="False"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="170,5,0,0" TextWrapping="Wrap" Text="流程:" VerticalAlignment="Top" Width="45" FontSize="20"/>
<ComboBox Name="Workflow" DisplayMemberPath="DissolveName" ItemsSource="{Binding flow_Workflow, Source={StaticResource MainWindowViewModel}}" StaysOpenOnEdit="True"
HorizontalAlignment="Left" Height="30" Margin="225,5,0,0" Text="" VerticalAlignment="Top" Width="175" FontSize="20" IsEditable="True" Grid.ColumnSpan="2"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="0,40,0,0" TextWrapping="Wrap" Text="配方代码:" VerticalAlignment="Top" Width="90" FontSize="20"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="90,40,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="125" FontSize="20" KeyUp="SearchBox_OnKeyDownd"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="225,40,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="140" FontSize="20" Focusable ="False" Grid.ColumnSpan="2"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="0,75,0,0" TextWrapping="Wrap" Text="重量(KG):" VerticalAlignment="Top" Width="90" FontSize="20"/>
<TextBox x:Name="list_Weight" HorizontalAlignment="Left" Height="30" Margin="90,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="125" FontSize="20"
KeyUp="SearchBox_OnKeyDownd" TextChanged="Weight" PreviewTextInput="Tb_KeyFloating" InputMethod.IsInputMethodEnabled="False"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="220,75,0,0" TextWrapping="Wrap" Text="浴比:" VerticalAlignment="Top" Width="90" FontSize="20" Grid.ColumnSpan="2"/>
<TextBox x:Name="list_Proportion" HorizontalAlignment="Left" Height="30" Margin="270,75,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="130" FontSize="20"
KeyUp="SearchBox_OnKeyDownd" TextChanged="Proportion" PreviewTextInput="Tb_KeyFloating" InputMethod.IsInputMethodEnabled="False" Grid.Column="1"/>
<TextBlock HorizontalAlignment="Left" Height="35" Margin="0,110,0,0" TextWrapping="Wrap" Text="浴量(L):" VerticalAlignment="Top" Width="90" FontSize="20"/>
<TextBox x:Name="list_Total" HorizontalAlignment="Left" Height="30" Margin="90,110,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="125" FontSize="20" />
<TextBlock HorizontalAlignment="Left" Height="35" Margin="220,110,0,0" TextWrapping="Wrap" Text="修正:" VerticalAlignment="Top" Width="90" FontSize="20" Grid.ColumnSpan="2"/>
<TextBox HorizontalAlignment="Left" Height="30" Margin="270,110,0,0" Text="" VerticalAlignment="Top" Width="130" FontSize="20" Focusable ="False" Grid.Column="1"/>
</Grid>
<DataGrid x:Name="Grid_RRODUCT" AlternationCount="2" IsReadOnly="False" InitializingNewItem="DataGrid_InitializingNewItem"
Margin="5,365,5,80" d:ItemsSource="{d:SampleData ItemCount=99}" AutoGenerateColumns="False" MinColumnWidth="30"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC" HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False" Background="White" SelectionMode="Single"> BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2"
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False"
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column"
Background="White" SelectionMode="Single" FontSize="15" >
<DataGrid.RowStyle > <DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}"> <Style TargetType="{x:Type DataGridRow}">
<Style.Triggers> <Style.Triggers>
@@ -46,7 +135,7 @@
<Setter Property="Background" Value="#FFFFFFFF" /> <Setter Property="Background" Value="#FFFFFFFF" />
</Trigger> </Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1"> <Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF5F5F5" /> <Setter Property="Background" Value="#FFFFFFFF" />
</Trigger> </Trigger>
<Trigger Property="IsMouseOver" Value="False"> <Trigger Property="IsMouseOver" Value="False">
</Trigger> </Trigger>
@@ -59,28 +148,86 @@
<Setter Property="MinWidth" Value="20"/> <Setter Property="MinWidth" Value="20"/>
<Style.Triggers> <Style.Triggers>
<Trigger Property="IsSelected" Value="True"> <Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/> <Setter Property="Background" Value="#FFFFFFFF"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/> <Setter Property="BorderBrush" Value="#FFFFFFFF"/>
<Setter Property="Foreground" Value="#000000"/> <Setter Property="Foreground" Value="#000000"/>
</Trigger> </Trigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</DataGrid.CellStyle> </DataGrid.CellStyle>
<DataGrid.Resources>
<Style x:Key="CellStyle" TargetType="{x:Type DataGridCell}">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Background" Value="#FFFFFFFF"/>
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
<Setter Property="Foreground" Value="#000000"/>
<Setter Property="DataContext" Value="{Binding Source={StaticResource Locator}, Path=Main}"/>
</Style>
</DataGrid.Resources>
<DataGrid.Columns> <DataGrid.Columns>
<!--列信息绑定--> <!--列信息绑定-->
<DataGridTextColumn Header="步序" Width="50" FontSize="15" MaxWidth="50" MinWidth="50" CanUserReorder="False" />
<DataGridTextColumn Header="原料" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/> <DataGridTextColumn Header="序" Width="30" FontSize="15" MaxWidth="30" MinWidth="30" Binding="{Binding ID}" IsReadOnly="True" CellStyle="{StaticResource CellStyle}"/>
<DataGridTextColumn Header="目标饱和度(%)" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/> <DataGridTextColumn Header="步骤" Width="50" FontSize="15" MaxWidth="50" MinWidth="50" Binding="{Binding STEP}" IsReadOnly="True" CellStyle="{StaticResource CellStyle}"/>
<DataGridTextColumn Header="计算单位" Width="80" FontSize="15" MaxWidth="80" MinWidth="80" CanUserReorder="False"/> <DataGridTemplateColumn Header="原料代码" Width="200" MaxWidth="400" MinWidth="100" IsReadOnly="False">
<DataGridTextColumn Header="目标重量(g)" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/> <DataGridTemplateColumn.CellTemplate>
<DataGridTextColumn Header="单位" Width="80" FontSize="15" MaxWidth="80" MinWidth="80" CanUserReorder="False"/> <DataTemplate>
<DataGridTextColumn Header="实际重量(g)" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/> <ComboBox x:Name="CP_PRODUCT_CODE" BorderThickness="0,0,0,0"
<DataGridTextColumn Header="备注" Width="400" FontSize="15" MinWidth="100" CanUserReorder="False"/> ItemsSource="{Binding stuff_Product, Source={StaticResource MainWindowViewModel}}"
DisplayMemberPath="ProductCode"
Text="{Binding PRODUCT_CODE}" IsTextSearchEnabled="True" StaysOpenOnEdit="True"
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True"
KeyDown="CP_PRODUCT_CODE_KeyUp"
DropDownClosed="CP_PRODUCT_CODE_DropDownClosed">
</ComboBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="目标饱和度(%)" Width="200" MaxWidth="400" MinWidth="100" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox x:Name="CP_CONC" BorderThickness="0,0,0,0" Text="{Binding CONC}"
BorderBrush="{x:Null}" Background="{x:Null}"
KeyDown="CP_CONC_KeyUp"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="计算单位" Width="80" MaxWidth="80" MinWidth="80" CellStyle="{StaticResource CellStyle}" Binding="{Binding SHIFT}"/>
<DataGridTemplateColumn Header="原料名称" Width="200" MaxWidth="400" MinWidth="100" CellStyle="{StaticResource CellStyle}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox x:Name="CP_PRODUCT_NAME" BorderThickness="0,0,0,0"
ItemsSource="{Binding stuff_Product, Source={StaticResource MainWindowViewModel}}"
DisplayMemberPath="ProductName"
Text="{Binding PRODUCT_NAME}"
DropDownClosed="CP_PRODUCT_NAME_DropDownClosed"
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True" IsReadOnly="True" Focusable="True" IsTabStop="False"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="目标重量(g)" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" IsReadOnly="True" Binding="{Binding TARGET_WT}" CellStyle="{StaticResource CellStyle}"/>
<DataGridTextColumn Header="单位" Width="80" FontSize="15" MaxWidth="80" MinWidth="80" IsReadOnly="True" Binding="{Binding UNIT}" CellStyle="{StaticResource CellStyle}"/>
<DataGridTextColumn Header="备注" FontSize="15" MinWidth="1000" Binding="{Binding REMARK}" CellStyle="{StaticResource CellStyle}" IsReadOnly="False"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<Button Content="确认" HorizontalAlignment="Right" Height="40" Width="80" Margin="0,0,140,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="confirm"/>
<Button Content="打印" HorizontalAlignment="Right" Height="40" Width="80" Margin="0,0,55,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="print" IsTabStop="False"/> <Button x:Name="Confirm" Content="确认" IsEnabled="False" HorizontalAlignment="Right" Height="40" Width="80" Margin="0,0,140,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="confirm" Grid.Column="1"/>
<Button Content="保存" HorizontalAlignment="Left" Height="40" Width="80" Margin="15,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="save" IsTabStop="False"/> <Button x:Name="Print" Content="打印" HorizontalAlignment="Right" Height="40" Width="80" Margin="0,0,55,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="print" IsTabStop="False" Focusable ="False" Grid.Column="1"/>
<Button Content="删除" HorizontalAlignment="Left" Height="40" Width="80" Margin="100,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="delete" IsTabStop="False"/> <Button x:Name="Save" Content="保存" IsEnabled="False" HorizontalAlignment="Left" Height="40" Width="80" Margin="15,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="save" IsTabStop="False" Focusable ="False"/>
<Button x:Name="Delete" Content="删除" IsEnabled="False" HorizontalAlignment="Left" Height="40" Width="80" Margin="100,0,0,20" VerticalAlignment="Bottom" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" Click="delete" IsTabStop="False" Focusable ="False"/>
<Grid Grid.Column="1" Height="325" Margin="415,35,5,0" VerticalAlignment="Top" Background="White">
<ContentControl x:Name="Deputy"/>
</Grid>
<Grid Grid.Column="1" Margin="0,0,0,0" Background="White" Visibility="{Binding Cdk_page}" Opacity="0.8">
<TextBlock Height="150" Margin="0,0,0,300" TextWrapping="Wrap" Text="注册信息到期,处理注册信息预计需要3个工作日,为避免影响系统使用请及时提交注册信息!" Width="500" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Height="50" Margin="0,0,0,100" TextWrapping="Wrap" Text="{Binding Cdk_time}" Width="500" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Red"/>
<TextBlock Height="50" Margin="0,0,0,0" TextWrapping="Wrap" Text="请联系 SUNLIGHT" Width="300" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Button Content="激活" HorizontalAlignment="Center" Height="50" Margin="200,100,0,-100" VerticalAlignment="Center" Width="150" FontSize="24" BorderBrush="{x:Null}" Background="#FFDFDFDF" Click="CDKEY_SET"/>
<Button Content="帮助" HorizontalAlignment="Center" Height="50" Margin="0,100,200,-100" VerticalAlignment="Center" Width="150" FontSize="24" BorderBrush="{x:Null}" Background="#FFDFDFDF" Click="HELP"/>
<TextBlock Height="50" Margin="0,0,0,0" TextWrapping="Wrap" Text="{Binding Cdk_pageT}" Width="500" FontSize="34" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
</Grid>
</Grid> </Grid>
</Window> </Window>
+994 -19
View File
File diff suppressed because it is too large. Load diff
+2 -4
View File
@@ -1,6 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
@@ -10,9 +8,9 @@ using System.Windows;
[assembly: AssemblyTitle("formula_manage")] [assembly: AssemblyTitle("formula_manage")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("SUNLIGHT")]
[assembly: AssemblyProduct("formula_manage")] [assembly: AssemblyProduct("formula_manage")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("SUNLIGHT © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
+16 -24
View File
@@ -1,49 +1,44 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
// 运行时版本: 4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// 对此文件的更改可能导致不正确的行为,如果 // 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,则所做更改将丢失。 // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace formula_manage.Properties namespace formula_manage.Properties {
{ using System;
/// <summary> /// <summary>
/// 强类型资源类,用于查找本地化字符串等。 /// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary> /// </summary>
// 此类是由 StronglyTypedResourceBuilder // 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources internal class Resources {
{
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() internal Resources() {
{
} }
/// <summary> /// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。 /// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager internal static global::System.Resources.ResourceManager ResourceManager {
{ get {
get if (object.ReferenceEquals(resourceMan, null)) {
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("formula_manage.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("formula_manage.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
@@ -56,14 +51,11 @@ namespace formula_manage.Properties
/// 使用此强类型资源类的所有资源查找执行重写。 /// 使用此强类型资源类的所有资源查找执行重写。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture internal static global::System.Globalization.CultureInfo Culture {
{ get {
get
{
return resourceCulture; return resourceCulture;
} }
set set {
{
resourceCulture = value; resourceCulture = value;
} }
} }
+9 -13
View File
@@ -1,28 +1,24 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 此代码由工具生成。
// Runtime Version:4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // 对此文件的更改可能会导致不正确的行为,并且如果
// the code is regenerated. // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace formula_manage.Properties namespace formula_manage.Properties {
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default public static Settings Default {
{ get {
get
{
return defaultInstance; return defaultInstance;
} }
} }
+37
View File
@@ -0,0 +1,37 @@
using System;
namespace formula_manage.SQLModels
{
// internal class STUFF_Product
//{
// }
public partial class Product
{
public string ProductCode { get; set; }
public string ProductName { get; set; }
public Nullable<int> ProductType { get; set; }
public Nullable<int> ProductClass { get; set; }
public Nullable<int> Color { get; set; }
public string ProductLot { get; set; }
public Nullable<double> FullWeight { get; set; }
public Nullable<int> ProductUnit { get; set; }
public Nullable<double> SafetyStock { get; set; }
public Nullable<double> Price { get; set; }
public Nullable<double> CurrentStock { get; set; }
public Nullable<double> Deduct { get; set; }
public Nullable<System.DateTime> RplDate { get; set; }
public Nullable<System.DateTime> UsedDate { get; set; }
public string CuMonth { get; set; }
public Nullable<double> LaStock { get; set; }
public Nullable<double> ThStock { get; set; }
public Nullable<double> ThUsed { get; set; }
public Nullable<int> LampPosition { get; set; }
public string TablePosition { get; set; }
public string Area { get; set; }
public Nullable<double> Concentration { get; set; }
public string Batch_NO { get; set; }
public string SUPPLIER { get; set; }
public double GRAVITY { get; set; }
}
}
+190
View File
@@ -0,0 +1,190 @@
using System;
using System.Text;
namespace formula_manage.UserClass
{
/// <summary>
/// CRC校验
/// </summary>
public class CRCcheck16
{
#region CRC16
public static byte[] CRC16(byte[] data)
{
int len = data.Length;
if (len > 0)
{
ushort crc = 0xFFFF;
for (int i = 0; i < len; i++)
{
crc = (ushort)(crc ^ (data[i]));
for (int j = 0; j < 8; j++)
{
crc = (crc & 1) != 0 ? (ushort)((crc >> 1) ^ 0xA001) : (ushort)(crc >> 1);
}
}
byte hi = (byte)((crc & 0xFF00) >> 8); //高位置
byte lo = (byte)(crc & 0x00FF); //低位置
return new byte[] { hi, lo };
}
return new byte[] { 0, 0 };
}
#endregion
#region ToCRC16
public static string ToCRC16(string content)
{
return ToCRC16(content, Encoding.UTF8);
}
public static string ToCRC16(string content, bool isReverse)
{
return ToCRC16(content, Encoding.UTF8, isReverse);
}
public static string ToCRC16(string content, Encoding encoding)
{
return ByteToString(CRC16(encoding.GetBytes(content)), true);
}
public static string ToCRC16(string content, Encoding encoding, bool isReverse)
{
return ByteToString(CRC16(encoding.GetBytes(content)), isReverse);
}
public static string ToCRC16(byte[] data)
{
return ByteToString(CRC16(data), true);
}
public static string ToCRC16(byte[] data, bool isReverse)
{
return ByteToString(CRC16(data), isReverse);
}
#endregion
#region ToModbusCRC16
public static string ToModbusCRC16(string s)
{
return ToModbusCRC16(s, true);
}
public static string ToModbusCRC16(string s, bool isReverse)
{
return ByteToString(CRC16(StringToHexByte(s)), isReverse);
}
public static string ToModbusCRC16(byte[] data)
{
return ToModbusCRC16(data, true);
}
public static string ToModbusCRC16(byte[] data, bool isReverse)
{
return ByteToString(CRC16(data), isReverse);
}
#endregion
#region ByteToString
public static string ByteToString(byte[] arr, bool isReverse)
{
try
{
byte hi = arr[0], lo = arr[1];
return Convert.ToString(isReverse ? hi + lo * 0x100 : hi * 0x100 + lo, 16).ToUpper().PadLeft(4, '0');
}
catch (Exception ex) { throw (ex); }
}
public static string ByteToString(byte[] arr)
{
try
{
return ByteToString(arr, true);
}
catch (Exception ex) { throw (ex); }
}
#endregion
#region StringToHexString
public static string StringToHexString(string str)
{
StringBuilder s = new StringBuilder();
foreach (short c in str.ToCharArray())
{
s.Append(c.ToString("X4"));
}
return s.ToString();
}
#endregion
#region StringToHexByte
private static string ConvertChinese(string str)
{
StringBuilder s = new StringBuilder();
foreach (short c in str.ToCharArray())
{
if (c <= 0 || c >= 127)
{
s.Append(c.ToString("X4"));
}
else
{
s.Append((char)c);
}
}
return s.ToString();
}
private static string FilterChinese(string str)
{
StringBuilder s = new StringBuilder();
foreach (short c in str.ToCharArray())
{
if (c > 0 && c < 127)
{
s.Append((char)c);
}
}
return s.ToString();
}
/// <summary>
/// 字符串转16进制字符数组
/// </summary>
/// <param name="hex"></param>
/// <returns></returns>
public static byte[] StringToHexByte(string str)
{
return StringToHexByte(str, false);
}
/// <summary>
/// 字符串转16进制字符数组
/// </summary>
/// <param name="str"></param>
/// <param name="isFilterChinese">是否过滤掉中文字符</param>
/// <returns></returns>
public static byte[] StringToHexByte(string str, bool isFilterChinese)
{
string hex = isFilterChinese ? FilterChinese(str) : ConvertChinese(str);
//清除所有空格
hex = hex.Replace(" ", "");
//若字符个数为奇数,补一个0
hex += hex.Length % 2 != 0 ? "0" : "";
byte[] result = new byte[hex.Length / 2];
for (int i = 0, c = result.Length; i < c; i++)
{
result[i] = Convert.ToByte(hex.Substring(i * 2, 2), 16);
}
return result;
}
#endregion
}
}
+334
View File
@@ -0,0 +1,334 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
namespace formula_manage.UserClass
{
public class Code128
{
private DataTable m_Code128 = new DataTable();
private uint m_Height = 40;
/// <summary>
/// 高度
/// </summary>
public uint Height { get { return m_Height; } set { m_Height = value; } }
private Font m_ValueFont = null;
/// <summary>
/// 是否显示可见号码 如果为NULL不显示号码
/// </summary>
public Font ValueFont { get { return m_ValueFont; } set { m_ValueFont = value; } }
private byte m_Magnify = 0;
/// <summary>
/// 放大倍数
/// </summary>
public byte Magnify { get { return m_Magnify; } set { m_Magnify = value; } }
/// <summary>
/// 条码类别
/// </summary>
public enum Encode
{
Code128A,
Code128B,
Code128C,
EAN128
}
public Code128()
{
m_Code128.Columns.Add("ID");
m_Code128.Columns.Add("Code128A");
m_Code128.Columns.Add("Code128B");
m_Code128.Columns.Add("Code128C");
m_Code128.Columns.Add("BandCode");
m_Code128.CaseSensitive = true;
#region 数据表
m_Code128.Rows.Add("0", " ", " ", "00", "212222");
m_Code128.Rows.Add("1", "!", "!", "01", "222122");
m_Code128.Rows.Add("2", "\"", "\"", "02", "222221");
m_Code128.Rows.Add("3", "#", "#", "03", "121223");
m_Code128.Rows.Add("4", "$", "$", "04", "121322");
m_Code128.Rows.Add("5", "%", "%", "05", "131222");
m_Code128.Rows.Add("6", "&", "&", "06", "122213");
m_Code128.Rows.Add("7", "'", "'", "07", "122312");
m_Code128.Rows.Add("8", "(", "(", "08", "132212");
m_Code128.Rows.Add("9", ")", ")", "09", "221213");
m_Code128.Rows.Add("10", "*", "*", "10", "221312");
m_Code128.Rows.Add("11", "+", "+", "11", "231212");
m_Code128.Rows.Add("12", ",", ",", "12", "112232");
m_Code128.Rows.Add("13", "-", "-", "13", "122132");
m_Code128.Rows.Add("14", ".", ".", "14", "122231");
m_Code128.Rows.Add("15", "/", "/", "15", "113222");
m_Code128.Rows.Add("16", "0", "0", "16", "123122");
m_Code128.Rows.Add("17", "1", "1", "17", "123221");
m_Code128.Rows.Add("18", "2", "2", "18", "223211");
m_Code128.Rows.Add("19", "3", "3", "19", "221132");
m_Code128.Rows.Add("20", "4", "4", "20", "221231");
m_Code128.Rows.Add("21", "5", "5", "21", "213212");
m_Code128.Rows.Add("22", "6", "6", "22", "223112");
m_Code128.Rows.Add("23", "7", "7", "23", "312131");
m_Code128.Rows.Add("24", "8", "8", "24", "311222");
m_Code128.Rows.Add("25", "9", "9", "25", "321122");
m_Code128.Rows.Add("26", ":", ":", "26", "321221");
m_Code128.Rows.Add("27", ";", ";", "27", "312212");
m_Code128.Rows.Add("28", "<", "<", "28", "322112");
m_Code128.Rows.Add("29", "=", "=", "29", "322211");
m_Code128.Rows.Add("30", ">", ">", "30", "212123");
m_Code128.Rows.Add("31", "?", "?", "31", "212321");
m_Code128.Rows.Add("32", "@", "@", "32", "232121");
m_Code128.Rows.Add("33", "A", "A", "33", "111323");
m_Code128.Rows.Add("34", "B", "B", "34", "131123");
m_Code128.Rows.Add("35", "C", "C", "35", "131321");
m_Code128.Rows.Add("36", "D", "D", "36", "112313");
m_Code128.Rows.Add("37", "E", "E", "37", "132113");
m_Code128.Rows.Add("38", "F", "F", "38", "132311");
m_Code128.Rows.Add("39", "G", "G", "39", "211313");
m_Code128.Rows.Add("40", "H", "H", "40", "231113");
m_Code128.Rows.Add("41", "I", "I", "41", "231311");
m_Code128.Rows.Add("42", "J", "J", "42", "112133");
m_Code128.Rows.Add("43", "K", "K", "43", "112331");
m_Code128.Rows.Add("44", "L", "L", "44", "132131");
m_Code128.Rows.Add("45", "M", "M", "45", "113123");
m_Code128.Rows.Add("46", "N", "N", "46", "113321");
m_Code128.Rows.Add("47", "O", "O", "47", "133121");
m_Code128.Rows.Add("48", "P", "P", "48", "313121");
m_Code128.Rows.Add("49", "Q", "Q", "49", "211331");
m_Code128.Rows.Add("50", "R", "R", "50", "231131");
m_Code128.Rows.Add("51", "S", "S", "51", "213113");
m_Code128.Rows.Add("52", "T", "T", "52", "213311");
m_Code128.Rows.Add("53", "U", "U", "53", "213131");
m_Code128.Rows.Add("54", "V", "V", "54", "311123");
m_Code128.Rows.Add("55", "W", "W", "55", "311321");
m_Code128.Rows.Add("56", "X", "X", "56", "331121");
m_Code128.Rows.Add("57", "Y", "Y", "57", "312113");
m_Code128.Rows.Add("58", "Z", "Z", "58", "312311");
m_Code128.Rows.Add("59", "[", "[", "59", "332111");
m_Code128.Rows.Add("60", "\\", "\\", "60", "314111");
m_Code128.Rows.Add("61", "]", "]", "61", "221411");
m_Code128.Rows.Add("62", "^", "^", "62", "431111");
m_Code128.Rows.Add("63", "_", "_", "63", "111224");
m_Code128.Rows.Add("64", "NUL", "`", "64", "111422");
m_Code128.Rows.Add("65", "SOH", "a", "65", "121124");
m_Code128.Rows.Add("66", "STX", "b", "66", "121421");
m_Code128.Rows.Add("67", "ETX", "c", "67", "141122");
m_Code128.Rows.Add("68", "EOT", "d", "68", "141221");
m_Code128.Rows.Add("69", "ENQ", "e", "69", "112214");
m_Code128.Rows.Add("70", "ACK", "f", "70", "112412");
m_Code128.Rows.Add("71", "BEL", "g", "71", "122114");
m_Code128.Rows.Add("72", "BS", "h", "72", "122411");
m_Code128.Rows.Add("73", "HT", "i", "73", "142112");
m_Code128.Rows.Add("74", "LF", "j", "74", "142211");
m_Code128.Rows.Add("75", "VT", "k", "75", "241211");
m_Code128.Rows.Add("76", "FF", "I", "76", "221114");
m_Code128.Rows.Add("77", "CR", "m", "77", "413111");
m_Code128.Rows.Add("78", "SO", "n", "78", "241112");
m_Code128.Rows.Add("79", "SI", "o", "79", "134111");
m_Code128.Rows.Add("80", "DLE", "p", "80", "111242");
m_Code128.Rows.Add("81", "DC1", "q", "81", "121142");
m_Code128.Rows.Add("82", "DC2", "r", "82", "121241");
m_Code128.Rows.Add("83", "DC3", "s", "83", "114212");
m_Code128.Rows.Add("84", "DC4", "t", "84", "124112");
m_Code128.Rows.Add("85", "NAK", "u", "85", "124211");
m_Code128.Rows.Add("86", "SYN", "v", "86", "411212");
m_Code128.Rows.Add("87", "ETB", "w", "87", "421112");
m_Code128.Rows.Add("88", "CAN", "x", "88", "421211");
m_Code128.Rows.Add("89", "EM", "y", "89", "212141");
m_Code128.Rows.Add("90", "SUB", "z", "90", "214121");
m_Code128.Rows.Add("91", "ESC", "{", "91", "412121");
m_Code128.Rows.Add("92", "FS", "|", "92", "111143");
m_Code128.Rows.Add("93", "GS", "}", "93", "111341");
m_Code128.Rows.Add("94", "RS", "~", "94", "131141");
m_Code128.Rows.Add("95", "US", "DEL", "95", "114113");
m_Code128.Rows.Add("96", "FNC3", "FNC3", "96", "114311");
m_Code128.Rows.Add("97", "FNC2", "FNC2", "97", "411113");
m_Code128.Rows.Add("98", "SHIFT", "SHIFT", "98", "411311");
m_Code128.Rows.Add("99", "CODEC", "CODEC", "99", "113141");
m_Code128.Rows.Add("100", "CODEB", "FNC4", "CODEB", "114131");
m_Code128.Rows.Add("101", "FNC4", "CODEA", "CODEA", "311141");
m_Code128.Rows.Add("102", "FNC1", "FNC1", "FNC1", "411131");
m_Code128.Rows.Add("103", "StartA", "StartA", "StartA", "211412");
m_Code128.Rows.Add("104", "StartB", "StartB", "StartB", "211214");
m_Code128.Rows.Add("105", "StartC", "StartC", "StartC", "211232");
m_Code128.Rows.Add("106", "Stop", "Stop", "Stop", "2331112");
#endregion
}
/// <summary>
/// 获取128图形
/// </summary>
/// <param name="p_Text">文字</param>
/// <param name="flag">是否显示文字</param>
/// <param name="p_Code">编码</param>
/// <returns>图形</returns>
public Bitmap GetCodeImage(string p_Text, bool flag, Encode p_Code)
{
string _ViewText = p_Text;
string _Text = "";
IList<int> _TextNumb = new List<int>();
int _Examine = 0; //首位
switch (p_Code)
{
case Encode.Code128C:
_Examine = 105;
if (!((p_Text.Length & 1) == 0)) throw new Exception("128C长度必须是偶数");
while (p_Text.Length != 0)
{
int _Temp = 0;
try
{
int _CodeNumb128 = Int32.Parse(p_Text.Substring(0, 2));
}
catch
{
throw new Exception("128C必须是数字!");
}
_Text += GetValue(p_Code, p_Text.Substring(0, 2), ref _Temp);
_TextNumb.Add(_Temp);
p_Text = p_Text.Remove(0, 2);
}
break;
case Encode.EAN128:
_Examine = 105;
if (!((p_Text.Length & 1) == 0)) throw new Exception("EAN128长度必须是偶数");
_TextNumb.Add(102);
_Text += "411131";
while (p_Text.Length != 0)
{
int _Temp = 0;
try
{
int _CodeNumb128 = Int32.Parse(p_Text.Substring(0, 2));
}
catch
{
throw new Exception("128C必须是数字!");
}
_Text += GetValue(Encode.Code128C, p_Text.Substring(0, 2), ref _Temp);
_TextNumb.Add(_Temp);
p_Text = p_Text.Remove(0, 2);
}
break;
default:
if (p_Code == Encode.Code128A)
{
_Examine = 103;
}
else
{
_Examine = 104;
}
while (p_Text.Length != 0)
{
int _Temp = 0;
string _ValueCode = GetValue(p_Code, p_Text.Substring(0, 1), ref _Temp);
if (_ValueCode.Length == 0) throw new Exception("无效的字符集!" + p_Text.Substring(0, 1).ToString());
_Text += _ValueCode;
_TextNumb.Add(_Temp);
p_Text = p_Text.Remove(0, 1);
}
break;
}
if (_TextNumb.Count == 0) throw new Exception("错误的编码,无数据");
_Text = _Text.Insert(0, GetValue(_Examine)); //获取开始位
for (int i = 0; i != _TextNumb.Count; i++)
{
_Examine += _TextNumb[i] * (i + 1);
}
_Examine = _Examine % 103; //获得严效位
_Text += GetValue(_Examine); //获取严效位
_Text += "2331112"; //结束位
Bitmap _CodeImage = GetImage(_Text);
if (flag)
{
GetViewText(_CodeImage, _ViewText);
}
return _CodeImage;
}
/// <summary>
/// 获取目标对应的数据
/// </summary>
/// <param name="p_Code">编码</param>
/// <param name="p_Value">数值 A b 30</param>
/// <param name="p_SetID">返回编号</param>
/// <returns>编码</returns>
private string GetValue(Encode p_Code, string p_Value, ref int p_SetID)
{
if (m_Code128 == null) return "";
DataRow[] _Row = m_Code128.Select(p_Code.ToString() + "='" + p_Value + "'");
if (_Row.Length != 1) throw new Exception("错误的编码" + p_Value.ToString());
p_SetID = Int32.Parse(_Row[0]["ID"].ToString());
return _Row[0]["BandCode"].ToString();
}
/// <summary>
/// 根据编号获得条纹
/// </summary>
/// <param name="p_CodeId"></param>
/// <returns></returns>
private string GetValue(int p_CodeId)
{
DataRow[] _Row = m_Code128.Select("ID='" + p_CodeId.ToString() + "'");
if (_Row.Length != 1) throw new Exception("验效位的编码错误" + p_CodeId.ToString());
return _Row[0]["BandCode"].ToString();
}
/// <summary>
/// 获得条码图形
/// </summary>
/// <param name="p_Text">文字</param>
/// <returns>图形</returns>
private Bitmap GetImage(string p_Text)
{
char[] _Value = p_Text.ToCharArray();
int _Width = 0;
for (int i = 0; i != _Value.Length; i++)
{
_Width += Int32.Parse(_Value[i].ToString()) * (m_Magnify + 1);
}
Bitmap _CodeImage = new Bitmap(_Width, (int)m_Height);
Graphics _Garphics = Graphics.FromImage(_CodeImage);
//Pen _Pen;
int _LenEx = 0;
for (int i = 0; i != _Value.Length; i++)
{
int _ValueNumb = Int32.Parse(_Value[i].ToString()) * (m_Magnify + 1); //获取宽和放大系数
if (!((i & 1) == 0))
{
//_Pen = new Pen(Brushes.White, _ValueNumb);
_Garphics.FillRectangle(Brushes.White, new Rectangle(_LenEx, 0, _ValueNumb, (int)m_Height));
}
else
{
//_Pen = new Pen(Brushes.Black, _ValueNumb);
_Garphics.FillRectangle(Brushes.Black, new Rectangle(_LenEx, 0, _ValueNumb, (int)m_Height));
}
//_Garphics.(_Pen, new Point(_LenEx, 0), new Point(_LenEx, m_Height));
_LenEx += _ValueNumb;
}
_Garphics.Dispose();
return _CodeImage;
}
/// <summary>
/// 显示可见条码文字 如果小于40 不显示文字
/// </summary>
/// <param name="p_Bitmap">图形</param>
private void GetViewText(Bitmap p_Bitmap, string p_ViewText)
{
if (m_ValueFont == null) return;
Graphics _Graphics = Graphics.FromImage(p_Bitmap);
SizeF _DrawSize = _Graphics.MeasureString(p_ViewText, m_ValueFont);
if (_DrawSize.Height > p_Bitmap.Height - 10 || _DrawSize.Width > p_Bitmap.Width)
{
_Graphics.Dispose();
return;
}
int _StarY = p_Bitmap.Height - (int)_DrawSize.Height;
_Graphics.FillRectangle(Brushes.White, new Rectangle(0, _StarY, p_Bitmap.Width, (int)_DrawSize.Height));
_Graphics.DrawString(p_ViewText, m_ValueFont, Brushes.Black, 0, _StarY);
}
//12345678
//(105 + (1 * 12 + 2 * 34 + 3 * 56 + 4 *78)) % 103 = 47
//结果为starc +12 +34 +56 +78 +47 +end
internal Image GetCodeImage(string p)
{
throw new NotImplementedException();
}
}
}
+52
View File
@@ -0,0 +1,52 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace formula_manage.UserClass
{
/// <summary>
/// 实时更新datagrid
/// 调用示例:DataGridHelper.SetRealTimeCommit(Grid, true); Grid为对象控件名
/// </summary>
public static class DataGridHelper
{
public static void SetRealTimeCommit(DataGrid dataGrid, bool isRealTime)
{
dataGrid.SetValue(RealTimeCommitProperty, isRealTime);
}
public static bool GetRealTimeCommit(DataGrid dataGrid)
{
return (bool)dataGrid.GetValue(RealTimeCommitProperty);
}
public static readonly DependencyProperty RealTimeCommitProperty =
DependencyProperty.RegisterAttached("RealTimeCommit", typeof(bool),
typeof(DataGridHelper),
new PropertyMetadata(false, RealTimeCommitCallBack));
private static void RealTimeCommitCallBack(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var dg = d as DataGrid;
if (dg == null)
return;
EventHandler<DataGridCellEditEndingEventArgs> ceHandler = delegate (object xx, DataGridCellEditEndingEventArgs yy)
{
var flag = GetRealTimeCommit(dg);
if (!flag)
return;
var cellContent = yy.Column.GetCellContent(yy.Row);
if (cellContent != null && cellContent.BindingGroup != null)
cellContent.BindingGroup.CommitEdit();
};
dg.CellEditEnding += ceHandler;
RoutedEventHandler eh = null;
eh = (xx, yy) =>
{
dg.Unloaded -= eh;
dg.CellEditEnding -= ceHandler;
};
dg.Unloaded += eh;
}
}
}
@@ -0,0 +1,59 @@
using System;
using System.Collections.ObjectModel;
using System.Data;
using System.Reflection;
namespace formula_manage.UserClass
{
internal class DataTableToObservableCollection //数据表到可观察集合
{
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new()
{
Type t = typeof(T);
PropertyInfo[] propertys = t.GetProperties();
ObservableCollection<T> lst = new ObservableCollection<T>();
string typeName = string.Empty;
foreach (DataRow dr in dt.Rows)
{
T entity = new T();
foreach (PropertyInfo pi in propertys)
{
typeName = pi.Name;
if (dt.Columns.Contains(typeName))
{
if (!pi.CanWrite) continue;
object value = dr[typeName];
if (value == DBNull.Value) continue;
if (pi.PropertyType == typeof(string))
{
pi.SetValue(entity, value.ToString(), null);
}
else if (pi.PropertyType == typeof(int) || pi.PropertyType == typeof(int?))
{
pi.SetValue(entity, int.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(DateTime?) || pi.PropertyType == typeof(DateTime))
{
pi.SetValue(entity, DateTime.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(float))
{
pi.SetValue(entity, float.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(double))
{
pi.SetValue(entity, double.Parse(value.ToString()), null);
}
else
{
pi.SetValue(entity, value, null);
}
}
}
lst.Add(entity);
}
return lst;
}
}
}
+95
View File
@@ -0,0 +1,95 @@
using System.Management;
namespace formula_manage.UserClass
{
/// <summary>
/// 获取硬件SN
/// </summary>
internal class HardwareSN
{
/// <summary>
/// 获取cpuid
/// </summary>
public static string GetCPUSerialNumber()
{
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Processor");
string cpuSerialNumber = "";
foreach (ManagementObject mo in searcher.Get())
{
cpuSerialNumber = mo["ProcessorId"].ToString().Trim();
break;
}
return cpuSerialNumber;
}
catch
{
return "";
}
}
/// <summary>
/// 获取主板id
/// </summary>
public static string GetBIOSSerialNumber()
{
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS");
string biosSerialNumber = "";
foreach (ManagementObject mo in searcher.Get())
{
biosSerialNumber = mo.GetPropertyValue("SerialNumber").ToString().Trim();
break;
}
return biosSerialNumber;
}
catch
{
return "";
}
}
/// <summary>
/// 获取硬盘id
/// </summary>
public static string GetHardDiskSerialNumber()
{
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia");
string hardDiskSerialNumber = "";
foreach (ManagementObject mo in searcher.Get())
{
hardDiskSerialNumber = mo["SerialNumber"].ToString().Trim();
break;
}
return hardDiskSerialNumber;
}
catch
{
return "";
}
}
/// <summary>
/// 获取网卡id
/// </summary>
public static string GetNetCardMACAddress()
{
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter WHERE ((MACAddress Is Not NULL) AND (Manufacturer <> 'Microsoft'))");
string netCardMACAddress = "";
foreach (ManagementObject mo in searcher.Get())
{
netCardMACAddress = mo["MACAddress"].ToString().Trim();
break;
}
return netCardMACAddress;
}
catch
{
return "";
}
}
}
}
+1 -5
View File
@@ -1,9 +1,5 @@
using System; using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading.Tasks;
namespace formula_manage.UserClass namespace formula_manage.UserClass
{ {
+76
View File
@@ -0,0 +1,76 @@
using System.Text;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
namespace formula_manage.UserClass
{
public static class LogDataRead
{
private const int MaxCount = 1000;
private static int Count = 0;
private static RichTextBox textControl;
private static InlineCollection inlines;
//设置主控件
public static void SetTextControl(RichTextBox _textBox)
{
textControl = _textBox;
Paragraph graph = new Paragraph();
inlines = graph.Inlines;
textControl.Document.Blocks.Add(graph);
}
//输出黑色消息
public static void Info(string format, params object[] args)
{
AppendText(Brushes.Black, format, args);
}
//输出绿色消息
public static void Suc(string format, params object[] args)
{
AppendText(Brushes.DarkGreen, format, args);
}
//输出黄色消息
public static void Warning(string format, params object[] args)
{
AppendText(Brushes.DarkOrange, format, args);
}
//输出红色消息
public static void Error(string format, params object[] args)
{
AppendText(Brushes.Red, format, args);
}
//清除日志
public static void Clear()
{
Count = 0;
inlines.Clear();
textControl.ScrollToEnd();
}
private static void AppendText(Brush color, string format, params object[] args)
{
textControl.BeginChange();
StringBuilder builder = new StringBuilder();
builder.Append("[");
builder.Append(Count++);
builder.Append("] : ");
builder.Append(string.Format(format, (object[])args));
builder.Append("\n");
string str = builder.ToString();
inlines.Add(new Run(str) { Foreground = color });
if (inlines.Count > MaxCount)
{
inlines.Remove(inlines.FirstInline);
}
textControl.ScrollToEnd();
textControl.EndChange();
}
}
}
+37
View File
@@ -0,0 +1,37 @@
using System;
using System.IO;
namespace formula_manage.UserClass
{
public class LogGing
{
public static void LogGingDATA(string dat)
{
string logpath = System.Environment.CurrentDirectory + "\\Log";//日志文件目录
string logPath = "" + System.Environment.CurrentDirectory + "\\Log\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt";//日志文件
string Log_time = "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]:";
if (Directory.Exists(logpath))//检查日志路径
{
if (!File.Exists(logPath))//检查日志文件并写入启动日志
{
FileStream fs = new FileStream(logPath, FileMode.CreateNew, FileAccess.Write);//创建写入文件
StreamWriter wr = new StreamWriter(fs);//创建文件
wr.WriteLine(Log_time + dat);
wr.Close();
}
else
{
FileStream fs = new FileStream(logPath, FileMode.Append, FileAccess.Write);
StreamWriter wr = new StreamWriter(fs);//创建文件
wr.WriteLine(Log_time + dat);
wr.Close(); }
}
else
{
DirectoryInfo directoryInfo = new DirectoryInfo(logpath);
directoryInfo.Create();//创建日志路径
}
}
}
}
+59
View File
@@ -0,0 +1,59 @@
using System;
using System.Security.Cryptography;
using System.Text;
namespace formula_manage.UserClass
{
/// <summary>
/// MD5加密
/// </summary>
internal class MD5check
{
/// <summary>
/// 16位MD5加密
/// </summary>
/// <param name="password"></param>
/// <returns></returns>
public static string MD5Encrypt16(string password)
{
var md5 = new MD5CryptoServiceProvider();
string t2 = BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(password)), 4, 8);
t2 = t2.Replace("-", "");
return t2;
}
/// <summary>
/// 32位MD5加密
/// </summary>
/// <param name="password"></param>
/// <returns></returns>
public static string MD5Encrypt32(string password)
{
string cl = password;
string pwd = "";
MD5 md5 = MD5.Create(); //实例化一个md5对像
// 加密后是一个字节类型的数组,这里要注意编码UTF8/Unicode等的选择 
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(cl));
// 通过使用循环,将字节类型的数组转换为字符串,此字符串是常规字符格式化所得
for (int i = 0; i < s.Length; i++)
{
// 将得到的字符串使用十六进制类型格式。格式后的字符是小写的字母,如果使用大写(X)则格式后的字符是大写字符
pwd = pwd + s[i].ToString("X");
}
return pwd;
}
/// <summary>
/// 64位MD5加密
/// </summary>
/// <param name="password"></param>
/// <returns></returns>
public static string MD5Encrypt64(string password)
{
string cl = password;
//string pwd = "";
MD5 md5 = MD5.Create(); //实例化一个md5对像
// 加密后是一个字节类型的数组,这里要注意编码UTF8/Unicode等的选择 
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(cl));
return Convert.ToBase64String(s);
}
}
}
+3 -4
View File
@@ -1,15 +1,14 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace formula_manage.UserClass namespace formula_manage.UserClass
{ {
internal class PressKey internal class PressKey
{ {
/// <summary>
/// 键盘模拟
/// </summary>
[DllImport("user32.dll", SetLastError = true)] [DllImport("user32.dll", SetLastError = true)]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo); static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);
public static void PressKeys(Keys key, bool up) public static void PressKeys(Keys key, bool up)
+156
View File
@@ -0,0 +1,156 @@
using FastReport;
using FastReport.Data;
using System;
using System.Collections.Generic;
using System.Data;
namespace formula_manage.UserClass
{
public class PrintHelper
{
/// <summary>
/// 打印
/// </summary>
/// <param name="printerName">打印机</param>
/// <param name="frxPath">模板</param>
/// <param name="dicParam">字典参数</param>
/// <param name="dsDataSource">数据源</param>
/// <param name="printNum">打印数量</param>
/// <returns></returns>
public static Tuple<bool, string> Print(string printerName, string frxPath, Dictionary<string, object> dicParam, DataSet dsDataSource, int printNum = 1)
{
bool flag = false;
string msg = "";
FastReport.Report report = new FastReport.Report();
try
{
report.Load(frxPath);
report.DoublePass = true;
if (dicParam != null && dicParam.Count > 0)
{
foreach (var item in dicParam)
{
report.SetParameterValue(item.Key, item.Value);
}
}
if (dsDataSource != null && dsDataSource.Tables.Count > 0)
{
report.RegisterData(dsDataSource);
foreach (DataSourceBase dataSourceBase in report.Dictionary.DataSources)
{
dataSourceBase.Enabled = true;
}
}
report.PrintSettings.ShowDialog = false;
report.PrintSettings.Printer = printerName;
report.PrintSettings.PrintMode = PrintMode.Split;
EnvironmentSettings envSet = new EnvironmentSettings();
envSet.ReportSettings.ShowProgress = false;
for (int i = 0; i < printNum; i++)
{
report.Print();
}
flag = true;
msg = "打印成功";
}
catch (Exception ex)
{
flag = false;
msg = ex.Message;
}
finally
{
report.Dispose();
}
return new Tuple<bool, string>(flag, msg);
}
/// <summary>
/// 设计
/// </summary>
/// <param name="frxPath">模板</param>
/// <returns></returns>
public static Tuple<bool, string> Design(string frxPath)
{
bool flag = false;
string msg = "";
FastReport.Report report = new FastReport.Report();
try
{
string chineseSimpleFrl = AppDomain.CurrentDomain.BaseDirectory + @"FastReport\Localization\language.frl";
FastReport.Utils.Res.LoadLocale(chineseSimpleFrl);
}
catch (Exception)
{
}
try
{
report.Load(frxPath);
report.DoublePass = true;
report.Design();
flag = true;
msg = "Designer Open";
}
catch (Exception ex)
{
flag = false;
msg = ex.Message;
}
finally
{
report.Dispose();
}
return new Tuple<bool, string>(flag, msg);
}
/// <summary>
/// 设计
/// </summary>
/// <param name="frxPath">模板</param>
/// <param name="dicParam">字典参数</param>
/// <param name="dsDataSource">数据源</param>
/// <returns></returns>
public static Tuple<bool, string> Designs(string frxPath, Dictionary<string, object> dicParam, DataSet dsDataSource)
{
bool flag = false;
string msg = "";
FastReport.Report report = new FastReport.Report();
try
{
report.Load(frxPath);
report.DoublePass = true;
if (dicParam != null && dicParam.Count > 0)
{
foreach (var item in dicParam)
{
report.SetParameterValue(item.Key, item.Value);
}
}
if (dsDataSource != null && dsDataSource.Tables.Count > 0)
{
report.RegisterData(dsDataSource);
foreach (DataSourceBase dataSourceBase in report.Dictionary.DataSources)
{
dataSourceBase.Enabled = true;
}
}
report.Design();
flag = true;
msg = "Designer Open";
}
catch (Exception ex)
{
flag = false;
msg = ex.Message;
}
finally
{
report.Dispose();
}
return new Tuple<bool, string>(flag, msg);
}
}
}
+37
View File
@@ -0,0 +1,37 @@
using System;
namespace formula_manage.UserClass
{
/// <summary>
/// 字符串转数字
/// </summary>
internal class StrToInt
{
/// <summary>
/// 十六进制字符串转十进制
/// </summary>
/// <param name="str">十六进制字符</param>
/// <returns></returns>
public static int To16Convert10(string str)
{
int res = 0;
try
{
str = str.Trim().Replace(" ", ""); //移除空字符
//方法1
res = int.Parse(str, System.Globalization.NumberStyles.AllowHexSpecifier);
//方法2
//int r2 = System.Int32.Parse(str, System.Globalization.NumberStyles.HexNumber);
//Console.WriteLine(r2);
//方法3
//int r3 = Convert.ToInt32(str, 16);
//Console.WriteLine(r3);
}
catch (Exception)
{
res = 0;
}
return res;
}
}
}
+186
View File
@@ -0,0 +1,186 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace formula_manage.UserClass
{
public class TCPServer
{
public static string infoR;
//第一步:调用socket()函数创建一个用于通信的套接字
public static Socket listenSocket;
//字典集合:存储IP和Socket的集合
public static Dictionary<string, Socket> OnLineList = new Dictionary<string, Socket>();
//当前时间
private string CurrentTime
{
get { return DateTime.Now.ToString("HH:mm:ss") + Environment.NewLine; }
}
//编码格式
public static Encoding econding = Encoding.UTF8;
public static void Start()
{
//第一步:调用socket()函数创建一个用于通信的套接字
listenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
//第二步:给已经创建的套接字绑定一个端口号,这一般通过设置网络套接口地址和调用Bind()函数来实现
IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(UserClass.get_local_ip_address.IP_Address()), int.Parse("11080"));
UserClass.LogGing.LogGingDATA("NativeIP = " + UserClass.get_local_ip_address.IP_Address());
UserClass.LogGing.LogGingDATA("NativePORT = 11080");
try
{
listenSocket.Bind(endPoint);
}
catch (Exception ex)
{
UserClass.LogGing.LogGingDATA("TCP_NotStart");
UserClass.LogGing.LogGingDATA(ex.Message);
return;
}
//第三步:调用listen()函数使套接字成为一个监听套接字
listenSocket.Listen(10);
//ShowMessage("服务器开启成功");
//开启一个线程监听
Task.Run(new Action(() => { ListenConnection(); }));
}
public static void ListenConnection()
{
while (true)
{
Socket clientSocket = listenSocket.Accept();
string ip = clientSocket.RemoteEndPoint.ToString();
//更新在线列表
// AddOnLine(ip, true);
//更新在线列表集合
OnLineList.Add(ip, clientSocket);
UserClass.LogGing.LogGingDATA("IP_Online = " + ip);
// ShowMessage(ip + "上线了");
Task.Run(() => ReceiveMsg(clientSocket));
}
}
/// <summary>
/// 接收方法
/// </summary>
/// <param name="clientSocket"></param>
public static void ReceiveMsg(Socket clientSocket)
{
while (true)
{
//定义一个2M的缓冲区
byte[] buffer = new byte[1024 * 1024 * 10];
int length = -1;
try
{
length = clientSocket.Receive(buffer);
}
catch (Exception)
{
//客户端下线了
//更新在线列表
string ip = clientSocket.RemoteEndPoint.ToString();
UserClass.LogGing.LogGingDATA("IP_Line = " + ip);
// AddOnLine(ip, false);
OnLineList.Remove(ip); //移除ip
break; //退出循环
}
if (length == 0)
{
//客户端下线了
//更新在线列表
string ip = clientSocket.RemoteEndPoint.ToString();
UserClass.LogGing.LogGingDATA("IP_Line = " + ip);
// AddOnLine(ip, false);
OnLineList.Remove(ip);
break;
}
else
{
infoR = econding.GetString(buffer, 0, length);
//ShowMessage(info);
string ip = clientSocket.RemoteEndPoint.ToString();
}
}
}
/*
/// <summary>
/// 在线列表更新
/// </summary>
/// <param name="clientIp"></param>
/// <param name="value"></param>
private void AddOnLine(string clientIp, bool value)
{
Invoke(new Action(() =>
{
if (value)
{
this.lst_Online.Items.Add(clientIp);
}
else
{
this.lst_Online.Items.Remove(clientIp);
}
}));
}
/// <summary>
/// 更新接收区
/// </summary>
/// <param name="info"></param>
private void ShowMessage(string info)
{
Invoke(new Action(() =>
{
this.txt_Rcv.AppendText(CurrentTime + info + Environment.NewLine);
}));
}
*/
/// <summary>
/// 消息发送
/// </summary>
public static void Bn_Send(string IP, string DAT)
{
if (OnLineList.ContainsKey(IP))
{
OnLineList[IP].Send(econding.GetBytes(DAT));
}
}
/// <summary>
/// 群发功能
/// </summary>
public static void Btn_SendAll(string DAT)
{
foreach (string item in OnLineList.Keys.ToArray())
{
if (OnLineList.ContainsKey(item))
{
OnLineList[item].Send(econding.GetBytes(DAT));
}
}
}
}
}
+199
View File
@@ -0,0 +1,199 @@
using System;
using System.Drawing.Printing;
using System.Management;
using System.Printing;
using System.Windows.Forms;
namespace formula_manage.UserClass
{
internal class UserPrint
{
/// <summary>
/// 判断是否连接打印机
/// </summary>
public bool CheckPrinter()
{
//取得默认打印机名
PrintDocument pdoc = new PrintDocument();
string printerName1 = pdoc.PrinterSettings.PrinterName;
//ManagementScope scope = new ManagementScope(@"\root\cimv2");
//scope.Connect();
// Select Printers from WMI Object Collections
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Printer");
string printerName = "";
foreach (ManagementObject printer in searcher.Get())
{
printerName = printer["Name"].ToString().ToLower();
if (printerName.IndexOf(printerName1.ToLower()) > -1)
{
if (printer["WorkOffline"].ToString().ToLower().Equals("true"))
{
switch (MessageBox.Show("默认打印机未连接或出错", "警告", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
{
case DialogResult.Retry:
CheckPrinter();
break;
}
return false;
// printer is offline by user
}
else
{
// printer is not offline
return true;
}
}
}
switch (MessageBox.Show("默认打印机未连接或出错", "警告", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error))
{
case DialogResult.Retry:
CheckPrinter();
break;
}
return false;
}
/// <summary>
/// 判断打印机状态,传Exception
/// </summary>
/// <param name="ex">Exception</param>
public void ErrerPrint(Exception ex)
{
PrintQueue pq = LocalPrintServer.GetDefaultPrintQueue();
string PrintStaticText = "";
bool isPrintErrer = false;
switch (pq.QueueStatus)
{
case PrintQueueStatus.Busy:
PrintStaticText = "打印机正忙";
isPrintErrer = true;
break;
case PrintQueueStatus.DoorOpen:
PrintStaticText = "打印机上的门已打开";
isPrintErrer = true;
break;
case PrintQueueStatus.Error:
PrintStaticText = "由于错误情况,打印机无法打印。";
isPrintErrer = true;
break;
case PrintQueueStatus.IOActive:
PrintStaticText = "打印机正在与打印服务器交换数据";
isPrintErrer = true;
break;
case PrintQueueStatus.Initializing:
PrintStaticText = "打印机正在初始化";
isPrintErrer = true;
break;
case PrintQueueStatus.ManualFeed:
PrintStaticText = "打印机正在等待用户将打印介质放入手动送纸盒";
isPrintErrer = true;
break;
case PrintQueueStatus.NoToner:
PrintStaticText = "打印机墨粉用完";
isPrintErrer = true;
break;
case PrintQueueStatus.None:
PrintStaticText = "未指定状态。";
isPrintErrer = true;
break;
case PrintQueueStatus.NotAvailable:
PrintStaticText = "状态信息不可用";
isPrintErrer = true;
break;
case PrintQueueStatus.Offline:
PrintStaticText = "打印机处于脱机状态。";
isPrintErrer = true;
break;
case PrintQueueStatus.OutOfMemory:
PrintStaticText = "打印机无可用内存";
isPrintErrer = true;
break;
case PrintQueueStatus.OutputBinFull:
PrintStaticText = "打印机的输出纸盒已满";
isPrintErrer = true;
break;
case PrintQueueStatus.PagePunt:
PrintStaticText = "打印机不能打印当前页";
isPrintErrer = true;
break;
case PrintQueueStatus.PaperJam:
PrintStaticText = "打印机卡纸";
isPrintErrer = true;
break;
case PrintQueueStatus.PaperOut:
PrintStaticText = "打印机中没有或已用完当前打印作业所需的纸张类型";
isPrintErrer = true;
break;
case PrintQueueStatus.PaperProblem:
PrintStaticText = "打印机中的纸张导致未指定的错误情况";
isPrintErrer = true;
break;
case PrintQueueStatus.Paused:
PrintStaticText = "打印队列已暂停";
isPrintErrer = true;
break;
case PrintQueueStatus.PendingDeletion:
PrintStaticText = "打印队列正在删除打印作业";
isPrintErrer = true;
break;
case PrintQueueStatus.PowerSave:
PrintStaticText = "打印机处于节能模式";
isPrintErrer = true;
break;
case PrintQueueStatus.Printing:
PrintStaticText = "设备正在打印";
isPrintErrer = true;
break;
case PrintQueueStatus.Processing:
PrintStaticText = "设备正在执行某种工作,如果此设备是集打印机、传真机和扫描仪于一体的多功能设备,则不需要打印";
isPrintErrer = true;
break;
case PrintQueueStatus.ServerUnknown:
PrintStaticText = "打印机处于错误状态";
isPrintErrer = true;
break;
case PrintQueueStatus.TonerLow:
PrintStaticText = "打印机中只剩下少量墨粉";
isPrintErrer = true;
break;
case PrintQueueStatus.UserIntervention:
PrintStaticText = "打印机要求通过用户操作来更正错误情况";
isPrintErrer = true;
break;
case PrintQueueStatus.Waiting:
PrintStaticText = "打印机正在等待打印作业";
isPrintErrer = true;
break;
case PrintQueueStatus.WarmingUp:
PrintStaticText = "打印机正在预热";
isPrintErrer = true;
break;
}
if (isPrintErrer)
{
//WriteLog.SetString(PrintStaticText);
MessageBox.Show(PrintStaticText, "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
if (ex.Message == "The net printer is unavailable.")
{
MessageBox.Show("网络打印机不可用", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
// WriteLog.SetString(ex.Message);
}
else
{
// WriteLog.SetException(ex);
}
}
}
}
+46
View File
@@ -0,0 +1,46 @@
using System.Net.NetworkInformation;
using System.Net.Sockets;
namespace formula_manage.UserClass
{
public class get_local_ip_address
{
public static string getLocalIPAddressWithNetworkInterface(NetworkInterfaceType _type)//获取本机ip并以字符串方式返回
{
string output = "";
foreach (NetworkInterface item in NetworkInterface.GetAllNetworkInterfaces())
{
if (item.NetworkInterfaceType == _type && item.OperationalStatus == OperationalStatus.Up)
{
foreach (UnicastIPAddressInformation ip in item.GetIPProperties().UnicastAddresses)
{
if (ip.Address.AddressFamily == AddressFamily.InterNetwork)
{
output = ip.Address.ToString();
}
}
}
}
return output;
}
public static string IP_Address()
{
string ip;
ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.Ethernet);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.Wireless80211);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.Ppp);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.Wwanpp);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.TokenRing);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.Fddi);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.GenericModem);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.IPOverAtm);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.Tunnel);
if (ip == "") ip = getLocalIPAddressWithNetworkInterface(NetworkInterfaceType.Unknown);
if (ip == "") ip = "127.0.0.1";
return ip;
}
}
}
+52
View File
@@ -0,0 +1,52 @@
<UserControl x:Class="formula_manage.View.Formula"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:formula_manage.View"
mc:Ignorable="d"
d:DesignHeight="150" d:DesignWidth="405">
<Grid>
<DataGrid x:Name="edit" AlternationCount="2" IsReadOnly="False"
Margin="0,0,0,0" d:ItemsSource="{d:SampleData ItemCount=30}" AutoGenerateColumns="False" MinColumnWidth="30"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False"
CanUserSortColumns="False"
Background="White" SelectionMode="Single">
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF5F5F5" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="#000000"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTextColumn Header="配方代码" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="配方名称" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="色名" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="备注" Width="800" FontSize="15" MinWidth="80" CanUserReorder="False"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>
+15
View File
@@ -0,0 +1,15 @@
using System.Windows.Controls;
namespace formula_manage.View
{
/// <summary>
/// Formula.xaml 的交互逻辑
/// </summary>
public partial class Formula : UserControl
{
public Formula()
{
InitializeComponent();
}
}
}
+58
View File
@@ -0,0 +1,58 @@
<UserControl x:Class="formula_manage.View.ViewOrder"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:formula_manage.View"
mc:Ignorable="d"
d:DesignHeight="150" d:DesignWidth="405" Background="#FFE0E0E0">
<Grid>
<DataGrid x:Name="Order" AlternationCount="2" IsReadOnly="True" MouseDoubleClick="DataGridOrder_MouseDoubleClick"
HeadersVisibility ="Column" Margin="0,0,0,40" AutoGenerateColumns="False" MinColumnWidth="30"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False"
CanUserSortColumns="False" Background="White" SelectionMode="Single">
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF5F5F5" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="#000000"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTextColumn Header="订单号" Binding="{Binding OrdeNO}" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False" IsReadOnly="True"/>
<DataGridTextColumn Header="工艺名称" Binding="{Binding ProcessNAME}" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False" IsReadOnly="True"/>
<DataGridTextColumn Header="工艺代码" Binding="{Binding ProcessCODE}" Width="0" FontSize="15" MaxWidth="400" MinWidth="0" CanUserReorder="False" IsReadOnly="True"/>
<DataGridTextColumn Header="品名" Binding="{Binding colour}" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False" IsReadOnly="True"/>
<DataGridTextColumn Header="客户" Binding="{Binding customer}" Width="200" FontSize="15" MaxWidth="200" MinWidth="80" CanUserReorder="False" IsReadOnly="True"/>
<DataGridTextColumn Header="下单时间" Binding="{Binding OrdeTime}" Width="200" FontSize="15" MaxWidth="200" MinWidth="80" CanUserReorder="False" IsReadOnly="True"/>
<DataGridTextColumn Header="备注" Binding="{Binding REMARK}" Width="800" FontSize="15" MinWidth="80" CanUserReorder="False" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
<ComboBox x:Name="condition" HorizontalAlignment="Left" Height="30" Width="100" VerticalAlignment="Bottom" FontSize="20" Margin="5,0,0,5"/>
<TextBox x:Name="search" HorizontalAlignment="Left" Height="30" Margin="110,0,0,5" TextWrapping="Wrap" VerticalAlignment="Bottom" Width="200" FontSize="20"/>
<Button Content="搜索" Click="Button_search" Height="30" Margin="315,0,0,5" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="50" FontSize="20" Background="#FFEFEFEF" BorderBrush="White" />
</Grid>
</UserControl>
+132
View File
@@ -0,0 +1,132 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace formula_manage.View
{
/// <summary>
/// ViewProcess.xaml 的交互逻辑
/// </summary>
public partial class ViewOrder : UserControl
{
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
string TEXT_SQLIP;
string TEXT_SQLNAME;
string TEXT_SQMOD;
string TEXT_SQLUSER;
string TEXT_SQLPASWOR;
string Connstr_SC;
DataTable dataTable = new DataTable(); //建立缓存
public ViewOrder()
{
InitializeComponent();
condition.Items.Add("");
condition.Items.Add("工艺");
condition.Items.Add("客户");
condition.Items.Add("品名");
sql_();
}
private async void sql_()
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
if (TEXT_SQMOD == "0") //判断连接方式
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
}
string order_sql = "SELECT OrdeNO ,ProcessNAME ,ProcessCODE ,colour ,customer ,OrdeTime ,REMARK FROM [Dispensing].[dbo].[ORDER] order by OrdeTime desc";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(order_sql, Connstr_SC); //查询
dataTable.Clear();
Stuff_data.Fill(dataTable); //查询结果存入缓存
conn_SC.Close(); //关闭连接
Order.ItemsSource = dataTable.DefaultView; //数据加入表格
//Order.DisplayMemberPath = "Name";
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败,检查连接");
return;
}
}
private async void Button_search(object sender, RoutedEventArgs e)//搜索按钮
{
int a;
string order_sql = "SELECT OrdeNO ,ProcessNAME ,ProcessCODE ,colour ,customer ,OrdeTime ,REMARK FROM [Dispensing].[dbo].[ORDER] order by OrdeTime desc";//查询语句
a = condition.SelectedIndex; //获取选择条件
if (a == 1) order_sql = "SELECT OrdeNO ,ProcessNAME ,ProcessCODE ,colour ,customer ,OrdeTime ,REMARK FROM [Dispensing].[dbo].[ORDER] where ProcessNAME = '" + search.Text + "' order by OrdeTime desc";//查询语句
else if (a == 2) order_sql = "SELECT OrdeNO ,ProcessNAME ,ProcessCODE ,colour ,customer ,OrdeTime ,REMARK FROM [Dispensing].[dbo].[ORDER] where customer = '" + search.Text + "' order by OrdeTime desc";//查询语句
else if (a == 3) order_sql = "SELECT OrdeNO ,ProcessNAME ,ProcessCODE ,colour ,customer ,OrdeTime ,REMARK FROM [Dispensing].[dbo].[ORDER] where colour = '" + search.Text + "' order by OrdeTime desc";//查询语句
else if (a == 0) order_sql = "SELECT OrdeNO ,ProcessNAME ,ProcessCODE ,colour ,customer ,OrdeTime ,REMARK FROM [Dispensing].[dbo].[ORDER] order by OrdeTime desc";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(order_sql, Connstr_SC); //查询
dataTable.Clear();
Stuff_data.Fill(dataTable); //查询结果存入缓存
conn_SC.Close(); //关闭连接
Order.ItemsSource = dataTable.DefaultView; //数据加入表格
//Order.DisplayMemberPath = "Name";
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败");
return;
}
}
public delegate void SendMessage(string[] value);
public SendMessage sendMessage;
string[] OrderData = new string[7];
private void DataGridOrder_MouseDoubleClick(object sender, MouseButtonEventArgs e)//数据表双击事件
{
int rownum = Order.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)//判断鼠标定位是否有效
{
/*定位选中行及指定列单元格文本信息*/
OrderData[0] = (Order.Columns[0].GetCellContent(Order.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[1] = (Order.Columns[1].GetCellContent(Order.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[2] = (Order.Columns[2].GetCellContent(Order.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[3] = (Order.Columns[3].GetCellContent(Order.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[4] = (Order.Columns[4].GetCellContent(Order.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[5] = (Order.Columns[5].GetCellContent(Order.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[6] = (Order.Columns[6].GetCellContent(Order.Items[rownum]) as TextBlock).Text.Trim();//定位第列
sendMessage(OrderData); //传入数组
}
}
}
}
+54
View File
@@ -0,0 +1,54 @@
<UserControl x:Class="formula_manage.View.ViewProcess"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:formula_manage.View"
mc:Ignorable="d"
d:DesignHeight="150" d:DesignWidth="405">
<Grid>
<DataGrid x:Name="Technology" AlternationCount="2" IsReadOnly="True" MouseDoubleClick="DataGrid_Technology"
HeadersVisibility ="Column" Margin="0,0,0,0" AutoGenerateColumns="False" MinColumnWidth="30"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" CanUserReorderColumns="False"
CanUserSortColumns="False"
Background="White" SelectionMode="Single">
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF5F5F5" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="#000000"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTextColumn Binding="{Binding PROC_CODE}" Header="工艺代码" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Binding="{Binding PROC_NAME}" Header="工艺名称" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Binding="{Binding PROC_STEP}" Header="步数" Width="50" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Binding="{Binding PROC_FABRIC}" Header="布种" Width="100" FontSize="15" MaxWidth="200" MinWidth="80" CanUserReorder="False"/>
<DataGridTextColumn Binding="{Binding PROC_PRODUCT}" Header="品名" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Binding="{Binding REMARK}" Header="备注" Width="800" FontSize="15" MinWidth="80" CanUserReorder="False"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>
+92
View File
@@ -0,0 +1,92 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Windows.Controls;
using System.Windows.Input;
namespace formula_manage.View
{
/// <summary>
/// ViewProcess.xaml 的交互逻辑
/// </summary>
public partial class ViewProcess : UserControl
{
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
string TEXT_SQLIP;
string TEXT_SQLNAME;
string TEXT_SQMOD;
string TEXT_SQLUSER;
string TEXT_SQLPASWOR;
string Connstr_SC;
DataTable dataTable = new DataTable(); //建立缓存
public ViewProcess()
{
InitializeComponent();
sql_();
}
private async void sql_()
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
if (TEXT_SQMOD == "0") //判断连接方式
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
}
string order_sql = "SELECT PROC_CODE,PROC_NAME,PROC_TEST,PROC_STEP,MODIFY_TIME,PROC_FABRIC,PROC_PRODUCT,REMARK FROM [Dispensing].[dbo].[PROCEDUR_TITLE]";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(order_sql, Connstr_SC); //查询
dataTable.Clear();
Stuff_data.Fill(dataTable); //查询结果存入缓存
conn_SC.Close(); //关闭连接
Technology.ItemsSource = dataTable.DefaultView; //数据加入表格
//Order.DisplayMemberPath = "Name";
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败");
return;
}
}
public delegate void SendMessage(string[] value);
public SendMessage sendMessage;
string[] OrderData = new string[6];
private void DataGrid_Technology(object sender, MouseButtonEventArgs e)//数据表双击事件
{
int rownum = Technology.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)//判断鼠标定位是否有效
{
/*定位选中行及指定列单元格文本信息*/
OrderData[0] = (Technology.Columns[0].GetCellContent(Technology.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[1] = (Technology.Columns[1].GetCellContent(Technology.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[2] = (Technology.Columns[2].GetCellContent(Technology.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[3] = (Technology.Columns[3].GetCellContent(Technology.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[4] = (Technology.Columns[4].GetCellContent(Technology.Items[rownum]) as TextBlock).Text.Trim();//定位第列
OrderData[5] = (Technology.Columns[5].GetCellContent(Technology.Items[rownum]) as TextBlock).Text.Trim();//定位第列
sendMessage(OrderData); //传入数组
}
}
}
}
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Windows.Threading;
namespace formula_manage.ViewModel
{
public class ExchangeViewModel : ViewModelBase
{
public ExchangeViewModel()
{
CountDown();
}
public void CountDown()
{
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.5)
};
timer.Tick += Tick_Event;
timer.Start();
//设置定时器
// disTimer.Tick += new EventHandler(DisTimer_Tick);//每一秒执行的方法
// disTimer.Interval = new TimeSpan(10000000); //时间间隔为一秒。
// disTimer.Start();//计时开始
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
}
}
}
+323
View File
@@ -0,0 +1,323 @@
using formula_manage.UserClass;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;
using System.Windows.Threading;
namespace formula_manage.ViewModel
{
public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
///<Summary>
///
///
///</Summary>
///
public class MainWindowViewModel : ViewModelBase
{
DataTable DissolvedataTable = new DataTable(); //建立Dissolve
DataTable STUFFdataTable = new DataTable(); //建立STUFF
DataTable MACHINEdataTable = new DataTable(); //建立Machine
// DataTable RRODUCTdataTable = new DataTable(); //建立RRODUCT
// DataTable RecipedataTable = new DataTable(); //建立Recipe
public static DataTable STUFFdatatemp = new DataTable(); //建立STUFF缓存
public static DataTable MACHINEdatatemp = new DataTable(); //建立Machine缓存
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
public string sys_Time; //显示系统时间
public string cdk_time; //注册到期时间
public string cdk_page = "Hidden"; //注册到期页面状态
public string cdk_pageT; //注册到期页面关闭时间
int cdk_pageT_T = -1;////注册到期页面关闭时间计算
public string Sys_Time //通知UI控件参数改变
{
get { return sys_Time; }
set { sys_Time = value; OnPropertyChanged("Sys_Time"); }
}
public string Cdk_time //通知UI控件参数改变
{
get { return cdk_time; }
set { cdk_time = value; OnPropertyChanged("Cdk_time"); }
}
public string Cdk_page //通知UI控件参数改变
{
get { return cdk_page; }
set { cdk_page = value; OnPropertyChanged("Cdk_page"); }
}
public string Cdk_pageT //通知UI控件参数改变
{
get { return cdk_pageT; }
set { cdk_pageT = value; OnPropertyChanged("Cdk_pageT"); }
}
string TEXT_SQLIP;
string TEXT_SQLNAME;
string TEXT_SQMOD;
string TEXT_SQLUSER;
string TEXT_SQLPASWOR;
string Connstr_SC;
string SN_ID;
string SN_KEY;
private void CDkey_()
{
try
{
string id_1 = SN_ID.Substring(5, 1) + SN_ID.Substring(0, 1) + SN_ID.Substring(4, 1) + SN_ID.Substring(1, 1) + SN_ID.Substring(3, 1) + SN_ID.Substring(2, 1);
if ((id_1 == SN_KEY.Substring(0, 6)) && (SN_KEY.Length == 16))
{
if (CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(SN_KEY.Substring(0, 12)), true) == SN_KEY.Substring(12, 4)) //校验key的crc校验值
{
string Y = (2255 - StrToInt.To16Convert10(SN_KEY.Substring(6, 2))).ToString();
string M = (255 - StrToInt.To16Convert10(SN_KEY.Substring(8, 2))).ToString();
string D = (255 - StrToInt.To16Convert10(SN_KEY.Substring(10, 2))).ToString();
string YY = DateTime.Now.ToString("yyyy");
string MM = DateTime.Now.ToString("MM");
string DD = DateTime.Now.ToString("dd");
Cdk_time = "注册到期时间: " + Y + "/" + M + "/" + D;
if (string.Compare(Y, YY) < 0)
{
if (string.Compare(M, MM) < 0)
{
if (string.Compare(D, DD) < 0)
{
Cdk_page = "Visible";
//cdk_pageT_T = -1; //防止触发倒计时
}
else if ((int.Parse(D) - int.Parse(DD)) <= 10)//提前三天提醒
{
Cdk_page = "Visible";
cdk_pageT_T = 180; //页面关闭倒计时30秒
}
}
}
}
else
{
Cdk_page = "Visible";
Cdk_time = "许可证安全校验错误请重新激活";
}
}
else
{
Cdk_page = "Visible";
Cdk_time = "计算机信息变更当前许可证失效";
}
}
catch (Exception)
{
Cdk_page = "Visible";
Cdk_time = "许可证安全校验错误请重新激活";
}
}
private async void Sql_()
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
SN_ID = Configini.IniReadvalue("SN", "SN2");
SN_KEY = Configini.IniReadvalue("SN", "SN1");
if (TEXT_SQMOD == "0") //判断连接方式
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
}
string Stuff_sql = "SELECT ProductCode ,ProductName ,ProductType ,Concentration FROM [dbo].[PRODUCT] order by ProductCode asc";//查询STUFF语句
string MAC_sql = "SELECT Name ,Capacity ,Volume FROM [dbo].[MACHINE] order by Name asc";//查询machine语句
string Dissolve_sql = "SELECT DissolveCode ,DissolveName ,MaterialType ,WeightMIN ,WeightMAX REMARK FROM [dbo].[Dissolve]";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(Stuff_sql, Connstr_SC); //查询stuff
SqlDataAdapter Mac_data = new SqlDataAdapter(MAC_sql, Connstr_SC); //查询machine
SqlDataAdapter Dissolve_data = new SqlDataAdapter(Dissolve_sql, Connstr_SC); //查询Dissolve
Stuff_data.Fill(STUFFdataTable); //stuff查询结果存入缓存
Mac_data.Fill(MACHINEdataTable); //machine查询结果存入缓存
Dissolve_data.Fill(DissolvedataTable); //Dissolve_data查询结果存入缓存
conn_SC.Close(); //关闭连接
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败");
UserClass.LogGing.LogGingDATA("DISPENLINK = ConnectFailed");
return;
}
}
public MainWindowViewModel()
{
CountDown();
Sql_();
CDkey_();
stuff_Product = ToObservableCollection<Product>(STUFFdataTable); //stuff_Product表转换
mac_Machine = ToObservableCollection<Machine>(MACHINEdataTable);
flow_Workflow = ToObservableCollection<Workflow>(DissolvedataTable);
STUFFdatatemp = STUFFdataTable;
MACHINEdatatemp = MACHINEdataTable;
}
public ObservableCollection<Product> stuff_Product { get; set; } //stuff_Product动态表实力化
public ObservableCollection<Machine> mac_Machine { get; set; } //mac_Machine动态表实力化
public ObservableCollection<Workflow> flow_Workflow { get; set; } //Dissolve动态表实力化
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new() //DataTable FOR ObservableCollection转换器
{
Type t = typeof(T);
PropertyInfo[] propertys = t.GetProperties();
ObservableCollection<T> lst = new ObservableCollection<T>();
string typeName = string.Empty;
foreach (DataRow dr in dt.Rows)
{
T entity = new T();
foreach (PropertyInfo pi in propertys)
{
typeName = pi.Name;
if (dt.Columns.Contains(typeName))
{
if (!pi.CanWrite) continue;
object value = dr[typeName];
if (value == DBNull.Value) continue;
if (pi.PropertyType == typeof(string))
{
pi.SetValue(entity, value.ToString(), null);
}
else if (pi.PropertyType == typeof(int) || pi.PropertyType == typeof(int?))
{
pi.SetValue(entity, int.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(DateTime?) || pi.PropertyType == typeof(DateTime))
{
pi.SetValue(entity, DateTime.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(float))
{
pi.SetValue(entity, float.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(double))
{
pi.SetValue(entity, double.Parse(value.ToString()), null);
}
else
{
pi.SetValue(entity, value, null);
}
}
}
lst.Add(entity);
}
return lst;
} //DataTable FOR ObservableCollection转换器
/// <summary>
/// 循环事件设定
/// </summary>
public void CountDown()
{
DispatcherTimer timer1s = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick
{
Interval = TimeSpan.FromSeconds(1)
};
timer1s.Tick += Tick_Event_1S;
timer1s.Start();
DispatcherTimer timer1h = new DispatcherTimer//初始化循环,每1h调用一次Tick
{
Interval = TimeSpan.FromSeconds(3600)
};
timer1h.Tick += Tick_Event_1h;
timer1h.Start();
//设置定时器
// disTimer.Tick += new EventHandler(DisTimer_Tick);//每一秒执行的方法
// disTimer.Interval = new TimeSpan(10000000); //时间间隔为一秒。
// disTimer.Start();//计时开始
}
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件
{
Sys_Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
if (cdk_pageT_T > 0) //提示注册画面关闭倒计时
{
cdk_pageT_T--;
Cdk_pageT = cdk_pageT_T.ToString();
if (cdk_pageT_T == 1) Cdk_page = "Hidden";
}
}
void Tick_Event_1h(object sender, EventArgs e)//Tick_Event周期执行事件
{
CDkey_();
}
}
public class Product //stuff_Product
{
public string ProductCode { get; set; }
public string ProductName { get; set; }
public int ProductType { get; set; }
public int Concentration { get; set; }
public override string ToString()
{
return ProductCode;
}
}
public class Machine //mac
{
public string Name { get; set; }
public float Volume { get; set; }
public float Capacity { get; set; }
public override string ToString()
{
return Name;
}
}
public class Workflow //Dissolve
{
public string DissolveName { get; set; }
public int MaterialType { get; set; }
public int WeightMIN { get; set; }
public int WeightMAX { get; set; }
public override string ToString()
{
return DissolveName;
}
}
}
+217
View File
@@ -0,0 +1,217 @@
using System;
using System.Collections.ObjectModel;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;
using System.Windows.Threading;
namespace formula_manage.ViewModel
{
/* public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}*/
///<Summary>
///
///
///</Summary>
///
public class RECIPEViewModel : ViewModelBase
{
DataTable DissolvedataTable = new DataTable(); //建立Dissolve
DataTable STUFFdataTable = new DataTable(); //建立STUFF
DataTable MACHINEdataTable = new DataTable(); //建立Machine
DataTable RRODUCTdataTable = new DataTable(); //建立RRODUCT
DataTable RecipedataTable = new DataTable(); //建立Recipe
public static DataTable STUFFdatatemp = new DataTable(); //建立STUFF缓存
public static DataTable MACHINEdatatemp = new DataTable(); //建立Machine缓存
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
public string sys_Time; //显示系统时间
public string Sys_Time //通知UI控件参数改变
{
get { return sys_Time; }
set { sys_Time = value; OnPropertyChanged("Sys_Time"); }
}
string TEXT_SQLIP;
string TEXT_SQLNAME;
string TEXT_SQMOD;
string TEXT_SQLUSER;
string TEXT_SQLPASWOR;
string Connstr_SC;
private async void Sql_()
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
if (TEXT_SQMOD == "0") //判断连接方式
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
}
string Stuff_sql = "SELECT ProductCode ,ProductName ,ProductType ,Concentration FROM [Dispensing].[dbo].[PRODUCT] order by ProductCode asc";//查询STUFF语句
string MAC_sql = "SELECT Name ,Capacity ,Volume FROM [Dispensing].[dbo].[MACHINE] order by Name asc";//查询machine语句
string Dissolve_sql = "SELECT DissolveCode ,DissolveName ,MaterialType ,WeightMIN ,WeightMAX REMARK FROM [Dispensing].[dbo].[Dissolve]";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(Stuff_sql, Connstr_SC); //查询stuff
SqlDataAdapter Mac_data = new SqlDataAdapter(MAC_sql, Connstr_SC); //查询machine
SqlDataAdapter Dissolve_data = new SqlDataAdapter(Dissolve_sql, Connstr_SC); //查询Dissolve
Stuff_data.Fill(STUFFdataTable); //stuff查询结果存入缓存
Mac_data.Fill(MACHINEdataTable); //machine查询结果存入缓存
Dissolve_data.Fill(DissolvedataTable); //Dissolve_data查询结果存入缓存
conn_SC.Close(); //关闭连接
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求原料信息失败,检查连接");
return;
}
}
public RECIPEViewModel()
{
CountDown();
Sql_();
stuff_Product = ToObservableCollection<Product>(STUFFdataTable); //stuff_Product表转换
mac_Machine = ToObservableCollection<Machine>(MACHINEdataTable);
flow_Workflow = ToObservableCollection<Workflow>(DissolvedataTable);
STUFFdatatemp = STUFFdataTable;
MACHINEdatatemp = MACHINEdataTable;
}
public ObservableCollection<Product> stuff_Product { get; set; } //stuff_Product动态表实力化
public ObservableCollection<Machine> mac_Machine { get; set; } //mac_Machine动态表实力化
public ObservableCollection<Workflow> flow_Workflow { get; set; } //Dissolve动态表实力化
public ObservableCollection<T> ToObservableCollection<T>(DataTable dt) where T : class, new() //DataTable FOR ObservableCollection转换器
{
Type t = typeof(T);
PropertyInfo[] propertys = t.GetProperties();
ObservableCollection<T> lst = new ObservableCollection<T>();
string typeName = string.Empty;
foreach (DataRow dr in dt.Rows)
{
T entity = new T();
foreach (PropertyInfo pi in propertys)
{
typeName = pi.Name;
if (dt.Columns.Contains(typeName))
{
if (!pi.CanWrite) continue;
object value = dr[typeName];
if (value == DBNull.Value) continue;
if (pi.PropertyType == typeof(string))
{
pi.SetValue(entity, value.ToString(), null);
}
else if (pi.PropertyType == typeof(int) || pi.PropertyType == typeof(int?))
{
pi.SetValue(entity, int.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(DateTime?) || pi.PropertyType == typeof(DateTime))
{
pi.SetValue(entity, DateTime.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(float))
{
pi.SetValue(entity, float.Parse(value.ToString()), null);
}
else if (pi.PropertyType == typeof(double))
{
pi.SetValue(entity, double.Parse(value.ToString()), null);
}
else
{
pi.SetValue(entity, value, null);
}
}
}
lst.Add(entity);
}
return lst;
} //DataTable FOR ObservableCollection转换器
/// <summary>
/// 循环事件设定
/// </summary>
public void CountDown()
{
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
{
Interval = TimeSpan.FromSeconds(0.5)
};
timer.Tick += Tick_Event;
timer.Start();
//设置定时器
// disTimer.Tick += new EventHandler(DisTimer_Tick);//每一秒执行的方法
// disTimer.Interval = new TimeSpan(10000000); //时间间隔为一秒。
// disTimer.Start();//计时开始
}
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
{
Sys_Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
}
/* public class Product //stuff_Product
{
public string ProductCode { get; set; }
public string ProductName { get; set; }
public int ProductType { get; set; }
public int Concentration { get; set; }
public override string ToString()
{
return ProductCode;
}
}
public class Machine //mac
{
public string Name { get; set; }
public float Volume { get; set; }
public float Capacity { get; set; }
public override string ToString()
{
return Name;
}
}
public class Workflow //Dissolve
{
public string DissolveName { get; set; }
public int MaterialType { get; set; }
public int WeightMIN { get; set; }
public int WeightMAX { get; set; }
public override string ToString()
{
return DissolveName;
}
}*/
}
+53
View File
@@ -0,0 +1,53 @@
using CommonServiceLocator;
using GalaSoft.MvvmLight.Ioc;
namespace formula_manage.ViewModel
{
public class ViewModelLocator
{
public ViewModelLocator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
////if (ViewModelBase.IsInDesignModeStatic)
////{
//// // Create design time view services and models
//// SimpleIoc.Default.Register<IDataService, DesignDataService>();
////}
////else
////{
//// // Create run time view services and models
//// SimpleIoc.Default.Register<IDataService, DataService>();
////}
SimpleIoc.Default.Register<MainWindowViewModel>();
SimpleIoc.Default.Register<RECIPEViewModel>();
SimpleIoc.Default.Register<ExchangeViewModel>();
}
public MainWindowViewModel Main
{
get
{
return ServiceLocator.Current.GetInstance<MainWindowViewModel>();
}
}
public RECIPEViewModel Recipev
{
get
{
return ServiceLocator.Current.GetInstance<RECIPEViewModel>();
}
}
public ExchangeViewModel Exchange
{
get
{
return ServiceLocator.Current.GetInstance<ExchangeViewModel>();
}
}
}
}
+38
View File
@@ -0,0 +1,38 @@
<Window x:Class="formula_manage.Windows.APP_set"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.Windows"
mc:Ignorable="d" Loaded="Window_SET" BorderBrush="White" Background="#FFEFEFEF"
Title="APP_set" Height="450" Width="800" MaxHeight="450" MaxWidth="800" ResizeMode="NoResize">
<Grid>
<CheckBox x:Name="Login_LINK" HorizontalAlignment="Left" Height="19" Margin="15,15,0,0" VerticalAlignment="Top" Width="150" Content="登录页面显示连接状态" IsTabStop="False" Checked="Login_LINK_Checked" Unchecked="Login_LINK_Checked"/>
<CheckBox x:Name="EXLINK" HorizontalAlignment="Left" Height="19" Margin="15,35,0,0" VerticalAlignment="Top" Width="150" Content="启用外挂程序" IsTabStop="False" Checked="Login_ex_Checked" Unchecked="Login_ex_Checked"/>
<CheckBox x:Name="Login_PRINT" HorizontalAlignment="Left" Height="19" Margin="15,55,0,0" VerticalAlignment="Top" Width="150" Content="确认立即打印料单" IsTabStop="False" Checked="Login_PRINT_Checked" Unchecked="Login_PRINT_Checked"/>
<CheckBox x:Name="Login_MACHINE" HorizontalAlignment="Left" Height="19" Margin="15,75,0,0" VerticalAlignment="Top" Width="150" Content="允许输入机台号" IsTabStop="False" Checked="Login_MAC_Checked" Unchecked="Login_MAC_Checked"/>
<CheckBox x:Name="Login_anew" HorizontalAlignment="Left" Height="19" Margin="15,95,0,0" VerticalAlignment="Top" Width="150" Content="单号相同时重染号修改" IsTabStop="False" Checked="Login_anew_Checked" Unchecked="Login_anew_Checked"/>
<TextBlock HorizontalAlignment="Left" Height="19" Margin="245,15,0,0" TextWrapping="Wrap" Text="显示单位" VerticalAlignment="Top" Width="55"/>
<ComboBox x:Name="Login_Gkg" HorizontalAlignment="Left" Height="19" Margin="300,15,0,0" VerticalAlignment="Top" Width="100">
<ComboBoxItem Content="AUTO" FontSize="10"></ComboBoxItem>
<ComboBoxItem Content="G" FontSize="10"></ComboBoxItem>
<ComboBoxItem Content="KG" FontSize="10"></ComboBoxItem>
<ComboBoxItem Content="KG/L" FontSize="10"></ComboBoxItem>
</ComboBox>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="10,220,0,0" TextWrapping="Wrap" Text="前缀名称" VerticalAlignment="Top" Width="75" FontSize="14"/>
<TextBox x:Name="Prepose" HorizontalAlignment="Left" Height="20" Margin="85,220,0,0" TextWrapping="Wrap" Text="D" VerticalAlignment="Top" Width="125"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="10,250,0,0" TextWrapping="Wrap" Text="日期格式" VerticalAlignment="Top" Width="75" FontSize="14"/>
<TextBox x:Name="TimeFormat" HorizontalAlignment="Left" Height="20" Margin="85,250,0,0" TextWrapping="Wrap" Text="yyyyMMddHHmmss" VerticalAlignment="Top" Width="125"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="10,280,0,0" TextWrapping="Wrap" Text="排序格式" VerticalAlignment="Top" Width="75" FontSize="14"/>
<TextBox x:Name="Order" HorizontalAlignment="Left" Height="20" Margin="85,280,0,0" TextWrapping="Wrap" Text="0001" VerticalAlignment="Top" Width="125"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="10,310,0,0" TextWrapping="Wrap" Text="常用重量" VerticalAlignment="Top" Width="75" FontSize="14"/>
<TextBox x:Name="Weight" HorizontalAlignment="Left" Height="20" Margin="85,310,0,0" TextWrapping="Wrap" Text="0000" VerticalAlignment="Top" Width="125"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="10,340,0,0" TextWrapping="Wrap" Text="常用浴比" VerticalAlignment="Top" Width="75" FontSize="14"/>
<TextBox x:Name="Proportion" HorizontalAlignment="Left" Height="20" Margin="85,340,0,0" TextWrapping="Wrap" Text="0000" VerticalAlignment="Top" Width="125"/>
</Grid>
</Window>
+96
View File
@@ -0,0 +1,96 @@
using System;
using System.IO;
using System.Windows;
namespace formula_manage.Windows
{
/// <summary>
/// APP_set.xaml 的交互逻辑
/// </summary>
public partial class APP_set : Window
{
public APP_set()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
this.Closing += Window_Closing; //添加窗口关闭事件
}
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini";
string logpath = System.Environment.CurrentDirectory + "\\Log";//日志文件目录
string logPath = "" + System.Environment.CurrentDirectory + "\\Log\\Log.txt";//日志文件
string Log_time = "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]:";
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
{
MessageBoxResult result = System.Windows.MessageBox.Show("设置完成后请重启程序", "提示", MessageBoxButton.OKCancel, MessageBoxImage.None, MessageBoxResult.Cancel);
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
Configini.IniWritevalue("SOFTWARE_SET", " L1", Loginlink.ToString());
Configini.IniWritevalue("SOFTWARE_SET", " L2", Loginprint.ToString());
Configini.IniWritevalue("SOFTWARE_SET", " L3", Loginanew.ToString());
Configini.IniWritevalue("SOFTWARE_SET", " L4", LoginMAC.ToString());
Configini.IniWritevalue("SOFTWARE_SET", " L5", Login_Gkg.Text);
Configini.IniWritevalue("SOFTWARE_SET", " L6", EXlink.ToString());
Configini.IniWritevalue("SOFTWARE_SET", " T1", Prepose.Text);
Configini.IniWritevalue("SOFTWARE_SET", " T2", TimeFormat.Text);
Configini.IniWritevalue("SOFTWARE_SET", " T3", Order.Text);
Configini.IniWritevalue("SOFTWARE_SET", " T4", Weight.Text);
Configini.IniWritevalue("SOFTWARE_SET", " T5", Proportion.Text);
System.IO.DirectoryInfo log = new System.IO.DirectoryInfo(@logpath);//生成日志文件目录
FileStream fs = new FileStream(logPath, FileMode.Append, FileAccess.Write);
StreamWriter wr = new StreamWriter(fs);//创建文件
wr.WriteLine(Log_time + "FORMULA_SET:INIFile_Write");
wr.Close();
}
bool Loginlink;
bool Loginprint;
bool Loginanew;
bool LoginMAC;
bool EXlink;
private void Window_SET(object sender, RoutedEventArgs e)
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
Login_LINK.IsChecked = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L1")); //连接状态显示是否生效
Login_PRINT.IsChecked = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L2")); //是否立即打印料单
Login_anew.IsChecked = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L3")); //是否立即打印料单
Login_MACHINE.IsChecked = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L4")); //允许自定义机台
EXLINK.IsChecked = Boolean.Parse(Configini.IniReadvalue("SOFTWARE_SET", "L6")); //ex
Login_Gkg.Text = Configini.IniReadvalue("SOFTWARE_SET", "L5"); //单位识别
Prepose.Text = Configini.IniReadvalue("SOFTWARE_SET", "T1"); //自定义料单前缀
TimeFormat.Text = Configini.IniReadvalue("SOFTWARE_SET", "T2"); //自定义料单时间格式
Order.Text = Configini.IniReadvalue("SOFTWARE_SET", "T3"); //自定义料单排序
Weight.Text = Configini.IniReadvalue("SOFTWARE_SET", "T4"); //自定义
Proportion.Text = Configini.IniReadvalue("SOFTWARE_SET", "T5"); //自定义
}
private void Login_LINK_Checked(object sender, RoutedEventArgs e)
{
Loginlink = Login_LINK.IsChecked.GetValueOrDefault(); //显示是否生效
}
private void Login_ex_Checked(object sender, RoutedEventArgs e)
{
EXlink = EXLINK.IsChecked.GetValueOrDefault(); //是否
}
private void Login_MAC_Checked(object sender, RoutedEventArgs e)
{
LoginMAC = Login_MACHINE.IsChecked.GetValueOrDefault(); //是否
}
private void Login_PRINT_Checked(object sender, RoutedEventArgs e)
{
Loginprint = Login_PRINT.IsChecked.GetValueOrDefault(); //是否立即打印料单
}
private void Login_anew_Checked(object sender, RoutedEventArgs e)
{
Loginanew = Login_anew.IsChecked.GetValueOrDefault(); //是否
}
}
}
+18
View File
@@ -0,0 +1,18 @@
<Window x:Class="formula_manage.Windows.CDKEY"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.Windows"
mc:Ignorable="d" Loaded="Window_CDKEY" BorderBrush="White" Background="#FFEFEFEF"
Title="CDKEY" Height="140" Width="500" MaxHeight="140" MaxWidth="500" ResizeMode="NoResize">
<Grid>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,35,0,0" TextWrapping="Wrap" Text="CDKEY:" VerticalAlignment="Top" Width="70" FontSize="16"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,10,0,0" TextWrapping="Wrap" Text="SN:" VerticalAlignment="Top" Width="70" FontSize="16"/>
<TextBox x:Name="sn_id" HorizontalAlignment="Left" Height="20" Margin="90,10,0,0" VerticalAlignment="Top" Width="360" Background="#FFE6E6E6" IsReadOnly="True" IsTabStop="False" Focusable="False"/>
<TextBox x:Name="cdk" HorizontalAlignment="Left" Height="20" Margin="90,35,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="360"/>
<Button Content="OK" HorizontalAlignment="Right" Height="20" Margin="0,60,50,0" VerticalAlignment="Top" Width="85" Background="#FFE6E6E6" Click="Button_Click_2"/>
<TextBox x:Name="sn_time" HorizontalAlignment="Left" Height="20" Margin="90,60,0,0" VerticalAlignment="Top" Width="250" Background="{x:Null}" IsReadOnly="True" IsTabStop="False" Focusable="False" BorderBrush="{x:Null}"/>
</Grid>
</Window>
+148
View File
@@ -0,0 +1,148 @@
using formula_manage.UserClass;
using System;
using System.Windows;
namespace formula_manage.Windows
{
/// <summary>
/// CDKEY.xaml 的交互逻辑
/// </summary>
public partial class CDKEY : Window
{
public CDKEY()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
}
string cpuSerialNumber;
string biosSerialNumber;
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini";
private void Window_CDKEY(object sender, RoutedEventArgs e) //打开页面
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
string cdk = Configini.IniReadvalue("SN", "SN1"); //读配置文件
if (cdk.Length == 16)
{
if (CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(cdk.Substring(0, 12)), true) == cdk.Substring(12, 4)) //校验key的crc校验值
{
try
{
string Y = (2255 - StrToInt.To16Convert10(cdk.Substring(6, 2))).ToString();
string M = (255 - StrToInt.To16Convert10(cdk.Substring(8, 2))).ToString();
string D = (255 - StrToInt.To16Convert10(cdk.Substring(10, 2))).ToString();
sn_time.Text = "注册有效时间: " + Y + "-" + M + "-" + D;
}
catch (Exception)
{
sn_time.Text = "注册有效时间: --------";
}
}
else
{
sn_time.Text = "注册有效时间: --------";
}
}
else
{
sn_time.Text = "注册有效时间: --------";
}
// 获取CPU序列号
cpuSerialNumber = HardwareSN.GetCPUSerialNumber();
// 获取主板序列号
biosSerialNumber = HardwareSN.GetBIOSSerialNumber();
// 获取硬盘序列号
//string hardDiskSerialNumber = HardwareSN.GetHardDiskSerialNumber();
// 获取网卡地址
//string netCardMACAddress = HardwareSN.GetNetCardMACAddress();
sn_id.Text = MD5check.MD5Encrypt16(cpuSerialNumber + biosSerialNumber);//生成id基于硬件值的md5校验
}
private void Button_Click_2(object sender, RoutedEventArgs e) //cdk确认按钮
{
string id_1;
id_1 = sn_id.Text.Substring(5, 1) + sn_id.Text.Substring(0, 1) + sn_id.Text.Substring(4, 1) + sn_id.Text.Substring(1, 1) + sn_id.Text.Substring(3, 1) + sn_id.Text.Substring(2, 1);
if (cdk.Text.Length != 16)
{
System.Windows.MessageBox.Show("CDKEY: 无效注册码", "ERR", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
if (id_1 == cdk.Text.Substring(0, 6))
{
if (CRCcheck16.ToCRC16(CRCcheck16.StringToHexByte(cdk.Text.Substring(0, 12)), true) == cdk.Text.Substring(12, 4)) //校验key的crc校验值
{
string Y = (2255 - StrToInt.To16Convert10(cdk.Text.Substring(6, 2))).ToString();
string M = (255 - StrToInt.To16Convert10(cdk.Text.Substring(8, 2))).ToString();
string D = (255 - StrToInt.To16Convert10(cdk.Text.Substring(10, 2))).ToString();
string YY = DateTime.Now.ToString("yyyy");
string MM = DateTime.Now.ToString("MM");
string DD = DateTime.Now.ToString("dd");
if (string.Compare(Y, YY) == 0)
{
if (string.Compare(M, MM) == 0)
{
if (string.Compare(D, DD) >= 0)
{
System.Windows.MessageBox.Show("CDKEY: 注册成功,请重启软件", "KEY", MessageBoxButton.OK, MessageBoxImage.Asterisk);
sn_time.Text = "注册有效时间: " + Y + "-" + M + "-" + D;
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
Configini.IniWritevalue("SN", " SN1", cdk.Text);
Configini.IniWritevalue("SN", " SN2", MD5check.MD5Encrypt16(cpuSerialNumber + biosSerialNumber));
}
else if (string.Compare(M, MM) > 0)
{
System.Windows.MessageBox.Show("CDKEY: 注册成功,请重启软件", "KEY", MessageBoxButton.OK, MessageBoxImage.Asterisk);
sn_time.Text = "注册有效时间: " + Y + "-" + M + "-" + D;
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
Configini.IniWritevalue("SN", " SN1", cdk.Text);
Configini.IniWritevalue("SN", " SN2", MD5check.MD5Encrypt16(cpuSerialNumber + biosSerialNumber));
}
else
{
System.Windows.MessageBox.Show("CDKEY: 注册码过期", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
else
{
System.Windows.MessageBox.Show("CDKEY: 注册码过期", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
else if (string.Compare(Y, YY) > 0)
{
System.Windows.MessageBox.Show("CDKEY: 注册成功,请重启软件", "KEY", MessageBoxButton.OK, MessageBoxImage.Asterisk);
sn_time.Text = "注册有效时间: " + Y + "-" + M + "-" + D;
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
Configini.IniWritevalue("SN", " SN1", cdk.Text);
Configini.IniWritevalue("SN", " SN2", MD5check.MD5Encrypt16(cpuSerialNumber + biosSerialNumber));
}
else
{
System.Windows.MessageBox.Show("CDKEY: 注册码过期", "WARNING", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
else
{
System.Windows.MessageBox.Show("CDKEY: 无效注册码", "ERR", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
else
{
System.Windows.MessageBox.Show("CDKEY: 无效注册码", "ERR", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}
}
+131
View File
@@ -0,0 +1,131 @@
<Window x:Class="formula_manage.Windows.Dissolve"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.Windows"
xmlns:ConvertMoels="clr-namespace:formula_manage.ConvertMoels"
xmlns:viewmodel="clr-namespace:formula_manage.ViewModel"
mc:Ignorable="d" Loaded="Dissolve_Loaded"
Title="Dissolve_SET" Height="720" Width="1100" MaxHeight="720" MaxWidth="1100" MinHeight="720" MinWidth="1100"
BorderBrush="White" Background="#FFE0E0E0">
<Window.Resources>
<!--引入转换器-->
<ConvertMoels:IonSQLConvert x:Key="IonSQLConvert"/>
</Window.Resources>
<Grid>
<!--设备表-->
<DataGrid x:Name="DatagridDissolve" MouseDoubleClick="Dissolve_MouseDoubleClick" SelectionMode="Single" AlternationCount="2" IsReadOnly="True"
Margin="15,15,15,150" d:ItemsSource="{d:SampleData ItemCount=999}" AutoGenerateColumns="False" MinColumnWidth="30"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2"
CanUserResizeRows="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
CanUserResizeColumns="False" CanUserSortColumns="False" HeadersVisibility ="Column">
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF0F0F0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="#000000"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTemplateColumn Header=" 序号" Width="50" MinWidth="10" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock FontSize="15" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="溶解流程代码" Binding="{Binding DissolveCode}" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="溶解流程名称" Binding="{Binding DissolveName}" Width="130" FontSize="15" MaxWidth="130" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="用途" Width="130" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False">
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Text" Value="{Binding MaterialType, Converter={StaticResource IonSQLConvert}}"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="最小量(g)" Binding="{Binding WeightMIN}" Width="130" FontSize="15" MaxWidth="130" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="最大量(g)" Binding="{Binding WeightMAX}" Width="130" FontSize="15" MaxWidth="130" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="备注" Binding="{Binding REMARK}" Width="600" FontSize="15" CanUserReorder="False"/>
</DataGrid.Columns>
</DataGrid>
<!--代码-->
<TextBox x:Name="Code" HorizontalAlignment="Left" Height="30" Margin="65,0,0,100" Text=""
VerticalAlignment="Bottom" Width="120" FontSize="22" MaxLines="1" MaxLength="25"
InputMethod.IsInputMethodEnabled="False"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,100" TextWrapping="Wrap" Text="代码"
VerticalAlignment="Bottom" Width="40" FontSize="20"/>
<!--名称-->
<TextBox x:Name="name" HorizontalAlignment="Left" Height="30" Margin="255,0,0,100" Text=""
VerticalAlignment="Bottom" Width="120" FontSize="22" MaxLines="1" MaxLength="25"
InputMethod.IsInputMethodEnabled="False"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="205,0,0,100" TextWrapping="Wrap" Text="名称"
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
<!--最小-->
<TextBox x:Name="min" HorizontalAlignment="Left" Height="30" Margin="460,0,0,100" Text=""
VerticalAlignment="Bottom" Width="100" FontSize="22" MaxLines="1" MaxLength="25"
InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Tb_KeyFloating"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="390,0,0,100" TextWrapping="Wrap" Text="最小(g)"
VerticalAlignment="Bottom" Width="80" FontSize="20"/>
<!--最大-->
<TextBox x:Name="max" HorizontalAlignment="Left" Height="30" Margin="640,0,0,100" Text=""
VerticalAlignment="Bottom" Width="100" FontSize="22" MaxLines="1" MaxLength="25"
InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Tb_KeyFloating"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="565,0,0,100" TextWrapping="Wrap" Text="最大(g)"
VerticalAlignment="Bottom" Width="80" FontSize="20"/>
<!--离子类型-->
<ComboBox x:Name="ion" HorizontalAlignment="Left" Height="30" Margin="65,0,0,50" Text=""
VerticalAlignment="Bottom" Width="120" FontSize="20" IsReadOnly="True" IsEditable="True">
<ComboBoxItem Content="分散"></ComboBoxItem>
<ComboBoxItem Content="酸性"></ComboBoxItem>
<ComboBoxItem Content="活性"></ComboBoxItem>
<ComboBoxItem Content="中性"></ComboBoxItem>
<ComboBoxItem Content="硫化"></ComboBoxItem>
<ComboBoxItem Content="阳离子"></ComboBoxItem>
<ComboBoxItem Content="阴离子"></ComboBoxItem>
<ComboBoxItem Content="非离子"></ComboBoxItem>
<ComboBoxItem Content="酞菁"></ComboBoxItem>
<ComboBoxItem Content="直接"></ComboBoxItem>
</ComboBox>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,50" TextWrapping="Wrap" Text="用途"
VerticalAlignment="Bottom" Width="50" FontSize="20"/>
<!--备注-->
<TextBox x:Name="Remark" HorizontalAlignment="Left" Height="30" Margin="255,0,0,50"
VerticalAlignment="Bottom" Width="305" FontSize="22" MaxLines="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="205,0,0,50" TextWrapping="Wrap" Text="备注"
VerticalAlignment="Bottom" Width="40" FontSize="20"/>
<!--存储按钮-->
<Button Content="存储" HorizontalAlignment="Left" Height="50" Margin="795,0,0,60"
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
Click="Button_Preservation">
</Button>
<!--删除按钮-->
<Button Content="删除" HorizontalAlignment="Left" Height="50" Margin="935,0,0,60"
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
Click="Button_Delete">
</Button>
</Grid>
</Window>
+235
View File
@@ -0,0 +1,235 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace formula_manage.Windows
{
/// <summary>
/// Machine.xaml 的交互逻辑
/// </summary>
public partial class Dissolve : Window
{
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
string TEXT_SQLIP;
string TEXT_SQLNAME;
string TEXT_SQMOD;
string TEXT_SQLUSER;
string TEXT_SQLPASWOR;
string Connstr_SC;
public Dissolve()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
}
private void Dissolve_Loaded(object sender, RoutedEventArgs e)//打开页面执行
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
this.DatagridDissolve.LoadingRow += new EventHandler<DataGridRowEventArgs>(this.DataGridEquipment_LoadingRow);//生成序列号
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
if (TEXT_SQMOD == "0") //判断连接方式
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
}
GridSql();
}
/// <summary>
/// 生成序列号的方法
/// </summary>
private void DataGridEquipment_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}
/// <summary>
/// 查询数据库的方法
/// </summary>
private async void GridSql()
{
string Dissolve_sql = "SELECT DissolveCode ,DissolveName ,REMARK ,MaterialType ,WeightMIN ,WeightMAX FROM [dbo].[Dissolve]";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(Dissolve_sql, Connstr_SC); //查询
DataTable dataTable = new DataTable(); //建立缓存
Stuff_data.Fill(dataTable); //查询结果存入缓存
conn_SC.Close(); //关闭连接
DatagridDissolve.ItemsSource = dataTable.DefaultView; //数据加入表格
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败,检查连接");
return;
}
}
private void Dissolve_MouseDoubleClick(object sender, MouseButtonEventArgs e)//数据表双击事件
{
int rownum = DatagridDissolve.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)//判断鼠标定位是否有效
{
/*定位选中行及指定列单元格文本信息*/
Code.Text = (DatagridDissolve.Columns[1].GetCellContent(DatagridDissolve.Items[rownum]) as TextBlock).Text.TrimEnd();//定位第列
name.Text = (DatagridDissolve.Columns[2].GetCellContent(DatagridDissolve.Items[rownum]) as TextBlock).Text.TrimEnd();//
ion.Text = (DatagridDissolve.Columns[3].GetCellContent(DatagridDissolve.Items[rownum]) as TextBlock).Text.TrimEnd();//
min.Text = (DatagridDissolve.Columns[4].GetCellContent(DatagridDissolve.Items[rownum]) as TextBlock).Text.TrimEnd();//
max.Text = (DatagridDissolve.Columns[5].GetCellContent(DatagridDissolve.Items[rownum]) as TextBlock).Text.TrimEnd();//
Remark.Text = (DatagridDissolve.Columns[6].GetCellContent(DatagridDissolve.Items[rownum]) as TextBlock).Text.TrimEnd();//
}
}
private void Tb_KeyFloating(object sender, TextCompositionEventArgs e)//输入事件
{
//Regex re = new Regex("[^0-9.-]+");
Regex re = new Regex(@"^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$");// 非负浮点数
e.Handled = !re.IsMatch(e.Text);
}
private async void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
{
Regex re_number = new Regex(@"^[0-9]+(.[0-9]{1,2})?$");//校验用正则表达式有1~2位小数的正实数
Regex re_char = new Regex(@"^[A-Za-z0-9\s@()()/+!!_-]+$");//校验用正则表达式由数字,26个英文字母,空白字符和@()()/+!!_-组成的字符串
string Dissolve_sql;
int int_ion = 0;
if ((name.Text == "") || (Code.Text == ""))
{
System.Windows.MessageBox.Show("请输入代码或名称");
return;
}
if ((min.Text == "") || (max.Text == ""))
{
System.Windows.MessageBox.Show("请确认最用量");
return;
}
else if (int.Parse(min.Text) > int.Parse(max.Text))
{
System.Windows.MessageBox.Show("用量错误");
return;
}
if (ion.Text == "")
{
System.Windows.MessageBox.Show("请确认用途");
return;
}
else if (ion.Text == "分散") int_ion = 0;
else if (ion.Text == "酸性") int_ion = 1;
else if (ion.Text == "活性") int_ion = 2;
else if (ion.Text == "中性") int_ion = 3;
else if (ion.Text == "硫化") int_ion = 4;
else if (ion.Text == "阳离子") int_ion = 5;
else if (ion.Text == "阴离子") int_ion = 6;
else if (ion.Text == "非离子") int_ion = 7;
else if (ion.Text == "酞菁") int_ion = 8;
else if (ion.Text == "直接") int_ion = 9;
if (Code.Text != null)
{
try
{
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
Dissolve_sql = "SELECT count(*) FROM [dbo].[Dissolve] WHERE DissolveCode = '" + Code.Text + " '";//查询语句
await conn_SC.OpenAsync(); //打开数据连
SqlCommand cmd = new SqlCommand(Dissolve_sql, conn_SC); //查询记录数
int count = Convert.ToInt32(cmd.ExecuteScalar()); //显示记录数
conn_SC.Close(); //关闭连接
if (count == 0)
{
Dissolve_sql = string.Format("INSERT INTO[dbo].[Dissolve](DissolveCode ,DissolveName ,REMARK ,MaterialType ,WeightMIN ,WeightMAX) " +
"VALUES ('" + Code.Text + "','" + name.Text + "','" + Remark.Text + "','" + int_ion + "','" + min.Text + "','" + max.Text + "')");
await conn_SC.OpenAsync(); //打开数据连接
SqlCommand INSERT_cmd = new SqlCommand(Dissolve_sql, conn_SC);
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
conn_SC.Close(); //关闭连接
if (sql_in == 0)
{
System.Windows.MessageBox.Show("添加失败");
}
else
{
GridSql();
System.Windows.MessageBox.Show("添加完成");//
}
}
else
{
Dissolve_sql = string.Format("UPDATE [dbo].[Dissolve] SET DissolveName ='" + name.Text + "',REMARK='" + Remark.Text + "',MaterialType='" + int_ion + "',WeightMIN='" + min.Text + "',WeightMAX='" + max.Text + "' Where DissolveCode ='" + Code.Text + "'");
await conn_SC.OpenAsync(); //打开数据连接
SqlCommand INSERT_cmd = new SqlCommand(Dissolve_sql, conn_SC);
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
conn_SC.Close(); //关闭连接
if (sql_in == 0)
{
System.Windows.MessageBox.Show("修改失败");
}
else
{
GridSql();
System.Windows.MessageBox.Show("修改完成");//
}
}
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求失败,检查连接");
return;
}
}
}
private async void Button_Delete(object sender, RoutedEventArgs e)//删除按钮事件
{
string Mac_name = "是否删除【" + this.Code.Text + "】";//获取信息并拼接提示字符串
MessageBoxResult mac_name = System.Windows.MessageBox.Show(Mac_name, "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes);//弹窗提示是否删除目标
if (mac_name == MessageBoxResult.Yes)//判断是否删除原料
{
string Stuff_sql = string.Format("DELETE FROM [dbo].[Dissolve] WHERE Name ='" + Code.Text.ToString() + "'");
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC);
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
conn_SC.Close(); //关闭连接
if (sql_in == 0)
{
System.Windows.MessageBox.Show("ERR.C0110-2:删除失败", "错误");//判断执行是否成功
}
else
{
GridSql();
}
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求失败,检查连接");
return;
}
}
}
}
}
+145
View File
@@ -0,0 +1,145 @@
<Window x:Class="formula_manage.Windows.Machine"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.Windows"
xmlns:ConvertMoels="clr-namespace:formula_manage.ConvertMoels"
xmlns:viewmodel="clr-namespace:formula_manage.ViewModel"
mc:Ignorable="d" Loaded="MAC_Loaded"
Title="MAC_SET" Height="720" Width="1100" MaxHeight="720" MaxWidth="1100" MinHeight="720" MinWidth="1100"
BorderBrush="White" Background="#FFE0E0E0">
<Window.Resources>
<!--引入转换器-->
<ConvertMoels:CategoriesSQLConvert x:Key="CategoriesSQLConvert"/>
<ConvertMoels:IndustrySQLConvert x:Key="IndustrySQLConvert"/>
</Window.Resources>
<Grid>
<!--设备表-->
<DataGrid x:Name="DataGridMac" MouseDoubleClick="DataGridMac_MouseDoubleClick" SelectionMode="Single" AlternationCount="2" IsReadOnly="True"
Margin="15,15,15,150" d:ItemsSource="{d:SampleData ItemCount=999}" AutoGenerateColumns="False" MinColumnWidth="30"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2"
CanUserResizeRows="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
CanUserResizeColumns="False" CanUserSortColumns="False" HeadersVisibility ="Column">
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF0F0F0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="#000000"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTemplateColumn Header=" 序号" Width="50" MinWidth="10" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock FontSize="15" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="机台名称" Binding="{Binding Name}" Width="130" FontSize="15" MaxWidth="130" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="机组" Binding="{Binding MacGroup}" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="载量(KG)" Binding="{Binding Capacity}" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="容量(L)" Binding="{Binding Volume}" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="染色方式" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False">
<!--事件名称:方式类型数字转文字显示,转换器IndustrySQLConvert-->
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Text" Value="{Binding Industry, Converter={StaticResource IndustrySQLConvert}}"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="类型" Width="100" FontSize="15" MaxWidth="100" MinWidth="100" CanUserReorder="False">
<!--事件名称:类型类型数字转文字显示,转换器IndustrySQLConvert-->
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Text" Value="{Binding Categories, Converter={StaticResource CategoriesSQLConvert}}"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="备注" Binding="{Binding Note}" Width="600" FontSize="15" MinWidth="100" CanUserReorder="False"/>
</DataGrid.Columns>
</DataGrid>
<!--机台名-->
<TextBox x:Name="mac_Name" HorizontalAlignment="Left" Height="30" Margin="105,0,0,100" Text=""
VerticalAlignment="Bottom" Width="100" FontSize="22" MaxLines="1" MaxLength="50" />
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,100" TextWrapping="Wrap" Text="机台名称"
VerticalAlignment="Bottom" Width="85" FontSize="20"/>
<!--机组-->
<TextBox x:Name="mac_MacGroup" HorizontalAlignment="Left" Height="30" Margin="275,0,0,100" Text=""
VerticalAlignment="Bottom" Width="100" FontSize="22" MaxLines="1" MaxLength="50"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="225,0,0,100" TextWrapping="Wrap" Text="机组"
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
<!--染色方式-->
<ComboBox x:Name="mac_Industry" HorizontalAlignment="Left" Height="30" Margin="435,0,0,100" Text=""
VerticalAlignment="Bottom" Width="100" FontSize="20" IsReadOnly="True" IsEditable="True">
<ComboBoxItem Content="浸染"></ComboBoxItem>
<ComboBoxItem Content="连染"></ComboBoxItem>
<ComboBoxItem Content="印染"></ComboBoxItem>
</ComboBox>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="390,0,0,100" TextWrapping="Wrap" Text="方式"
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
<!--类型-->
<ComboBox x:Name="mac_Categories" HorizontalAlignment="Left" Height="30" Margin="600,0,0,100" Text=""
VerticalAlignment="Bottom" Width="100" FontSize="20" IsReadOnly="True" IsEditable="True">
<ComboBoxItem Content="溢流"></ComboBoxItem>
<ComboBoxItem Content="气流"></ComboBoxItem>
<ComboBoxItem Content="轧染"></ComboBoxItem>
<ComboBoxItem Content="卷染"></ComboBoxItem>
<ComboBoxItem Content="喷染"></ComboBoxItem>
<ComboBoxItem Content="筒纱"></ComboBoxItem>
<ComboBoxItem Content="成衣"></ComboBoxItem>
</ComboBox>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="550,0,0,100" TextWrapping="Wrap" Text="类型"
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
<!--载量-->
<TextBox x:Name="mac_Capacity" HorizontalAlignment="Left" Height="30" Margin="105,0,0,50" Text=""
VerticalAlignment="Bottom" Width="100" FontSize="22" MaxLines="1" MaxLength="25"
InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Tb_KeyFloating"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,50" TextWrapping="Wrap" Text="载量"
VerticalAlignment="Bottom" Width="80" FontSize="20"/>
<!--容量-->
<TextBox x:Name="mac_Volume" HorizontalAlignment="Left" Height="30" Margin="275,0,0,50" Text=""
VerticalAlignment="Bottom" Width="100" FontSize="22" MaxLines="1" MaxLength="25"
InputMethod.IsInputMethodEnabled="False" PreviewTextInput="Tb_KeyFloating"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="225,0,0,50" TextWrapping="Wrap" Text="容量"
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
<!--备注-->
<TextBox x:Name="mac_Note" HorizontalAlignment="Left" Height="30" Margin="435,0,0,50"
VerticalAlignment="Bottom" Width="265" FontSize="22" MaxLines="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="390,0,0,50" TextWrapping="Wrap" Text="备注"
VerticalAlignment="Bottom" Width="40" FontSize="20"/>
<!--存储按钮-->
<Button Content="存储" HorizontalAlignment="Left" Height="50" Margin="795,0,0,60"
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
Click="Button_Preservation">
</Button>
<!--删除按钮-->
<Button Content="删除" HorizontalAlignment="Left" Height="50" Margin="935,0,0,60"
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
Click="Button_Delete">
</Button>
</Grid>
</Window>
+246
View File
@@ -0,0 +1,246 @@
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace formula_manage.Windows
{
/// <summary>
/// Machine.xaml 的交互逻辑
/// </summary>
public partial class Machine : Window
{
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
string TEXT_SQLIP;
string TEXT_SQLNAME;
string TEXT_SQMOD;
string TEXT_SQLUSER;
string TEXT_SQLPASWOR;
string Connstr_SC;
public Machine()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
}
private async void MAC_Loaded(object sender, RoutedEventArgs e)//打开页面执行
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
this.DataGridMac.LoadingRow += new EventHandler<DataGridRowEventArgs>(this.DataGridEquipment_LoadingRow);//生成序列号
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
if (TEXT_SQMOD == "0") //判断连接方式
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
}
string MAC_sql = "SELECT Name ,MacGroup ,Capacity ,Volume ,Industry ,Categories ,Note FROM [dbo].[MACHINE]";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(MAC_sql, Connstr_SC); //查询
DataTable dataTable = new DataTable(); //建立缓存
Stuff_data.Fill(dataTable); //查询结果存入缓存
conn_SC.Close(); //关闭连接
DataGridMac.ItemsSource = dataTable.DefaultView; //数据加入表格
DataGridMac.DisplayMemberPath = "Name";
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败,检查连接");
return;
}
}
/// <summary>
/// 生成序列号的方法
/// </summary>
private void DataGridEquipment_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}
/// <summary>
/// 查询数据库的方法
/// </summary>
private async void GridSql()
{
string MAC_sql = "SELECT Name ,MacGroup ,Capacity ,Volume ,Industry ,Categories ,Note FROM [dbo].[MACHINE]";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(MAC_sql, Connstr_SC); //查询
DataTable dataTable = new DataTable(); //建立缓存
Stuff_data.Fill(dataTable); //查询结果存入缓存
conn_SC.Close(); //关闭连接
DataGridMac.ItemsSource = dataTable.DefaultView; //数据加入表格
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败,检查连接");
return;
}
}
private void Tb_KeyFloating(object sender, TextCompositionEventArgs e)//输入事件
{
//Regex re = new Regex("[^0-9.-]+");
Regex re = new Regex(@"^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$");// 非负浮点数
e.Handled = !re.IsMatch(e.Text);
}
private void DataGridMac_MouseDoubleClick(object sender, MouseButtonEventArgs e)//数据表双击事件
{
int rownum = DataGridMac.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)//判断鼠标定位是否有效
{
/*定位选中行及指定列单元格文本信息*/
mac_Name.Text = (DataGridMac.Columns[1].GetCellContent(DataGridMac.Items[rownum]) as TextBlock).Text.TrimEnd();//定位第列
mac_MacGroup.Text = (DataGridMac.Columns[2].GetCellContent(DataGridMac.Items[rownum]) as TextBlock).Text.TrimEnd();//
mac_Capacity.Text = (DataGridMac.Columns[3].GetCellContent(DataGridMac.Items[rownum]) as TextBlock).Text.TrimEnd();//
mac_Volume.Text = (DataGridMac.Columns[4].GetCellContent(DataGridMac.Items[rownum]) as TextBlock).Text.TrimEnd();//
mac_Industry.Text = (DataGridMac.Columns[5].GetCellContent(DataGridMac.Items[rownum]) as TextBlock).Text.TrimEnd();//
mac_Categories.Text = (DataGridMac.Columns[6].GetCellContent(DataGridMac.Items[rownum]) as TextBlock).Text.TrimEnd();//
mac_Note.Text = (DataGridMac.Columns[7].GetCellContent(DataGridMac.Items[rownum]) as TextBlock).Text.TrimEnd();//
}
}
private async void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
{
Regex re_number = new Regex(@"^[0-9]+(.[0-9]{1,2})?$");//校验用正则表达式有1~2位小数的正实数
Regex re_char = new Regex(@"^[A-Za-z0-9\s@()()/+!!_-]+$");//校验用正则表达式由数字,26个英文字母,空白字符和@()()/+!!_-组成的字符串
string Mac_name = mac_Name.Text;
string Mac_group = mac_MacGroup.Text;
string Mac_capacity = mac_Capacity.Text;
string Mac_volume = mac_Volume.Text;
string Mac_industry = mac_Industry.Text;
string Mac_categories = mac_Categories.Text;
string Mac_note = mac_Note.Text;
string MAC_sql;
if (Mac_industry == "浸染") Mac_industry = "0";
else if (Mac_industry == "连染") Mac_industry = "1";
else if (Mac_industry == "印染") Mac_industry = "2";
if (Mac_categories == "溢流") Mac_categories = "0";
else if (Mac_categories == "气流") Mac_categories = "1";
else if (Mac_categories == "轧染") Mac_categories = "2";
else if (Mac_categories == "卷染") Mac_categories = "3";
else if (Mac_categories == "喷染") Mac_categories = "4";
else if (Mac_categories == "筒纱") Mac_categories = "5";
else if (Mac_categories == "成衣") Mac_categories = "6";
if (Mac_capacity == "") Mac_capacity = "NULL";
if (Mac_volume == "") Mac_volume = "NULL";
if (Mac_industry == "") Mac_industry = "NULL";
if (Mac_categories == "") Mac_categories = "NULL";
if (mac_Name.Text != null)
{
try
{
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
MAC_sql = "SELECT count(*) FROM [dbo].[MACHINE] WHERE Name = '" + Mac_name + " '";//查询语句
await conn_SC.OpenAsync(); //打开数据连
SqlCommand cmd = new SqlCommand(MAC_sql, conn_SC); //查询记录数
int count = Convert.ToInt32(cmd.ExecuteScalar()); //显示记录数
conn_SC.Close(); //关闭连接
if (count == 0)
{
MAC_sql = string.Format("INSERT INTO [dbo].[MACHINE](Name ,MacGroup ,Capacity ,Volume ,Industry ,Categories ,Note ) " +
"VALUES ('" + Mac_name + "','" + Mac_group + "'," + Mac_capacity + "," + Mac_volume + "," + Mac_industry + "," + Mac_categories + ",'" + Mac_note + "')");
await conn_SC.OpenAsync(); //打开数据连接
SqlCommand INSERT_cmd = new SqlCommand(MAC_sql, conn_SC);
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
conn_SC.Close(); //关闭连接
if (sql_in == 0)
{
System.Windows.MessageBox.Show("添加失败");
}
else
{
GridSql();
System.Windows.MessageBox.Show("添加完成");//
}
}
else
{
MAC_sql = string.Format("UPDATE [dbo].[MACHINE] SET MacGroup ='" + Mac_group + "',Capacity=" + Mac_capacity + " ,Volume=" + Mac_volume + " ,Industry=" + Mac_industry + " ,Categories=" + Mac_categories + " ,Note='" + Mac_note + "' Where Name ='" + Mac_name + "'");
await conn_SC.OpenAsync(); //打开数据连接
SqlCommand INSERT_cmd = new SqlCommand(MAC_sql, conn_SC);
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
conn_SC.Close(); //关闭连接
if (sql_in == 0)
{
System.Windows.MessageBox.Show("修改失败");
}
else
{
GridSql();
System.Windows.MessageBox.Show("修改完成");//
}
}
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求失败,检查连接");
return;
}
}
}
private async void Button_Delete(object sender, RoutedEventArgs e)//删除按钮事件
{
string Mac_name = "是否删除【" + this.mac_Name.Text + "】";//获取原料信息并拼接提示字符串
MessageBoxResult mac_name = System.Windows.MessageBox.Show(Mac_name, "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes);//弹窗提示是否删除目标原料
if (mac_name == MessageBoxResult.Yes)//判断是否删除原料
{
string Stuff_sql = string.Format("DELETE FROM [dbo].[MACHINE] WHERE Name ='" + mac_Name.Text.ToString() + "'");
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC);
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
conn_SC.Close(); //关闭连接
if (sql_in == 0)
{
System.Windows.MessageBox.Show("ERR.C0110-2:删除失败", "错误");//判断执行是否成功
}
else
{
GridSql();
}
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求失败,检查连接");
return;
}
}
}
}
}
+47
View File
@@ -0,0 +1,47 @@
<Window x:Class="formula_manage.Windows.Print"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.Windows"
mc:Ignorable="d" Loaded="Window_Print"
Title="打印设置" Height="400" Width="500" MaxWidth="500">
<Grid>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,35,0,0" TextWrapping="Wrap" Text="模板路径:" VerticalAlignment="Top" Width="70" FontSize="16"/>
<TextBox x:Name="Print_path" HorizontalAlignment="Left" Height="20" Margin="90,35,0,0" VerticalAlignment="Top" Width="285" MaxLines="1" IsReadOnly="True"/>
<Button Content="浏览路径" HorizontalAlignment="Left" Height="20" Margin="375,35,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click"/>
<TextBlock HorizontalAlignment="Left" Height="15" Margin="20,65,0,0" TextWrapping="Wrap" Text="默认打印模板:" VerticalAlignment="Top" Width="90"/>
<ComboBox HorizontalAlignment="Left" Height="20" Margin="110,65,0,0" VerticalAlignment="Top" Width="180" x:Name="Template_M"/>
<CheckBox HorizontalAlignment="Left" Height="15" Margin="20,95,0,0" Content="默认打印机:" VerticalAlignment="Top" Width="90"
x:Name="TEXT_Print" Checked="Print_Checked" Unchecked="Print_Checked"/>
<ComboBox HorizontalAlignment="Left" Height="20" Margin="110,90,0,0" VerticalAlignment="Top" Width="180"
x:Name="cbxPrinter" SelectedValuePath="Element[OPTIONCODE].Value" DisplayMemberPath="Element[OPTIONNAME].Value"/>
<Button Content="预览模板" HorizontalAlignment="Left" Height="20" Margin="375,65,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click_2"/>
<Button Content="编辑模板" HorizontalAlignment="Left" Height="20" Margin="295,65,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click_1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="20,145,0,0" TextWrapping="Wrap" Text="发布至其它目标打印机" VerticalAlignment="Top" Width="200" FontSize="20"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,175,0,0" TextWrapping="Wrap" Text="模板路径:" VerticalAlignment="Top" Width="70" FontSize="16"/>
<TextBox x:Name="Print_path2" HorizontalAlignment="Left" Height="20" Margin="90,175,0,0" VerticalAlignment="Top" Width="285" MaxLines="1"/>
<Button Content="浏览路径" HorizontalAlignment="Left" Height="20" Margin="375,175,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click1"/>
<TextBlock HorizontalAlignment="Left" Height="15" Margin="20,205,0,0" TextWrapping="Wrap" Text="默认打印模板:" VerticalAlignment="Top" Width="90"/>
<ComboBox HorizontalAlignment="Left" Height="20" Margin="110,205,0,0" VerticalAlignment="Top" Width="180" x:Name="Template_S"/>
<CheckBox HorizontalAlignment="Left" Height="15" Margin="20,235,0,0" Content="同步推送:" VerticalAlignment="Top" Width="90"
x:Name="TEXT_Print2" Checked="Print_Checked2" Unchecked="Print_Checked2"/>
<ComboBox HorizontalAlignment="Left" Height="20" Margin="110,230,0,0" VerticalAlignment="Top" Width="180"
x:Name="cbxPrinter2" SelectedValuePath="Element[OPTIONCODE].Value" DisplayMemberPath="Element[OPTIONNAME].Value"/>
<CheckBox HorizontalAlignment="Left" Height="15" Margin="20,260,0,0" Content="同步推送:" VerticalAlignment="Top" Width="90"
x:Name="TEXT_Print3" Checked="Print_Checked3" Unchecked="Print_Checked3"/>
<ComboBox HorizontalAlignment="Left" Height="20" Margin="110,255,0,0" VerticalAlignment="Top" Width="180"
x:Name="cbxPrinter3" SelectedValuePath="Element[OPTIONCODE].Value" DisplayMemberPath="Element[OPTIONNAME].Value"/>
<Button Content="预览模板" HorizontalAlignment="Left" Height="20" Margin="375,205,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click_22"/>
<Button Content="编辑模板" HorizontalAlignment="Left" Height="20" Margin="295,205,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click_12"/>
<TextBlock HorizontalAlignment="Left" Height="15" Margin="20,305,0,0" TextWrapping="Wrap" Text="管理打印模板:" VerticalAlignment="Top" Width="90"/>
<ComboBox HorizontalAlignment="Left" Height="20" Margin="110,305,0,0" VerticalAlignment="Top" Width="180" x:Name="PrintTemplate" IsEditable="True"/>
<Button Content="删除模板" HorizontalAlignment="Left" Height="20" Margin="375,305,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click_4"/>
<Button Content="添加模板" HorizontalAlignment="Left" Height="20" Margin="295,305,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click_3"/>
<Grid Grid.Column="1" x:Name="Prompt" Margin="0,0,0,0" Background="White" Opacity="0.8" Visibility="Hidden">
<TextBlock Height="50" Margin="0,0,0,150" TextWrapping="Wrap" Text="Processing,Pleasewait..." Width="400" FontSize="34" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</Grid>
</Window>
+274
View File
@@ -0,0 +1,274 @@
using FastReport;
using formula_manage.UserClass;
using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.IO;
using System.Windows;
using System.Windows.Forms;
using System.Xml.Linq;
namespace formula_manage.Windows
{
/// <summary>
/// Print.xaml 的交互逻辑
/// </summary>
public partial class Print : Window
{
public Print()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
cbxPrinter.ItemsSource = this.GetLocalPrinters(); //打印机搜索
cbxPrinter2.ItemsSource = this.GetLocalPrinters();
cbxPrinter3.ItemsSource = this.GetLocalPrinters();
this.Closing += Window_Closing; //添加窗口关闭事件
}
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini";
string logpath = System.Environment.CurrentDirectory + "\\Log";//日志文件目录
string logPath = "" + System.Environment.CurrentDirectory + "\\Log\\Log.txt";//日志文件
string Log_time = "[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]:";
bool Printer;
bool Printer2;
bool Printer3;
string Temp_M, Temp_S;
private void Window_Print(object sender, RoutedEventArgs e)
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
Printer = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P1"));
cbxPrinter.SelectedValue = Configini.IniReadvalue("PRINTER", "P2"); //读配置文件
Print_path.Text = Configini.IniReadvalue("PRINTER", "P3");
Printer2 = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P4"));
Printer3 = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P5"));
cbxPrinter2.SelectedValue = Configini.IniReadvalue("PRINTER", "P8"); //读配置文件
cbxPrinter3.SelectedValue = Configini.IniReadvalue("PRINTER", "P9"); //读配置文件
Print_path2.Text = Configini.IniReadvalue("PRINTER", "P12");
Temp_M = Configini.IniReadvalue("PRINTER", "P13");
Temp_S = Configini.IniReadvalue("PRINTER", "P14");
TEXT_Print.IsChecked = Printer;
cbxPrinter.IsEnabled = Printer;
TEXT_Print2.IsChecked = Printer2;
cbxPrinter2.IsEnabled = Printer2;
TEXT_Print3.IsChecked = Printer3;
cbxPrinter3.IsEnabled = Printer3;
PRINT_file();
}
private void PRINT_file()//建立模板列表
{
DirectoryInfo di_M = new DirectoryInfo(Print_path.Text); //new文件夹
FileInfo[] files_M = di_M.GetFiles("*.frx");//生成文件夹中的文件名合集
Template_M.ItemsSource = files_M;//加载合集
Template_M.DisplayMemberPath = "Name"; // 显示文件名
DirectoryInfo di_S = new DirectoryInfo(Print_path2.Text);
FileInfo[] files_S = di_S.GetFiles("*.frx");
Template_S.ItemsSource = files_S;
Template_S.DisplayMemberPath = "Name";
Template_M.Text = Temp_M;//传入保存的默认模板
Template_S.Text = Temp_S;//
PrintTemplate.ItemsSource = files_M;
PrintTemplate.DisplayMemberPath = "Name";
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
{
MessageBoxResult result = System.Windows.MessageBox.Show("设置完成后请重启程序", "提示", MessageBoxButton.OKCancel, MessageBoxImage.None, MessageBoxResult.Cancel);
if (result == MessageBoxResult.Cancel) //判断是否确认
{
e.Cancel = true; // 中断点击事件
}
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
Configini.IniWritevalue("PRINTER", " P1", Printer.ToString());
Configini.IniWritevalue("PRINTER", " P2", cbxPrinter.SelectedValue.ToString());
Configini.IniWritevalue("PRINTER", " P3", Print_path.Text.ToString());
Configini.IniWritevalue("PRINTER", " P4", Printer2.ToString());
Configini.IniWritevalue("PRINTER", " P5", Printer3.ToString());
Configini.IniWritevalue("PRINTER", " P8", cbxPrinter2.SelectedValue.ToString());
Configini.IniWritevalue("PRINTER", " P9", cbxPrinter3.SelectedValue.ToString());
Configini.IniWritevalue("PRINTER", " P12", Print_path2.Text.ToString());
Configini.IniWritevalue("PRINTER", " P13", Template_M.Text);
Configini.IniWritevalue("PRINTER", " P14", Template_S.Text);
System.IO.DirectoryInfo log = new System.IO.DirectoryInfo(@logpath);//生成日志文件目录
FileStream fs = new FileStream(logPath, FileMode.Append, FileAccess.Write);
StreamWriter wr = new StreamWriter(fs);//创建文件
wr.WriteLine(Log_time + "Print:Print_SET");
wr.Close();
}
private void Button_Click(object sender, RoutedEventArgs e) //路径选择按钮
{
FolderBrowserDialog Dilog = new FolderBrowserDialog();
Dilog.SelectedPath = Print_path.Text; //打开目录
Dilog.ShowNewFolderButton = false; //不显示新建文件夹按钮
//
if (Dilog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Print_path.Text = Dilog.SelectedPath; //返回选择的字符串
}
}
private void Button_Click1(object sender, RoutedEventArgs e) //路径选择按钮
{
FolderBrowserDialog Dilog = new FolderBrowserDialog();
Dilog.SelectedPath = Print_path2.Text; //打开目录
Dilog.ShowNewFolderButton = false; //不显示新建文件夹按钮
//
if (Dilog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Print_path2.Text = Dilog.SelectedPath; //返回选择的字符串
}
}
private void Button_Click_1(object sender, RoutedEventArgs e) //编辑模板
{
if (string.IsNullOrEmpty(Template_M.Text))
{
System.Windows.MessageBox.Show("模板不能为空");
return;
}
var tuple = PrintHelper.Design(Print_path.Text + "/" + Template_M.Text);
if (!tuple.Item1)
{
System.Windows.MessageBox.Show($"打开设计器失败:{tuple.Item2}");
}
}
private void Button_Click_12(object sender, RoutedEventArgs e) //编辑模板
{
if (string.IsNullOrEmpty(Template_S.Text))
{
System.Windows.MessageBox.Show("模板不能为空");
return;
}
var tuple = PrintHelper.Design(Print_path2.Text + "/" + Template_S.Text);
if (!tuple.Item1)
{
System.Windows.MessageBox.Show($"打开设计器失败:{tuple.Item2}");
}
}
private void Button_Click_2(object sender, RoutedEventArgs e) //预览模板
{
Report report = new Report();
//加载标签模版
report.Load(Print_path.Text + "/" + Template_M.Text);
//打印预览
report.Prepare();//准备
report.ShowPrepared();//预览
}
private void Button_Click_22(object sender, RoutedEventArgs e) //预览模板
{
Report report = new Report();
//加载标签模版
report.Load(Print_path2.Text + "/" + Template_S.Text);
//打印预览
report.Prepare();//准备
report.ShowPrepared();//预览
}
private void Print_Checked(object sender, RoutedEventArgs e) //打印机是否生效
{
Printer = TEXT_Print.IsChecked.GetValueOrDefault(); //打印机是否生效
cbxPrinter.IsEnabled = Printer; //
}
private void Print_Checked2(object sender, RoutedEventArgs e) //打印机是否生效
{
Printer2 = TEXT_Print2.IsChecked.GetValueOrDefault(); //打印机是否生效
cbxPrinter2.IsEnabled = Printer2; //
}
private void Print_Checked3(object sender, RoutedEventArgs e) //打印机是否生效
{
Printer3 = TEXT_Print3.IsChecked.GetValueOrDefault(); //打印机是否生效
cbxPrinter3.IsEnabled = Printer3; //
}
private List<XElement> GetLocalPrinters() //查找打印机
{
List<XElement> list = new List<XElement>();
try
{
foreach (string fPrinterName in PrinterSettings.InstalledPrinters)
{
var xePrintName = new XElement("Item", new XElement("OPTIONNAME", fPrinterName.Trim()), new XElement("OPTIONCODE", fPrinterName.Trim()));
if (!list.Contains(xePrintName))
list.Add(xePrintName);
}
}
catch (Exception)
{
}
return list;
}
private void Button_Click_3(object sender, RoutedEventArgs e)//新建模板文件
{
Prompt.Visibility = Visibility.Visible; //开启页面遮罩
string Template_path = Print_path.Text + "/" + PrintTemplate.Text;
string Template_DATA = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Report ScriptLanguage=\"CSharp\" ReportInfo.Created=\"12/12/2023 23:59:59\" ReportInfo.Modified=\"12/12/2023 23:59:59\" ReportInfo.CreatorVersion=\"2023.12.12.0\">\r\n <Dictionary/>\r\n <ReportPage Name=\"Page1\" Watermark.Font=\"宋体, 60pt\">\r\n <ReportTitleBand Name=\"ReportTitle1\" Width=\"718.2\" Height=\"37.8\"/>\r\n <PageHeaderBand Name=\"PageHeader1\" Top=\"41.8\" Width=\"718.2\" Height=\"28.35\"/>\r\n <DataBand Name=\"Data1\" Top=\"74.15\" Width=\"718.2\" Height=\"75.6\"/>\r\n <PageFooterBand Name=\"PageFooter1\" Top=\"153.75\" Width=\"718.2\" Height=\"18.9\"/>\r\n </ReportPage>\r\n</Report>";
if (File.Exists(Template_path)) //判断文件是否存在
{
System.Windows.MessageBox.Show("模板已存在");
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
return;
}
if (string.IsNullOrEmpty(PrintTemplate.Text))
{
System.Windows.MessageBox.Show("模板名不能为空");
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
return;
}
File.WriteAllText(Template_path + ".frx", Template_DATA);
var tuple = PrintHelper.Design(Template_path + ".frx");
if (!tuple.Item1)
{
System.Windows.MessageBox.Show($"打开设计器失败:{tuple.Item2}");
Prompt.Visibility = Visibility.Hidden;
return;
}
PRINT_file(); ;//刷新模板列表
PrintTemplate.Text = null;//清空输入
Prompt.Visibility = Visibility.Hidden;//去页面遮罩
}
private void Button_Click_4(object sender, RoutedEventArgs e)//删除指定模板
{
try
{
string Template_path = Print_path.Text + "/" + PrintTemplate.Text;
File.Delete(Template_path);
}
catch
{
System.Windows.MessageBox.Show("删除失败");
}
PrintTemplate.Text = null;
DirectoryInfo di_M = new DirectoryInfo(Print_path.Text); //new文件夹
FileInfo[] files_M = di_M.GetFiles("*.frx");//生成文件夹中的文件名合集
PrintTemplate.ItemsSource = files_M;//加载合集
PrintTemplate.DisplayMemberPath = "Name"; // 显示文件名
}
}
}
+175
View File
@@ -0,0 +1,175 @@
<Window x:Class="formula_manage.Windows.RECIPE"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.Windows"
xmlns:ConvertMoels="clr-namespace:formula_manage.ConvertMoels"
xmlns:ViewModel="clr-namespace:formula_manage.ViewModel"
mc:Ignorable="d" Loaded="RECIPE_Loaded"
Title="RECIPE_SET" Height="720" Width="1100" MaxHeight="720" MaxWidth="1100" MinHeight="720" MinWidth="1100"
DataContext="{Binding Source={StaticResource Locator}, Path=Recipev}"
BorderBrush="White" Background="#FFE0E0E0">
<Window.Resources>
<ViewModel:RECIPEViewModel x:Key="RECIPEViewModel"/>
</Window.Resources>
<Grid>
<!--表-->
<DataGrid x:Name="DatagridRECIPE" MouseDoubleClick="RECIPE_MouseDoubleClick" SelectionMode="Single" AlternationCount="2" IsReadOnly="True"
Margin="15,0,15,150" d:ItemsSource="{d:SampleData ItemCount=999}" AutoGenerateColumns="False" MinColumnWidth="30"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" Grid.ColumnSpan="2"
CanUserResizeRows="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
CanUserResizeColumns="False" CanUserSortColumns="False" HeadersVisibility ="Column" VerticalAlignment="Bottom" Height="250">
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF0F0F0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="#000000"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTextColumn Header="配方代码" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="配方名称" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="颜色名" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="颜色代码" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="客户代码" Width="100" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="客户名称" Width="200" FontSize="15" MaxWidth="400" MinWidth="100" CanUserReorder="False"/>
<DataGridTextColumn Header="备注" Width="800" FontSize="15" MinWidth="80" CanUserReorder="False"/>
</DataGrid.Columns>
</DataGrid>
<!--代码-->
<TextBox x:Name="Code" HorizontalAlignment="Left" Height="30" Margin="65,0,0,100" Text=""
VerticalAlignment="Bottom" Width="120" FontSize="22" MaxLines="1" MaxLength="25"
InputMethod.IsInputMethodEnabled="False"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="15,0,0,100" TextWrapping="Wrap" Text="代码"
VerticalAlignment="Bottom" Width="40" FontSize="20"/>
<!--名称-->
<TextBox x:Name="name" HorizontalAlignment="Left" Height="30" Margin="255,0,0,100" Text=""
VerticalAlignment="Bottom" Width="120" FontSize="22" MaxLines="1" MaxLength="25"
InputMethod.IsInputMethodEnabled="False"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="205,0,0,100" TextWrapping="Wrap" Text="名称"
VerticalAlignment="Bottom" Width="45" FontSize="20"/>
<!--备注-->
<TextBox x:Name="Remark" HorizontalAlignment="Left" Height="30" Margin="255,0,0,50"
VerticalAlignment="Bottom" Width="305" FontSize="22" MaxLines="1"/>
<TextBlock HorizontalAlignment="Left" Height="30" Margin="205,0,0,50" TextWrapping="Wrap" Text="备注"
VerticalAlignment="Bottom" Width="40" FontSize="20"/>
<!--存储按钮-->
<Button Content="存储" HorizontalAlignment="Left" Height="50" Margin="795,0,0,60"
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
Click="Button_Preservation">
</Button>
<!--删除按钮-->
<Button Content="删除" HorizontalAlignment="Left" Height="50" Margin="935,0,0,60"
VerticalAlignment="Bottom" Width="100" FontSize="30" Background="#FFEFEFEF" BorderBrush="White"
Click="Button_Delete">
</Button>
<DataGrid x:Name="Grid_RRODUCT" AlternationCount="2" IsReadOnly="False"
Margin="15,15,15,405" d:ItemsSource="{d:SampleData ItemCount=99}" AutoGenerateColumns="False" MinColumnWidth="30"
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" GridLinesVisibility="All" BorderBrush="#CCCCCC"
BorderThickness="1,1,1,1" ColumnHeaderHeight="40" HorizontalContentAlignment="Right"
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False"
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column"
Background="White" SelectionMode="Single" FontSize="15" >
<DataGrid.Resources>
<Style x:Key="CellStyle" TargetType="{x:Type DataGridCell}">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Background" Value="#FFFFFFFF"/>
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
<Setter Property="Foreground" Value="#000000"/>
<Setter Property="DataContext" Value="{Binding Main, Source={StaticResource Locator}}"/>
</Style>
</DataGrid.Resources>
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False"/>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFFFFFFF"/>
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
<Setter Property="Foreground" Value="#000000"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTextColumn Header="序" Width="30" FontSize="15" MaxWidth="30" MinWidth="30" Binding="{Binding ID}" IsReadOnly="True" CellStyle="{StaticResource CellStyle}"/>
<DataGridTemplateColumn Header="原料代码" Width="200" MaxWidth="400" MinWidth="100" IsReadOnly="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox x:Name="CP_PRODUCT_CODE" BorderThickness="0,0,0,0"
ItemsSource="{Binding stuff_Product, Source={StaticResource RECIPEViewModel}}"
DisplayMemberPath="ProductCode"
Text="{Binding PRODUCT_CODE}" IsTextSearchEnabled="True" StaysOpenOnEdit="True"
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True"
KeyDown="CP_PRODUCT_CODE_KeyUp"
DropDownClosed="CP_PRODUCT_CODE_DropDownClosed"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="目标饱和度(%)" Width="200" MaxWidth="400" MinWidth="100" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox x:Name="CP_CONC" BorderThickness="0,0,0,0" Text="{Binding CONC}"
BorderBrush="{x:Null}" Background="{x:Null}"
KeyDown="CP_CONC_KeyUp"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="计算单位" Width="80" MaxWidth="80" MinWidth="80" CellStyle="{StaticResource CellStyle}" Binding="{Binding SHIFT}"/>
<DataGridTemplateColumn Header="原料名称" Width="200" MaxWidth="400" MinWidth="100" CellStyle="{StaticResource CellStyle}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox x:Name="CP_PRODUCT_NAME" BorderThickness="0,0,0,0"
ItemsSource="{Binding stuff_Product, Source={StaticResource RECIPEViewModel}}"
DisplayMemberPath="ProductName"
Text="{Binding PRODUCT_NAME}"
DropDownClosed="CP_PRODUCT_NAME_DropDownClosed"
BorderBrush="{x:Null}" Background="{x:Null}" IsEditable="True" IsReadOnly="True" Focusable="True" IsTabStop="False"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="单位" Width="80" FontSize="15" MaxWidth="80" MinWidth="80" IsReadOnly="True" Binding="{Binding UNIT}" CellStyle="{StaticResource CellStyle}"/>
<DataGridTextColumn Header="备注" Width="600" FontSize="15" MinWidth="600" Binding="{Binding REMARK}" CellStyle="{StaticResource CellStyle}" IsReadOnly="False"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Window>
+391
View File
@@ -0,0 +1,391 @@
using formula_manage.UserClass;
using formula_manage.ViewModel;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
namespace formula_manage.Windows
{
/// <summary>
/// Machine.xaml 的交互逻辑
/// </summary>
public partial class RECIPE : Window
{
// DataTable DissolvedataTable = new DataTable(); //建立Dissolve缓存
// DataTable STUFFdataTable = new DataTable(); //建立STUFF缓存
// DataTable MACHINEdataTable = new DataTable(); //建立Machine缓存
DataTable RRODUCTdataTable = new DataTable(); //建立RRODUCT缓存
// DataTable RecipedataTable = new DataTable(); //建立Recipe缓存
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini"; //配置文件路径
string TEXT_SQLIP;
string TEXT_SQLNAME;
string TEXT_SQMOD;
string TEXT_SQLUSER;
string TEXT_SQLPASWOR;
string Connstr_SC;
int ID_N = 1;
public RECIPE()
{
DataContext = new RECIPEViewModel();
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
RRODUCTdataTable.Columns.Add("ID", typeof(int));
RRODUCTdataTable.Columns.Add("DYELOT", typeof(string));
RRODUCTdataTable.Columns.Add("ReDye", typeof(int));
RRODUCTdataTable.Columns.Add("STEP", typeof(int));
RRODUCTdataTable.Columns.Add("PRODUCT_CODE", typeof(string));
RRODUCTdataTable.Columns.Add("CONC", typeof(float));
RRODUCTdataTable.Columns.Add("SHIFT", typeof(string));
RRODUCTdataTable.Columns.Add("PRODUCT_NAME", typeof(string));
RRODUCTdataTable.Columns.Add("TARGET_WT", typeof(float));
RRODUCTdataTable.Columns.Add("UNIT", typeof(string));
RRODUCTdataTable.Columns.Add("Process", typeof(string));
RRODUCTdataTable.Columns.Add("REMARK", typeof(string));
DataRow row = RRODUCTdataTable.NewRow(); //ID列
row["ID"] = ID_N;
row["UNIT"] = "g";
RRODUCTdataTable.Rows.Add(row);
Grid_RRODUCT.ItemsSource = RRODUCTdataTable.DefaultView;
}
private void RECIPE_Loaded(object sender, RoutedEventArgs e)//打开页面执行
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);//生效配置读取
this.DatagridRECIPE.LoadingRow += new EventHandler<DataGridRowEventArgs>(this.DataGridEquipment_LoadingRow);//生成序列号
TEXT_SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
TEXT_SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
TEXT_SQMOD = Configini.IniReadvalue("SQL_SERVER", "SQL3");
TEXT_SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
TEXT_SQLPASWOR = Configini.IniReadvalue("SQL_SERVER", "SQL5");
if (TEXT_SQMOD == "0") //判断连接方式
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + TEXT_SQLIP + ";database=" + TEXT_SQLNAME + ";User ID=" + TEXT_SQLUSER + ";Password=" + TEXT_SQLPASWOR;
}
GridSql();
}
/// <summary>
/// 生成序列号的方法
/// </summary>
private void DataGridEquipment_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}
/// <summary>
/// 查询数据库的方法
/// </summary>
private async void GridSql()
{
string Dissolve_sql = "SELECT DissolveCode ,DissolveName ,REMARK ,MaterialType ,WeightMIN ,WeightMAX FROM [dbo].[Dissolve]";//查询语句
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlDataAdapter Stuff_data = new SqlDataAdapter(Dissolve_sql, Connstr_SC); //查询
DataTable dataTable = new DataTable(); //建立缓存
Stuff_data.Fill(dataTable); //查询结果存入缓存
conn_SC.Close(); //关闭连接
DatagridRECIPE.ItemsSource = dataTable.DefaultView; //数据加入表格
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求信息失败,检查连接");
return;
}
}
private void RECIPE_MouseDoubleClick(object sender, MouseButtonEventArgs e)//数据表双击事件
{
int rownum = DatagridRECIPE.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)//判断鼠标定位是否有效
{
}
}
private void Tb_KeyFloating(object sender, TextCompositionEventArgs e)//输入事件
{
//Regex re = new Regex("[^0-9.-]+");
Regex re = new Regex(@"^[.][0-9]+$|^[0-9]*[.]{0,1}[0-9]*$");// 非负浮点数
e.Handled = !re.IsMatch(e.Text);
}
private void Button_Preservation(object sender, RoutedEventArgs e)//保存按钮事件
{
Regex re_number = new Regex(@"^[0-9]+(.[0-9]{1,2})?$");//校验用正则表达式有1~2位小数的正实数
Regex re_char = new Regex(@"^[A-Za-z0-9\s@()()/+!!_-]+$");//校验用正则表达式由数字,26个英文字母,空白字符和@()()/+!!_-组成的字符串
// string Dissolve_sql;
// int int_ion = 0;
}
private async void Button_Delete(object sender, RoutedEventArgs e)//删除按钮事件
{
string Mac_name = "是否删除【" + this.Code.Text + "】";//获取信息并拼接提示字符串
MessageBoxResult mac_name = System.Windows.MessageBox.Show(Mac_name, "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes);//弹窗提示是否删除目标
if (mac_name == MessageBoxResult.Yes)//判断是否删除原料
{
string Stuff_sql = string.Format("DELETE FROM [dbo].[Dissolve] WHERE Name ='" + Code.Text.ToString() + "'");
SqlConnection conn_SC = new SqlConnection(Connstr_SC); //实例化
try
{
await conn_SC.OpenAsync(); //打开数据连接
SqlCommand INSERT_cmd = new SqlCommand(Stuff_sql, conn_SC);
int sql_in = INSERT_cmd.ExecuteNonQuery(); //执行语句
conn_SC.Close(); //关闭连接
if (sql_in == 0)
{
System.Windows.MessageBox.Show("ERR.C0110-2:删除失败", "错误");//判断执行是否成功
}
else
{
GridSql();
}
}
catch (Exception)
{
System.Windows.MessageBox.Show("请求失败,检查连接");
return;
}
}
}
string Code_;
string Name_;
string Type_;
string Conc_;
double Weight_ = 0;
private void CP_PRODUCT_CODE_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)//原料代码输入事件
{
//double ang;
if (e.Key == Key.Enter)
{
System.Windows.Controls.ComboBox curComboBox = sender as System.Windows.Controls.ComboBox;
int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行
Code_ = curComboBox.Text;
DataRow[] r = MainWindowViewModel.STUFFdatatemp.Select("ProductCode ='" + Code_ + "'"); //查询判断原料代码是否有效
if (!r.Any()) //检查原料信息
{
System.Windows.MessageBox.Show("原料不存在");
curComboBox.Text = "";
return;
}
DataRow[] c = RRODUCTdataTable.Select("PRODUCT_CODE ='" + Code_ + "'");//查询判断原料代码是否重复
if (c.Any())
{
System.Windows.MessageBox.Show("重复原料");
return;
}
Name_ = r[0].ItemArray[1].ToString();
Type_ = r[0].ItemArray[2].ToString();
Conc_ = r[0].ItemArray[3].ToString();
if ((Type_ == "0") || (Type_ == "3"))
{
Type_ = "%";
}
if ((Type_ == "1") || (Type_ == "2"))
{
Type_ = "g/L";
}
if (grid_row == -1) grid_row = 0;
DataRow row = RRODUCTdataTable.Rows[grid_row]; //ID列
row.BeginEdit();
row["PRODUCT_CODE"] = Code_;
row["PRODUCT_NAME"] = Name_;
row["SHIFT"] = Type_;
row.EndEdit();
if (grid_row == (ID_N - 1))
{
PressKey.PressKeys(Keys.Right, false);
PressKey.PressKeys(Keys.Right, true);
PressKey.PressKeys(Keys.Tab, false);
PressKey.PressKeys(Keys.Tab, true);
}
else
{
PressKey.PressKeys(Keys.Right, false);
PressKey.PressKeys(Keys.Right, true);
PressKey.PressKeys(Keys.Up, false);
PressKey.PressKeys(Keys.Up, true);
PressKey.PressKeys(Keys.Tab, false);
PressKey.PressKeys(Keys.Tab, true);
}
}
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
}
private void CP_CONC_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)//目标饱和度输入事件
{
double ang;
double conc = 0;
System.Windows.Controls.TextBox curTextBox = sender as System.Windows.Controls.TextBox;
int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行
if (e.Key == Key.Enter)
{
if (!double.TryParse(curTextBox.Text, out ang))
{
System.Windows.MessageBox.Show("错误,重新输入");
curTextBox.Text = "";
return;
}
else
{
if (curTextBox.Text != "") conc = double.Parse(curTextBox.Text); //转换后判断数值输入是否异常
if (conc > 100)
{
System.Windows.MessageBox.Show("比例错误");
curTextBox.Text = "";
return;
}
else
{
double Weight_t = Weight_ * conc;
DataRow row = RRODUCTdataTable.Rows[grid_row]; //ID列
row.BeginEdit();
row["CONC"] = string.Format("{0:N6}", conc);
row["TARGET_WT"] = string.Format("{0:N3}", Weight_t);
row.EndEdit();
if (grid_row == (ID_N - 1))
{
PressKey.PressKeys(Keys.Left, false);
PressKey.PressKeys(Keys.Left, true);
PressKey.PressKeys(Keys.Tab, false);
PressKey.PressKeys(Keys.Tab, true);
DataRow rowadd = RRODUCTdataTable.NewRow(); //ID列
//rowadd = RRODUCTdataTable.NewRow();
ID_N++;
rowadd["ID"] = ID_N;
rowadd["UNIT"] = "g";
RRODUCTdataTable.Rows.Add(rowadd);
}
}
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
}
}
}
private void CP_PRODUCT_CODE_DropDownClosed(object sender, EventArgs e)//原料代码选择事件
{
//double ang;
System.Windows.Controls.ComboBox curComboBox = sender as System.Windows.Controls.ComboBox;
int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行
Code_ = curComboBox.Text;
DataRow[] r = MainWindowViewModel.STUFFdatatemp.Select("ProductCode ='" + Code_ + "'"); //查询判断原料代码是否有效
if (!r.Any()) //检查原料信息
{
System.Windows.MessageBox.Show("原料不存在");
curComboBox.Text = "";
return;
}
DataRow[] c = RRODUCTdataTable.Select("PRODUCT_CODE ='" + Code_ + "'");//查询判断原料代码是否重复
if (c.Any())
{
System.Windows.MessageBox.Show("重复原料");
return;
}
Name_ = r[0].ItemArray[1].ToString();
Type_ = r[0].ItemArray[2].ToString();
Conc_ = r[0].ItemArray[3].ToString();
if ((Type_ == "0") || (Type_ == "3"))
{
Type_ = "%";
}
if ((Type_ == "1") || (Type_ == "2"))
{
Type_ = "g/L";
}
if (grid_row == -1) grid_row = 0;
DataRow row = RRODUCTdataTable.Rows[grid_row]; //ID列
row.BeginEdit();
row["PRODUCT_CODE"] = Code_;
row["PRODUCT_NAME"] = Name_;
row["SHIFT"] = Type_;
row.EndEdit();
DataGridHelper.SetRealTimeCommit(Grid_RRODUCT, true); //实时更新datagrid
}
private void CP_PRODUCT_NAME_DropDownClosed(object sender, EventArgs e)//原料名选择事件
{
//double ang;
System.Windows.Controls.ComboBox curComboBox = sender as System.Windows.Controls.ComboBox;
int grid_row = Grid_RRODUCT.SelectedIndex; //获取当前行
if (curComboBox.Text != "")
{
Name_ = curComboBox.Text;
DataRow[] r = MainWindowViewModel.STUFFdatatemp.Select("ProductName ='" + Name_ + "'"); //查询判断原料代码是否有效
DataRow[] c = RRODUCTdataTable.Select("PRODUCT_NAME ='" + Name_ + "'");//查询判断原料代码是否重复
if (c.Any())
{
System.Windows.MessageBox.Show("重复原料");
return;
}
Code_ = r[0].ItemArray[0].ToString();
Type_ = r[0].ItemArray[2].ToString();
Conc_ = r[0].ItemArray[3].ToString();
if ((Type_ == "0") || (Type_ == "3"))
{
Type_ = "%";
}
if ((Type_ == "1") || (Type_ == "2"))
{
Type_ = "g/L";
}
if (grid_row == -1) grid_row = 0;
DataRow row = RRODUCTdataTable.Rows[grid_row]; //ID列
row.BeginEdit();
row["PRODUCT_CODE"] = Code_;
row["PRODUCT_NAME"] = Name_;
row["SHIFT"] = Type_;
row.EndEdit();
}
}
}
}
+28
View File
@@ -0,0 +1,28 @@
<Window x:Class="formula_manage.Windows.SQL_BAK"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:formula_manage.Windows"
mc:Ignorable="d" Loaded="Window_SQLBAK" BorderBrush="White" Background="#FFEFEFEF"
Title="备份/还原" Height="140" Width="500" MaxHeight="140" MaxWidth="500" ResizeMode="NoResize">
<Grid>
<CheckBox x:Name="SQL_bak" Height="15" Margin="230,15,145,0" VerticalAlignment="Top" Content="自定义备份地址" IsTabStop="False" Checked="SQLBAK_Checked" Unchecked="SQLBAK_Checked"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,35,0,0" TextWrapping="Wrap" Text="备份地址:" VerticalAlignment="Top" Width="70" FontSize="16"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,10,0,0" TextWrapping="Wrap" Text="数据库(Dispensing):" VerticalAlignment="Top" Width="175" FontSize="16"/>
<TextBox x:Name="SQL_DISPEN_bak" HorizontalAlignment="Left" Height="20" Margin="90,35,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="285"/>
<Button x:Name="SQL_DISPEN_BUT" Content="浏览路径" HorizontalAlignment="Left" Height="20" Margin="375,35,0,0" VerticalAlignment="Top" Width="70" Background="#FFF9F9F9" Click="Button_Click"/>
<Button Content="备份" HorizontalAlignment="Right" Height="20" Margin="0,60,150,0" VerticalAlignment="Top" Width="85" Background="#FFE6E6E6" Click="Button_Click_1"/>
<Button Content="还原" HorizontalAlignment="Right" Height="20" Margin="0,60,50,0" VerticalAlignment="Top" Width="85" Background="#FFE6E6E6" Click="Button_Click_2"/>
<CheckBox x:Name="SQL_bak_time" Height="15" Margin="365,15,40,0" VerticalAlignment="Top" Content="自动备份" IsTabStop="False" Checked="SQL_bak_time_Checked" Unchecked="SQL_bak_time_Checked"/>
<TextBlock HorizontalAlignment="Left" Height="20" Margin="20,60,0,0" TextWrapping="Wrap" Text="备份周期:" VerticalAlignment="Top" Width="70" FontSize="16"/>
<ComboBox x:Name="SQL_TIME" Height="20" Margin="90,60,335,0" VerticalAlignment="Top">
<ComboBoxItem Content="日"/>
<ComboBoxItem Content="周"/>
<ComboBoxItem Content="月"/>
<ComboBoxItem Content="季"/>
<ComboBoxItem Content="年"/>
</ComboBox>
</Grid>
</Window>
+264
View File
@@ -0,0 +1,264 @@
using System;
using System.Data.SqlClient;
using System.Windows;
using System.Windows.Forms;
namespace formula_manage.Windows
{
/// <summary>
/// SQL_BAK.xaml 的交互逻辑
/// </summary>
public partial class SQL_BAK : Window
{
public SQL_BAK()
{
WindowStartupLocation = WindowStartupLocation.CenterScreen;
InitializeComponent();
this.Closing += Window_Closing; //添加窗口关闭事件
}
bool SQLBAK;
bool SQLTIME;
int Time;
int i;
string SQLIP;
string SQLNAME;
bool SQLMOD;
string SQLUSER;
string SQLPASS;
public string INIPath = Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "formula.ini";
private void Window_SQLBAK(object sender, RoutedEventArgs e) //打开页面
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath); //读配置文件
SQLIP = Configini.IniReadvalue("SQL_SERVER", "SQL1"); //读配置文件
SQLNAME = Configini.IniReadvalue("SQL_SERVER", "SQL2");
int.TryParse(Configini.IniReadvalue("SQL_SERVER", "SQL3"), out i); //读数据库状态配置文件
if (i == 0) SQLMOD = false;
else SQLMOD = true;
SQLUSER = Configini.IniReadvalue("SQL_SERVER", "SQL4");
SQLPASS = Configini.IniReadvalue("SQL_SERVER", "SQL5");
SQLBAK = Boolean.Parse(Configini.IniReadvalue("SQL_BAK", "S1"));
SQL_DISPEN_bak.Text = Configini.IniReadvalue("SQL_BAK", "S2");
SQLTIME = Boolean.Parse(Configini.IniReadvalue("SQL_BAK", "S3"));
int.TryParse(Configini.IniReadvalue("SQL_BAK", "S4"), out Time);
if (Time == 0) SQL_TIME.Text = "日";
else if (Time == 1) SQL_TIME.Text = "周";
else if (Time == 2) SQL_TIME.Text = "月";
else if (Time == 3) SQL_TIME.Text = "季";
else if (Time == 4) SQL_TIME.Text = "年";
SQL_bak.IsChecked = SQLBAK;
SQL_DISPEN_bak.IsEnabled = SQLBAK;
SQL_DISPEN_BUT.IsEnabled = SQLBAK;
SQL_bak_time.IsChecked = SQLTIME;
SQL_TIME.IsEnabled = SQLTIME;
}
private void SQLBAK_Checked(object sender, RoutedEventArgs e) //自定义备份地址状态
{
SQLBAK = SQL_bak.IsChecked.GetValueOrDefault();
SQL_DISPEN_bak.IsEnabled = SQLBAK;
SQL_DISPEN_BUT.IsEnabled = SQLBAK;
}
private void SQL_bak_time_Checked(object sender, RoutedEventArgs e) //自动保存
{
SQLTIME = SQL_bak_time.IsChecked.GetValueOrDefault();
SQL_TIME.IsEnabled = SQLTIME;
}
private void Button_Click(object sender, RoutedEventArgs e) //SQL_DISPEN_bak路径选择按钮
{
FolderBrowserDialog Dilog = new FolderBrowserDialog();
Dilog.SelectedPath = SQL_DISPEN_bak.Text; //打开目录
Dilog.ShowNewFolderButton = false; //不显示新建文件夹按钮
//
if (Dilog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
SQL_DISPEN_bak.Text = Dilog.SelectedPath; //返回选择的字符串
}
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
{
UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(INIPath);
Configini.IniWritevalue("SQL_BAK", "S1", SQL_bak.IsChecked.GetValueOrDefault().ToString()); //保存自定义备份地址配置
Configini.IniWritevalue("SQL_BAK", "S2", SQL_DISPEN_bak.Text); //保存备份地址
Configini.IniWritevalue("SQL_BAK", "S3", SQL_bak_time.IsChecked.GetValueOrDefault().ToString()); //保存自动备份配置
if (SQL_TIME.Text == "日") Time = 0;
else if (SQL_TIME.Text == "周") Time = 1;
else if (SQL_TIME.Text == "月") Time = 2;
else if (SQL_TIME.Text == "季") Time = 3;
else if (SQL_TIME.Text == "年") Time = 4;
Configini.IniWritevalue("SQL_BAK", "S4", Time.ToString()); //保存自动备份周期
}
string Connstr_SC;
private bool Backup(string dbName, string filePath) // 备份数据库
{
if (!SQLMOD) //连接数据库测试
{
Connstr_SC = "server=" + SQLIP + ";database=" + SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + SQLIP + ";database=" + SQLNAME + ";User ID=" + SQLUSER + ";Password=" + SQLPASS;
}
SqlConnection connection = new SqlConnection();
connection.ConnectionString = Connstr_SC;
connection.Open();
SqlCommand command = new SqlCommand();
command.Connection = connection;
command.CommandText = string.Format("backup database {0} to disk = '{1}'", dbName, filePath);
try
{
command.ExecuteNonQuery();
return true;
}
catch
{
return false;
}
finally
{
connection.Close();
}
}
private bool Restore(string dbName, string filePath) // 还原数据库
{
if (!SQLMOD) //连接数据库测试
{
Connstr_SC = "server=" + SQLIP + ";database=" + SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + SQLIP + ";database=" + SQLNAME + ";User ID=" + SQLUSER + ";Password=" + SQLPASS;
}
SqlConnection connection = new SqlConnection(Connstr_SC);
SqlCommand command = new SqlCommand();
command.Connection = connection;
// 还原数据库
connection.Open();
command.CommandText = string.Format("use master restore database {0} from disk = '{1}' with replace", dbName, filePath);
try
{
command.ExecuteNonQuery();
}
catch
{
return false;
}
finally
{
connection.Close();
}
return true;
}
private async void Button_Click_1(object sender, RoutedEventArgs e)
{
bool ok;
System.DateTime.Now.ToString("yyyy-MM-dd_HH_mm_ss");
if (!SQLMOD) //连接数据库测试
{
Connstr_SC = "server=" + SQLIP + ";database=" + SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + SQLIP + ";database=" + SQLNAME + ";User ID=" + SQLUSER + ";Password=" + SQLPASS;
}
try
{
SqlConnection conn_SC = new SqlConnection(Connstr_SC);
await conn_SC.OpenAsync(); //连接数据库
conn_SC.Close();
}
catch (Exception)
{
System.Windows.MessageBox.Show("数据库错误", "ERR", MessageBoxButton.OK, MessageBoxImage.Exclamation); //连接失败提示
return;
}
if ((bool)SQL_bak.IsChecked)
{
ok = Backup(SQLNAME, SQL_DISPEN_bak.Text + "\\" + SQLNAME + System.DateTime.Now.ToString("yyyy_MM_dd_HHmmss") + ".bak"); //指定地址备份
}
else
{
ok = Backup(SQLNAME, "C:\\SUNLIGHT\\" + SQLNAME + System.DateTime.Now.ToString("yyyy_MM_dd_HHmmss") + ".bak"); //默认备份到文档文件夹
}
if (ok)
{
System.Windows.MessageBox.Show("备份成功");
}
else
{
System.Windows.MessageBox.Show("备份失败");
}
}
private async void Button_Click_2(object sender, RoutedEventArgs e)
{
if (!SQLMOD) //连接数据库测试
{
Connstr_SC = "server=" + SQLIP + ";database=" + SQLNAME + ";Trusted_Connection=SSPI";
}
else
{
Connstr_SC = "server=" + SQLIP + ";database=" + SQLNAME + ";User ID=" + SQLUSER + ";Password=" + SQLPASS;
}
try
{
SqlConnection conn_SC = new SqlConnection(Connstr_SC);
await conn_SC.OpenAsync(); //连接数据库
conn_SC.Close();
}
catch (Exception)
{
System.Windows.MessageBox.Show("数据库错误", "ERR", MessageBoxButton.OK, MessageBoxImage.Exclamation); //连接失败提示
return;
}
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Title = "还原数据库";
openFileDialog.Filter = "备份文件(*.bak)|*.bak";
//openFileDialog.RestoreDirectory = true;
if ((bool)SQL_bak.IsChecked)
{
openFileDialog.InitialDirectory = SQL_DISPEN_bak.Text;
}
else
{
openFileDialog.InitialDirectory = "C:\\SUNLIGHT\\";
}
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
bool ok = Restore(SQLNAME, openFileDialog.FileName);
if (ok)
{
System.Windows.MessageBox.Show("还原成功");
}
else
{
System.Windows.MessageBox.Show("还原失败");
}
}
}
}
}
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff. Show more