版博士V2.0程序
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

307 líneas
19 KiB

  1. using MaiMuAOI.SysCtrl;
  2. using Models;
  3. using Newtonsoft.Json;
  4. using SqlSugar;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Data;
  9. using System.Drawing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows.Forms;
  14. namespace MaiMuAOI.SysUI.DefectPicShow
  15. {
  16. public partial class AmendantRecordFrm : Form
  17. {
  18. Service.OrderService OrderService = new Service.OrderService();
  19. Order _order;
  20. List<OrderHistory> _OrderHistoryList = new List<OrderHistory>();
  21. public AmendantRecordFrm(Order order)
  22. {
  23. InitializeComponent();
  24. UIStyle.SetUIStyle(this);
  25. this.uiTitel1.FatherForm = this;
  26. _order = order;
  27. _OrderHistoryList = _order.OrderHistoryList;
  28. this.BackColor = Color.White;
  29. }
  30. private void AmendantRecordFrm_Load(object sender, EventArgs e)
  31. {
  32. if(_order.CompareResult == 2)
  33. radioButton3.Checked = true;
  34. else if (_order.CompareResult == 1)
  35. radioButton2.Checked = true;
  36. else
  37. radioButton1.Checked = true;
  38. numericUpDown1.Value = (decimal)_order.TensionValue;
  39. numericUpDown2.Value = (decimal)_order.HeightValue;
  40. numericUpDown3.Value = (decimal)_order.PTValue;
  41. numericUpDown5.Value = (decimal)_order.TensionValue;
  42. numericUpDown12.Value = (decimal)_order.DKCount;
  43. numericUpDown13.Value = (decimal)_order.ZWCount;
  44. numericUpDown14.Value = (decimal)_order.GSYCCount;
  45. numericUpDown15.Value = (decimal)_order.XWSCount;
  46. numericUpDown16.Value = (decimal)_order.QKCount;
  47. numericUpDown17.Value = (decimal)_order.ZKCount;
  48. numericUpDown18.Value = (decimal)_order.PPCount;
  49. numericUpDown19.Value = (decimal)_order.HSCount;
  50. numericUpDown20.Value = (decimal)_order.YXCount;
  51. numericUpDown21.Value = (decimal)_order.XBCount;
  52. numericUpDown22.Value = (decimal)_order.SXCount;
  53. //numericUpDown31.Value = (decimal)_order.ChilopodLengthValue;
  54. //numericUpDown25.Value = (decimal)_order.ChilopodWidthValue;
  55. }
  56. #region 取消
  57. private void skinButton3_Click(object sender, EventArgs e)
  58. {
  59. this.Close();
  60. }
  61. #endregion
  62. #region 保存
  63. private bool IsModify()
  64. {
  65. bool ret = true;
  66. if ((_order.CompareResult == 2) && (radioButton3.Checked))
  67. ret = ret & true;
  68. else if ((_order.CompareResult == 1) && (radioButton2.Checked))
  69. ret = ret & true;
  70. else if ((_order.CompareResult == 0) && (radioButton1.Checked))
  71. ret = ret & true;
  72. else
  73. ret = ret & false;
  74. ret = ret & (_order.TensionValue == (double)numericUpDown1.Value);
  75. ret = ret & (_order.HeightValue == (double)numericUpDown2.Value);
  76. ret = ret & (_order.PTValue == (double)numericUpDown3.Value);
  77. ret = ret & (_order.LineWidthValue == (double)numericUpDown4.Value);
  78. ret = ret & (_order.DKCount == (int)numericUpDown12.Value);
  79. ret = ret & (_order.ZWCount == (int)numericUpDown13.Value);
  80. ret = ret & (_order.GSYCCount == (int)numericUpDown14.Value);
  81. ret = ret & (_order.XWSCount == (int)numericUpDown15.Value);
  82. ret = ret & (_order.QKCount == (int)numericUpDown16.Value);
  83. ret = ret & (_order.ZKCount == (int)numericUpDown17.Value);
  84. ret = ret & (_order.PPCount == (int)numericUpDown18.Value);
  85. ret = ret & (_order.HSCount == (int)numericUpDown19.Value);
  86. ret = ret & (_order.YXCount == (int)numericUpDown20.Value);
  87. ret = ret & (_order.XBCount == (int)numericUpDown21.Value);
  88. ret = ret & (_order.SXCount == (int)numericUpDown22.Value);
  89. return !ret;
  90. }
  91. private void skinButton1_Click(object sender, EventArgs e)
  92. {
  93. if (IsModify())
  94. {
  95. if(_OrderHistoryList == null)
  96. _OrderHistoryList = new List<OrderHistory>();
  97. _OrderHistoryList.Add(new OrderHistory()
  98. {
  99. TensionValue = _order.TensionValue,
  100. HeightValue = _order.HeightValue,
  101. //PTValue = _order.PTValue,
  102. //LineWidthValue = _order.LineWidthValue,
  103. //FLineWidthValue = _order.FLineWidthValue,
  104. //XPTValue = _order.XPTValue,
  105. //MGridIntervalValue = _order.MGridIntervalValue,
  106. //MGridWidthValue = _order.MGridWidthValue,
  107. //MGridSpreadValue = _order.MGridSpreadValue,
  108. //FGridSpreadValue = _order.FGridSpreadValue,
  109. //BackPoleWidthValue = _order.BackPoleWidthValue,
  110. //MGridLengthValue = _order.MGridLengthValue,
  111. //MarkXDisValue = _order.MarkXDisValue,
  112. //MarkYDisValue = _order.MarkYDisValue,
  113. //ForkDisValue = _order.ForkDisValue,
  114. //ForkWidthValue = _order.ForkWidthValue,
  115. //ForkLengthValue = _order.ForkLengthValue,
  116. //ChilopodLengthValue = _order.ChilopodLengthValue,
  117. //ChilopodWidthValue = _order.ChilopodWidthValue,
  118. //ShardingDisValue = _order.ShardingDisValue,
  119. //WeldingSpotDisValue = _order.WeldingSpotDisValue,
  120. //WeldingSpotLengthValue = _order.WeldingSpotLengthValue,
  121. //WeldingSpotWidthValue = _order.WeldingSpotWidthValue,
  122. //CompareResult = _order.CompareResult,
  123. //Qualified = _order.Qualified,
  124. //DKCount = _order.DKCount,
  125. //ZWCount = _order.ZWCount,
  126. //GSYCCount = _order.GSYCCount,
  127. //XWSCount = _order.XWSCount,
  128. //QKCount = _order.QKCount,
  129. //ZKCount = _order.ZKCount,
  130. //PPCount = _order.PPCount,
  131. //HSCount = _order.HSCount,
  132. //XBCount = _order.XBCount,
  133. //YXCount = _order.YXCount,
  134. //SXCount = _order.SXCount,
  135. CreateUserCode = SysMgr.Instance.UserMgr.LoginUser.Code,
  136. ModifyUserCode = SysMgr.Instance.UserMgr.LoginUser.Code
  137. });
  138. _order.HistoryCount++;
  139. _order.CompareResult = radioButton3.Checked ? 2 : radioButton2.Checked ? 1 : 0;
  140. _order.TensionValue = (double)numericUpDown1.Value;
  141. _order.HeightValue = (double)numericUpDown2.Value;
  142. _order.PTValue = (double)numericUpDown3.Value;
  143. _order.LineWidthValue = (double)numericUpDown4.Value;
  144. //_order.FLineWidthValue = (double)numericUpDown5.Value;
  145. //_order.XPTValue = (double)numericUpDown6.Value;
  146. //_order.MGridIntervalValue = (double)numericUpDown7.Value;
  147. //_order.MGridWidthValue = (double)numericUpDown8.Value;
  148. //_order.MGridSpreadValue = (double)numericUpDown9.Value;
  149. //_order.FGridSpreadValue = (double)numericUpDown10.Value;
  150. //_order.BackPoleWidthValue = (double)numericUpDown11.Value;
  151. //_order.MGridLengthValue = (double)numericUpDown27.Value;
  152. //_order.MarkXDisValue = (double)numericUpDown30.Value;
  153. //_order.MarkYDisValue = (double)numericUpDown29.Value;
  154. //_order.ForkLengthValue = (double)numericUpDown28.Value;
  155. //_order.ForkWidthValue = (double)numericUpDown24.Value;
  156. //_order.ForkDisValue = (double)numericUpDown26.Value;
  157. //_order.ChilopodLengthValue = (double)numericUpDown31.Value;
  158. //_order.ChilopodWidthValue = (double)numericUpDown25.Value;
  159. //_order.ShardingDisValue = (double)numericUpDown32.Value;
  160. //_order.WeldingSpotLengthValue = (double)numericUpDown35.Value;
  161. //_order.WeldingSpotWidthValue = (double)numericUpDown34.Value;
  162. //_order.WeldingSpotDisValue = (double)numericUpDown33.Value;
  163. _order.DKCount = (int)numericUpDown12.Value;
  164. _order.ZWCount = (int)numericUpDown13.Value;
  165. _order.GSYCCount = (int)numericUpDown14.Value;
  166. _order.XWSCount = (int)numericUpDown15.Value;
  167. _order.QKCount = (int)numericUpDown16.Value;
  168. _order.ZKCount = (int)numericUpDown17.Value;
  169. _order.PPCount = (int)numericUpDown18.Value;
  170. _order.HSCount = (int)numericUpDown19.Value;
  171. _order.YXCount = (int)numericUpDown20.Value;
  172. _order.XBCount = (int)numericUpDown21.Value;
  173. _order.SXCount = (int)numericUpDown22.Value;
  174. //_order.DSCount = (int)numericUpDown23.Value;
  175. _order.OrderHistoryList = _OrderHistoryList;
  176. _order.ModifyUserCode = SysMgr.Instance.UserMgr.LoginUser.Code;
  177. bool qua = true;
  178. qua = qua & (_order.CompareResult == 1);
  179. if ((_order.ProductInfo.TensionDownFloatValue + _order.ProductInfo.TensionUpFloatValue) > 0)
  180. qua = qua & (((_order.ProductInfo.TensionBaseValue - _order.ProductInfo.TensionDownFloatValue ) < _order.TensionValue) &&
  181. ((_order.ProductInfo.TensionUpFloatValue + _order.ProductInfo.TensionBaseValue) > _order.TensionValue));
  182. if ((_order.ProductInfo.HeightDownFloatValue + _order.ProductInfo.HeightUpFloatValue) > 0)
  183. qua = qua & (((_order.ProductInfo.HeightBaseValue - _order.ProductInfo.HeightDownFloatValue) < _order.HeightValue) &&
  184. ((_order.ProductInfo.HeightUpFloatValue + _order.ProductInfo.HeightBaseValue) > _order.HeightValue));
  185. if ((_order.ProductInfo.PTDownFloatValue + _order.ProductInfo.PTUpFloatValue) > 0)
  186. qua = qua & (((_order.ProductInfo.PTBaseValue - _order.ProductInfo.PTDownFloatValue) < _order.PTValue) &&
  187. ((_order.ProductInfo.PTUpFloatValue + _order.ProductInfo.PTBaseValue) > _order.PTValue));
  188. //if ((_order.ProductInfo.PTXUpFloatValue + _order.ProductInfo.PTXDownFloatValue) > 0)
  189. // qua = qua & (((_order.ProductInfo.PTXBaseValue - _order.ProductInfo.PTXDownFloatValue) < _order.XPTValue) &&
  190. // ((_order.ProductInfo.PTXUpFloatValue + _order.ProductInfo.PTXBaseValue) > _order.XPTValue));
  191. if ((_order.ProductInfo.LineWidthUpFloatValue + _order.ProductInfo.LineWidthDownFloatValue) > 0)
  192. qua = qua & (((_order.ProductInfo.LineWidthBaseValue - _order.ProductInfo.LineWidthDownFloatValue) < _order.LineWidthValue) &&
  193. ((_order.ProductInfo.LineWidthUpFloatValue + _order.ProductInfo.LineWidthBaseValue) > _order.LineWidthValue));
  194. //if ((_order.ProductInfo.FLineWidthUpFloatValue + _order.ProductInfo.FLineWidthDownFloatValue) > 0)
  195. // qua = qua & (((_order.ProductInfo.FLineWidthBaseValue - _order.ProductInfo.FLineWidthDownFloatValue) < _order.FLineWidthValue) &&
  196. // ((_order.ProductInfo.FLineWidthUpFloatValue + _order.ProductInfo.FLineWidthBaseValue) > _order.FLineWidthValue));
  197. //if ((_order.ProductInfo.MGridIntervalDownFloatValue + _order.ProductInfo.MGridIntervalUpFloatValue) > 0)
  198. // qua = qua & (((_order.ProductInfo.MGridIntervalBaseValue - _order.ProductInfo.MGridIntervalDownFloatValue) < _order.MGridIntervalValue) &&
  199. // ((_order.ProductInfo.MGridIntervalUpFloatValue + _order.ProductInfo.MGridIntervalBaseValue) > _order.MGridIntervalValue));
  200. //if ((_order.ProductInfo.MGridWidthDownFloatValue + _order.ProductInfo.MGridWidthUpFloatValue) > 0)
  201. // qua = qua & (((_order.ProductInfo.MGridWidthBaseValue - _order.ProductInfo.MGridWidthDownFloatValue) < _order.MGridWidthValue) &&
  202. // ((_order.ProductInfo.MGridWidthUpFloatValue + _order.ProductInfo.MGridWidthBaseValue) > _order.MGridWidthValue));
  203. //if ((_order.ProductInfo.MGridSpreadDownFloatValue + _order.ProductInfo.MGridSpreadUpFloatValue) > 0)
  204. // qua = qua & (((_order.ProductInfo.MGridSpreadBaseValue - _order.ProductInfo.MGridSpreadDownFloatValue) < _order.MGridSpreadValue) &&
  205. // ((_order.ProductInfo.MGridSpreadUpFloatValue + _order.ProductInfo.MGridSpreadBaseValue) > _order.MGridSpreadValue));
  206. //if ((_order.ProductInfo.FGridSpreadDownFloatValue + _order.ProductInfo.FGridSpreadUpFloatValue) > 0)
  207. // qua = qua & (((_order.ProductInfo.FGridSpreadBaseValue - _order.ProductInfo.FGridSpreadDownFloatValue) < _order.FGridSpreadValue) &&
  208. // ((_order.ProductInfo.FGridSpreadUpFloatValue + _order.ProductInfo.FGridSpreadBaseValue) > _order.FGridSpreadValue));
  209. //if ((_order.ProductInfo.BackPoleWidthDownFloatValue + _order.ProductInfo.BackPoleWidthUpFloatValue) > 0)
  210. // qua = qua & (((_order.ProductInfo.BackPoleWidthBaseValue - _order.ProductInfo.BackPoleWidthDownFloatValue) < _order.BackPoleWidthValue) &&
  211. // ((_order.ProductInfo.BackPoleWidthUpFloatValue + _order.ProductInfo.BackPoleWidthBaseValue) > _order.BackPoleWidthValue));
  212. //if ((_order.ProductInfo.MGridLengthDownFloatValue + _order.ProductInfo.MGridLengthUpFloatValue) > 0)
  213. // qua = qua & (((_order.ProductInfo.MGridLengthBaseValue - _order.ProductInfo.MGridLengthDownFloatValue) < _order.MGridLengthValue) &&
  214. // ((_order.ProductInfo.MGridLengthUpFloatValue + _order.ProductInfo.MGridLengthBaseValue) > _order.MGridLengthValue));
  215. //if ((_order.ProductInfo.MarkXDisDownFloatValue + _order.ProductInfo.MarkXDisUpFloatValue) > 0)
  216. // qua = qua & (((_order.ProductInfo.MarkXDisBaseValue - _order.ProductInfo.MarkXDisDownFloatValue) < _order.MarkXDisValue) &&
  217. // ((_order.ProductInfo.MarkXDisUpFloatValue + _order.ProductInfo.MarkXDisBaseValue) > _order.MarkXDisValue));
  218. //if ((_order.ProductInfo.MarkYDisDownFloatValue + _order.ProductInfo.MarkYDisUpFloatValue) > 0)
  219. // qua = qua & (((_order.ProductInfo.MarkYDisBaseValue - _order.ProductInfo.MarkYDisDownFloatValue) < _order.MarkYDisValue) &&
  220. // ((_order.ProductInfo.MarkYDisUpFloatValue + _order.ProductInfo.MarkYDisBaseValue) > _order.MarkYDisValue));
  221. //if ((_order.ProductInfo.ForkWidthDownFloatValue + _order.ProductInfo.ForkWidthUpFloatValue) > 0)
  222. // qua = qua & (((_order.ProductInfo.ForkWidthBaseValue - _order.ProductInfo.ForkWidthDownFloatValue) < _order.ForkWidthValue) &&
  223. // ((_order.ProductInfo.ForkWidthUpFloatValue + _order.ProductInfo.ForkWidthBaseValue) > _order.ForkWidthValue));
  224. //if ((_order.ProductInfo.ForkLengthDownFloatValue + _order.ProductInfo.ForkLengthUpFloatValue) > 0)
  225. // qua = qua & (((_order.ProductInfo.ForkLengthBaseValue - _order.ProductInfo.ForkLengthDownFloatValue) < _order.FLineWidthValue) &&
  226. // ((_order.ProductInfo.ForkLengthUpFloatValue + _order.ProductInfo.ForkLengthBaseValue) > _order.ForkLengthValue));
  227. //if ((_order.ProductInfo.ForkDisDownFloatValue + _order.ProductInfo.ForkDisUpFloatValue) > 0)
  228. // qua = qua & (((_order.ProductInfo.ForkDisBaseValue - _order.ProductInfo.ForkDisDownFloatValue) < _order.ForkDisValue) &&
  229. // ((_order.ProductInfo.ForkDisUpFloatValue + _order.ProductInfo.ForkDisBaseValue) > _order.ForkDisValue));
  230. //if ((_order.ProductInfo.ChilopodLengthDownFloatValue + _order.ProductInfo.ChilopodLengthUpFloatValue) > 0)
  231. // qua = qua & (((_order.ProductInfo.ChilopodLengthBaseValue - _order.ProductInfo.ChilopodLengthDownFloatValue) < _order.ChilopodLengthValue) &&
  232. // ((_order.ProductInfo.ChilopodLengthUpFloatValue + _order.ProductInfo.ChilopodLengthBaseValue) > _order.ChilopodLengthValue));
  233. //if ((_order.ProductInfo.ChilopodWidthDownFloatValue + _order.ProductInfo.ChilopodWidthUpFloatValue) > 0)
  234. // qua = qua & (((_order.ProductInfo.ChilopodWidthBaseValue - _order.ProductInfo.ChilopodWidthDownFloatValue) < _order.ChilopodLengthValue) &&
  235. // ((_order.ProductInfo.ChilopodWidthUpFloatValue + _order.ProductInfo.ChilopodWidthBaseValue) > _order.ChilopodWidthValue));
  236. //if ((_order.ProductInfo.ShardingDisDownFloatValue + _order.ProductInfo.ShardingDisUpFloatValue) > 0)
  237. // qua = qua & (((_order.ProductInfo.ShardingDisBaseValue - _order.ProductInfo.ShardingDisDownFloatValue) < _order.ShardingDisValue) &&
  238. // ((_order.ProductInfo.ShardingDisUpFloatValue + _order.ProductInfo.ShardingDisBaseValue) > _order.ShardingDisValue));
  239. //if ((_order.ProductInfo.WeldingSpotLengthDownFloatValue + _order.ProductInfo.WeldingSpotLengthUpFloatValue) > 0)
  240. // qua = qua & (((_order.ProductInfo.WeldingSpotLengthBaseValue - _order.ProductInfo.WeldingSpotLengthDownFloatValue) < _order.WeldingSpotLengthValue) &&
  241. // ((_order.ProductInfo.WeldingSpotLengthUpFloatValue + _order.ProductInfo.WeldingSpotLengthBaseValue) > _order.WeldingSpotLengthValue));
  242. //if ((_order.ProductInfo.WeldingSpotWidthDownFloatValue + _order.ProductInfo.WeldingSpotWidthUpFloatValue) > 0)
  243. // qua = qua & (((_order.ProductInfo.WeldingSpotWidthBaseValue - _order.ProductInfo.WeldingSpotWidthDownFloatValue) < _order.WeldingSpotWidthValue) &&
  244. // ((_order.ProductInfo.WeldingSpotWidthUpFloatValue + _order.ProductInfo.WeldingSpotWidthBaseValue) > _order.WeldingSpotWidthValue));
  245. //if ((_order.ProductInfo.WeldingSpotDisDownFloatValue + _order.ProductInfo.WeldingSpotDisUpFloatValue) > 0)
  246. // qua = qua & (((_order.ProductInfo.WeldingSpotDisBaseValue - _order.ProductInfo.WeldingSpotDisDownFloatValue) < _order.WeldingSpotDisValue) &&
  247. // ((_order.ProductInfo.WeldingSpotDisUpFloatValue + _order.ProductInfo.WeldingSpotDisBaseValue) > _order.WeldingSpotDisValue));
  248. _order.Qualified = qua;
  249. bool result = OrderService.UpdateableListEx(_order);
  250. if (result)
  251. MessageBox.Show("修改成功", "完成");
  252. else
  253. MessageBox.Show("修改失败", "失败", MessageBoxButtons.OK, MessageBoxIcon.Error);
  254. }
  255. }
  256. #endregion
  257. }
  258. }