A_SetProcessAlertSuperSmallForm.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. using LYFZ.ComponentLibrary;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm
  12. {
  13. public partial class A_SetProcessAlertSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.A_SetProcessAlertSuperSmallForm
  14. {
  15. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  16. LYFZ.BLL.BLL_ErpSystemConfigure sgbll = new BLL.BLL_ErpSystemConfigure();
  17. public A_SetProcessAlertSuperSmallForm()
  18. {
  19. }
  20. /// <summary>
  21. /// 是否保存
  22. /// </summary>
  23. public bool IsSaveed = false;
  24. /// <summary>
  25. /// 窗体加载事件
  26. /// </summary>
  27. /// <param name="sender"></param>
  28. /// <param name="e"></param>
  29. protected override void A_SetProcessAlertSuperSmallForm_Shown(object sender, EventArgs e)
  30. {
  31. DataTable dt = sgbll.GetProcessMonitorInterfaceManagement();
  32. if (dt.Rows.Count > 0)
  33. {
  34. for (int i = 0; i < dt.Columns.Count; i++)
  35. {
  36. ((CheckBoxEx)((Panel)this.flowLayoutPanel2.Controls["panel_" + dt.Columns[i].ColumnName.Trim()]).Controls["chk_" + dt.Columns[i].ColumnName.Trim()]).Checked = Convert.ToBoolean(dt.Rows[0][i]);
  37. }
  38. }
  39. }
  40. /// <summary>
  41. /// 窗体加载事件
  42. /// </summary>
  43. /// <param name="sender"></param>
  44. /// <param name="e"></param>
  45. protected override void A_SetProcessAlertSuperSmallForm_Load(object sender, EventArgs e)
  46. {
  47. string ExecuteSql = orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoShot'", ShowColumnName: "Sconfig_Value");
  48. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoShotIn'", ShowColumnName: "Sconfig_Value");
  49. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoRepair'", ShowColumnName: "Sconfig_Value");
  50. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoSelected'", ShowColumnName: "Sconfig_Value");
  51. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoSelected2'", ShowColumnName: "Sconfig_Value");
  52. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoDesign'", ShowColumnName: "Sconfig_Value");
  53. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoLook'", ShowColumnName: "Sconfig_Value");
  54. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoSend'", ShowColumnName: "Sconfig_Value");
  55. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoBack'", ShowColumnName: "Sconfig_Value");
  56. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoPickup'", ShowColumnName: "Sconfig_Value");
  57. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoSend2'", ShowColumnName: "Sconfig_Value");
  58. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_NoPickup2'", ShowColumnName: "Sconfig_Value");
  59. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_SelectNotRefinement'", ShowColumnName: "Sconfig_Value");
  60. ExecuteSql += ";" + orbll.GetView_CustomReturnExecuteSql("tb_ErpSystemConfigure", StrWhere: " Sconfig_Code = 'ProcessMonitor_RefinementNotDesign'", ShowColumnName: "Sconfig_Value");
  61. DataSet dtSet = orbll.GetView_Custom(ExecuteSql);
  62. this.txtNoShot.Text = dtSet.Tables["ds"].Rows[0]["Sconfig_Value"].ToString().Trim();
  63. this.txtNoShotIn.Text = dtSet.Tables["ds1"].Rows[0]["Sconfig_Value"].ToString().Trim();
  64. this.txtNoRepair.Text = dtSet.Tables["ds2"].Rows[0]["Sconfig_Value"].ToString().Trim();
  65. this.txtNoSelected.Text = dtSet.Tables["ds3"].Rows[0]["Sconfig_Value"].ToString().Trim();
  66. this.txtNoSelected2.Text = dtSet.Tables["ds4"].Rows[0]["Sconfig_Value"].ToString().Trim();
  67. this.txtNoDesign.Text = dtSet.Tables["ds5"].Rows[0]["Sconfig_Value"].ToString().Trim();
  68. this.txtNoLook.Text = dtSet.Tables["ds6"].Rows[0]["Sconfig_Value"].ToString().Trim();
  69. this.txtNoBack.Text = dtSet.Tables["ds7"].Rows[0]["Sconfig_Value"].ToString().Trim();
  70. this.txtNoSend.Text = dtSet.Tables["ds8"].Rows[0]["Sconfig_Value"].ToString().Trim();
  71. this.txtNoPickup.Text = dtSet.Tables["ds9"].Rows[0]["Sconfig_Value"].ToString().Trim();
  72. this.txtNoSend2.Text = dtSet.Tables["ds10"].Rows[0]["Sconfig_Value"].ToString().Trim();
  73. this.txtNoPickup2.Text = dtSet.Tables["ds11"].Rows[0]["Sconfig_Value"].ToString().Trim();
  74. if (dtSet.Tables["ds12"].Rows.Count>0)
  75. {
  76. this.txtSelectNotRefinement.Text = dtSet.Tables["ds12"].Rows[0]["Sconfig_Value"].ToString().Trim();
  77. }
  78. else
  79. {
  80. this.txtSelectNotRefinement.Text = "1";
  81. }
  82. if (dtSet.Tables["ds13"].Rows.Count > 0)
  83. {
  84. this.txtRefinementNotDesign.Text = dtSet.Tables["ds13"].Rows[0]["Sconfig_Value"].ToString().Trim();
  85. }
  86. else
  87. {
  88. this.txtRefinementNotDesign.Text = "1";
  89. }
  90. }
  91. /// <summary>
  92. /// 保存
  93. /// </summary>
  94. /// <param name="sender"></param>
  95. /// <param name="e"></param>
  96. protected override void butnSave_Click(object sender, EventArgs e)
  97. {
  98. DateTime StrTime = SDateTime.Now;
  99. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  100. List<LYFZ.Helper.CommandInfo> clist = new List<Helper.CommandInfo>();
  101. LYFZ.Model.Model_ErpSystemConfigure model = null;
  102. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoShot");
  103. model.Sconfig_Value = this.txtNoShot.Text;
  104. model.Sconfig_CreateDatetime = StrTime;
  105. model.Sconfig_CreateName = StrUserID;
  106. clist.Add(sgbll.GetUpdateCommandInfo(model));
  107. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoShotIn");
  108. model.Sconfig_Value = this.txtNoShotIn.Text;
  109. model.Sconfig_CreateDatetime = StrTime;
  110. model.Sconfig_CreateName = StrUserID;
  111. clist.Add(sgbll.GetUpdateCommandInfo(model));
  112. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoRepair");
  113. model.Sconfig_Value = this.txtNoRepair.Text;
  114. model.Sconfig_CreateDatetime = StrTime;
  115. model.Sconfig_CreateName = StrUserID;
  116. clist.Add(sgbll.GetUpdateCommandInfo(model));
  117. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoSelected");
  118. model.Sconfig_Value = this.txtNoSelected.Text;
  119. model.Sconfig_CreateDatetime = StrTime;
  120. model.Sconfig_CreateName = StrUserID;
  121. clist.Add(sgbll.GetUpdateCommandInfo(model));
  122. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoSelected2");
  123. model.Sconfig_Value = this.txtNoSelected2.Text;
  124. model.Sconfig_CreateDatetime = StrTime;
  125. model.Sconfig_CreateName = StrUserID;
  126. clist.Add(sgbll.GetUpdateCommandInfo(model));
  127. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_SelectNotRefinement");
  128. model.Sconfig_Value = this.txtSelectNotRefinement.Text;
  129. model.Sconfig_CreateDatetime = StrTime;
  130. model.Sconfig_CreateName = StrUserID;
  131. clist.Add(sgbll.GetUpdateCommandInfo(model));
  132. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_RefinementNotDesign");
  133. model.Sconfig_Value = this.txtRefinementNotDesign.Text;
  134. model.Sconfig_CreateDatetime = StrTime;
  135. model.Sconfig_CreateName = StrUserID;
  136. clist.Add(sgbll.GetUpdateCommandInfo(model));
  137. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoDesign");
  138. model.Sconfig_Value = this.txtNoDesign.Text;
  139. model.Sconfig_CreateDatetime = StrTime;
  140. model.Sconfig_CreateName = StrUserID;
  141. clist.Add(sgbll.GetUpdateCommandInfo(model));
  142. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoSend2");
  143. model.Sconfig_Value = this.txtNoSend2.Text;
  144. model.Sconfig_CreateDatetime = StrTime;
  145. model.Sconfig_CreateName = StrUserID;
  146. clist.Add(sgbll.GetUpdateCommandInfo(model));
  147. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoLook");
  148. model.Sconfig_Value = this.txtNoLook.Text;
  149. model.Sconfig_CreateDatetime = StrTime;
  150. model.Sconfig_CreateName = StrUserID;
  151. clist.Add(sgbll.GetUpdateCommandInfo(model));
  152. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoSend");
  153. model.Sconfig_Value = this.txtNoSend.Text;
  154. model.Sconfig_CreateDatetime = StrTime;
  155. model.Sconfig_CreateName = StrUserID;
  156. clist.Add(sgbll.GetUpdateCommandInfo(model));
  157. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoBack");
  158. model.Sconfig_Value = this.txtNoBack.Text;
  159. model.Sconfig_CreateDatetime = StrTime;
  160. model.Sconfig_CreateName = StrUserID;
  161. clist.Add(sgbll.GetUpdateCommandInfo(model));
  162. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoPickup");
  163. model.Sconfig_Value = this.txtNoPickup.Text;
  164. model.Sconfig_CreateDatetime = StrTime;
  165. model.Sconfig_CreateName = StrUserID;
  166. clist.Add(sgbll.GetUpdateCommandInfo(model));
  167. model = sgbll.GetModel("Sconfig_Code", "ProcessMonitor_NoPickup2");
  168. model.Sconfig_Value = this.txtNoPickup2.Text;
  169. model.Sconfig_CreateDatetime = StrTime;
  170. model.Sconfig_CreateName = StrUserID;
  171. clist.Add(sgbll.GetUpdateCommandInfo(model));
  172. List<string> mlist = new List<string>();
  173. mlist.Add("NoShot_" + this.chk_NoShot.Checked.ToString());
  174. mlist.Add("NoShotIn_" + this.chk_NoShotIn.Checked.ToString());
  175. mlist.Add("NoRepair_" + this.chk_NoRepair.Checked.ToString());
  176. mlist.Add("NoSelected_" + this.chk_NoSelected.Checked.ToString());
  177. mlist.Add("NoSelected2_" + this.chk_NoSelected2.Checked.ToString());
  178. mlist.Add("SelectNotRefinement_" + this.chk_SelectNotRefinement.Checked.ToString());
  179. mlist.Add("RefinementNotDesign_" + this.chk_RefinementNotDesign.Checked.ToString());
  180. mlist.Add("NoDesign_" + this.chk_NoDesign.Checked.ToString());
  181. mlist.Add("NoSend2_" + this.chk_NoSend2.Checked.ToString());
  182. mlist.Add("NoLook_" + this.chk_NoLook.Checked.ToString());
  183. mlist.Add("NoSend_" + this.chk_NoSend.Checked.ToString());
  184. mlist.Add("NoBack_" + this.chk_NoBack.Checked.ToString());
  185. mlist.Add("NoPickup_" + this.chk_NoPickup.Checked.ToString());
  186. mlist.Add("NoPickup2_" + this.chk_NoPickup2.Checked.ToString());
  187. int IntFalseCount = 0;
  188. for (int i = 0; i < mlist.Count; i++)
  189. {
  190. string[] StrArray = mlist[i].Trim().Split('_');
  191. if (!Convert.ToBoolean(StrArray[1]))
  192. { IntFalseCount++; }
  193. }
  194. if (IntFalseCount == mlist.Count)
  195. { MessageBoxCustom.Show("界面设置必须有一项为显示!"); return; }
  196. if (MessageBoxCustom.Show("确定要保存吗?", "温馨提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  197. { return; }
  198. if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) <= 0)
  199. { MessageBoxCustom.Show("保存失败!"); return; }
  200. else
  201. {
  202. IsSaveed = true;
  203. sgbll.UpdateProcessMonitorInterfaceManagement(mlist);
  204. MessageBoxCustom.Show("保存成功!");
  205. return;
  206. }
  207. }
  208. /// <summary>
  209. /// 关闭
  210. /// </summary>
  211. /// <param name="sender"></param>
  212. /// <param name="e"></param>
  213. protected override void butnColse_Click(object sender, EventArgs e)
  214. {
  215. this.Close();
  216. }
  217. }
  218. }