QcmZcCheckconsignGroupCtrl.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. using Core.Mes.Client.Comm.Control;
  2. using Core.Mes.Client.Comm.Server;
  3. using Core.Mes.Client.Comm.Tool;
  4. using Core.StlMes.Client.Judge.Commons;
  5. using Core.StlMes.Client.Judge.Forms;
  6. using CoreFS.CA06;
  7. using CoreFS.SA06;
  8. using Infragistics.Win.UltraWinGrid;
  9. using System;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.Windows.Forms;
  13. namespace Core.StlMes.Client.Judge.Controls
  14. {
  15. public partial class QcmZcCheckconsignGroupCtrl : UserControl
  16. {
  17. private OpeBase _ob;
  18. private JudgeType _judgeType;
  19. private Dal _d;
  20. private string _processCode = "";
  21. private string _lotNo = "";
  22. private string _judgeStoveNo = "";
  23. private string _judgeState = "";
  24. private string _judgeTimeB = "";
  25. private string _judgeTimeE = "";
  26. private string[] _plines = new string[]{};
  27. private string _chemType = "";
  28. private string _gpSource = "";
  29. private string _checkNo = "";
  30. private string _isCheck = "";
  31. private string _judgeTimeStart = "";
  32. private string _judgeTimeEnd = "";
  33. private CoreUserInfo _UserInfo;
  34. public QcmZcCheckconsignGroupCtrl(Control container, OpeBase ob, JudgeType judgeType, CoreUserInfo UserInfo)
  35. {
  36. InitializeComponent();
  37. this._ob = ob;
  38. _judgeType = judgeType;
  39. _UserInfo = UserInfo;
  40. container.Controls.Add(this);
  41. this.Dock = DockStyle.Fill;
  42. this.BringToFront();
  43. _d = new Dal(ob);
  44. ClsBaseInfo.FillComBaseInfo(ultraComboEditor1, "407401", ob, false);
  45. //判定结果只显示内控合格和不合格。 40740101内控合格 40740102内控不合格
  46. DataTable dt = (DataTable)ultraComboEditor1.DataSource;
  47. for (int i = 0; i < dt.Rows.Count; i++)
  48. {
  49. if (dt.Rows[i]["BASECODE"].ToString() != "40740101"
  50. && dt.Rows[i]["BASECODE"].ToString() != "40740102")
  51. {
  52. dt.Rows[i].Delete();
  53. }
  54. }
  55. dt.AcceptChanges();
  56. ClsBaseInfo.SetComboItemHeight(ultraComboEditor1);
  57. ClsBaseInfo.FillComBaseInfo(ultraComboEditor2, "407402", ob, false);
  58. ClsBaseInfo.FillComBaseInfo(ultraComboEditor3, "407407", ob, false);
  59. ClsBaseInfo.FillComBaseInfo(ultraComboEditor4, "407404", ob, false);
  60. ClsBaseInfo.FillComBaseInfo(ultraComboEditor5, "407406", ob, false);
  61. if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山,贾忠良,陈宇,冯丽君,宋丹".Contains(_UserInfo.GetUserName()))
  62. {
  63. ultraGrid1.DisplayLayout.Bands[0].Columns["lotNo"].EditorComponent = null;
  64. }
  65. }
  66. public void Query(string lotNo, string judgeStoveNo, string judgeState, string judgeTimeB,
  67. string judgeTimeE, string[] plines, string chemType, string gpSource, string processCode,
  68. string checkNo, string isCheck, string judgeTimeStart,string judgeTimeEnd)
  69. {
  70. _lotNo = lotNo;
  71. _judgeStoveNo = judgeStoveNo;
  72. _judgeState = judgeState;
  73. _judgeTimeB = judgeTimeB;
  74. _judgeTimeE = judgeTimeE;
  75. _plines = plines;
  76. _chemType = chemType;
  77. _gpSource = gpSource;
  78. _processCode = processCode;
  79. _checkNo = checkNo;
  80. _isCheck = isCheck;
  81. _judgeTimeStart = judgeTimeStart;
  82. _judgeTimeEnd = judgeTimeEnd;
  83. DataTable dt = _d.GetTableByXmlId("JdgQcmZcCheckconsign.groupQuery", lotNo, judgeStoveNo, judgeState,
  84. judgeTimeB, judgeTimeE, plines.Length, plines, chemType, gpSource, processCode, checkNo, isCheck, judgeTimeStart, judgeTimeEnd);
  85. GridHelper.CopyDataToDatatable(dt, dataTable1, true);
  86. GridHelper.RefreshAndAutoSizeExceptColumns(ultraGrid1, "memo", "judgeMemo");
  87. }
  88. public void Clear()
  89. {
  90. dataTable1.Clear();
  91. }
  92. private void ultraTextEditor2_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  93. {
  94. PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
  95. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  96. {
  97. ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
  98. ultraGrid1.ActiveRow.Update();
  99. }
  100. }
  101. private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
  102. {
  103. e.Cell.Row.Update();
  104. }
  105. private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
  106. {
  107. Color red = Color.FromArgb(255, 106, 106);
  108. Color blue = Color.FromArgb(135, 206, 250);
  109. if (e.Row.GetValue("checkResult") == "不合格")
  110. {
  111. e.Row.RowSelectorAppearance.BackColor = red;
  112. }
  113. if (e.Row.GetValue("sampleType") == "复验")
  114. {
  115. e.Row.Cells["sampleType"].Appearance.BackColor = blue;
  116. }
  117. }
  118. FormFileDown askDown;
  119. private void ultraTextEditor1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  120. {
  121. if (e.Button.Key.Equals("1"))
  122. {
  123. string filePath = ultraGrid1.ActiveRow.GetValue(ultraGrid1.ActiveCell.Column.Key.Replace("craftNo", "craftPath"));
  124. askDown = new FormFileDown(_ob, filePath);
  125. askDown.DeleteButton.Visible = false;
  126. askDown.Show();
  127. }
  128. else
  129. {
  130. try
  131. {
  132. var row = ultraGrid1.ActiveRow;
  133. CraftSelect craftSelect = new CraftSelect(_ob);
  134. string ordLnDlyPk = row.Cells["ordLnDlyPk"].Text.ToString();
  135. string judgeStoveNo = row.Cells["judgeStoveNo"].Text.ToString();
  136. string checkNo = row.Cells["checkNo"].Text.ToString();
  137. //string ordLnPk = ordLnDlyPk.Substring(0, ordLnDlyPk.Length - 3).ToString();
  138. craftSelect.Query(ordLnDlyPk);
  139. if (craftSelect.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  140. {
  141. UltraGridRow ugrow = craftSelect.row;
  142. string craftSeq = ugrow.Cells["craftSeq"].Value.ToString();
  143. string craftNo = ugrow.Cells["craftNo"].Value.ToString();
  144. String[] parm = new String[] { craftSeq, craftNo, judgeStoveNo, checkNo, _processCode };
  145. ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateJhyCraftNo", new object[] { parm }, _ob);
  146. Query(_lotNo, _judgeStoveNo, _judgeState, _judgeTimeB,_judgeTimeE, _plines, _chemType, _gpSource, _processCode,
  147. _checkNo, _isCheck, _judgeTimeStart,_judgeTimeEnd);
  148. }
  149. }
  150. catch (Exception ex)
  151. {
  152. MessageUtil.ShowTips(ex.Message);
  153. }
  154. }
  155. }
  156. private void ultraTextEditor3_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  157. {
  158. if (e.Button.Key.Equals("bj"))
  159. {
  160. //if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()))
  161. //{
  162. // throw new Exception("您没有该权限!");
  163. //}
  164. PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
  165. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  166. {
  167. var row = ultraGrid1.ActiveRow;
  168. string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
  169. string checkNo = row.Cells["checkNo"].Value.ToString();
  170. String[] parm = new String[] { judgeStoveNo, checkNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id","2" };
  171. ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateZcLotNoGroup", new object[] { parm }, _ob);
  172. Query(_lotNo, _judgeStoveNo, _judgeState, _judgeTimeB, _judgeTimeE, _plines, _chemType, _gpSource, _processCode,
  173. _checkNo, _isCheck, _judgeTimeStart, _judgeTimeEnd);
  174. }
  175. return;
  176. }
  177. LotNoGroupInfoQueryFrm frm = new LotNoGroupInfoQueryFrm(ultraGrid1.GetActiveRowValue("lotNo"), _d.Ob);
  178. frm.ShowDialog();
  179. }
  180. private void ultraTextEditor4_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  181. {
  182. if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山,贾忠良,陈宇,冯丽君,宋丹".Contains(_UserInfo.GetUserName()))
  183. {
  184. ultraGrid1.DisplayLayout.Bands[0].Columns["lotNo"].EditorComponent = null;
  185. }
  186. PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
  187. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  188. {
  189. var row = ultraGrid1.ActiveRow;
  190. string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
  191. string checkNo = row.Cells["checkNo"].Value.ToString();
  192. String[] parm = new String[] { judgeStoveNo, checkNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id","1" };
  193. ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateZcLotNo", new object[] { parm }, _ob);
  194. Query(_lotNo, _judgeStoveNo, _judgeState, _judgeTimeB, _judgeTimeE, _plines, _chemType, _gpSource, _processCode,
  195. _checkNo, _isCheck, _judgeTimeStart, _judgeTimeEnd);
  196. }
  197. }
  198. private void ultraTextCic_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  199. {
  200. if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()) && !"宋丹".Equals(_UserInfo.GetUserName()))
  201. {
  202. throw new Exception("您没有该权限!");
  203. }
  204. PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 2000);
  205. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  206. {
  207. var row = ultraGrid1.ActiveRow;
  208. string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
  209. string checkNo = row.Cells["checkNo"].Value.ToString();
  210. String[] parm = new String[] { judgeStoveNo, checkNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id", "1" };
  211. ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateZcCic", new object[] { parm }, _ob);
  212. ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
  213. ultraGrid1.ActiveRow.Update();
  214. }
  215. }
  216. private void ultraTextPic_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
  217. {
  218. if (!"admin".Equals(_UserInfo.GetUserName()) && !"屈松山".Equals(_UserInfo.GetUserName()) && !"宋丹".Equals(_UserInfo.GetUserName()))
  219. {
  220. throw new Exception("您没有该权限!");
  221. }
  222. PopupTextBox popupText = new PopupTextBox(ultraGrid1.ActiveCell.Value.ToString(), 40);
  223. if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  224. {
  225. var row = ultraGrid1.ActiveRow;
  226. string judgeStoveNo = row.Cells["judgeStoveNo"].Value.ToString();
  227. string checkNo = row.Cells["checkNo"].Value.ToString();
  228. String[] parm = new String[] { judgeStoveNo, checkNo, _processCode, popupText.TextInfo.Trim(), ultraGrid1.ActiveCell.Value.ToString(), _judgeType.ToString(), _UserInfo.GetUserName(), "id", "1" };
  229. ServerHelper.SetData("com.steering.pss.judge.Bll.BllZcColligateJudge.updateZcPic", new object[] { parm }, _ob);
  230. ultraGrid1.ActiveCell.Value = popupText.TextInfo.Trim();
  231. ultraGrid1.ActiveRow.Update();
  232. }
  233. }
  234. }
  235. }