SetProcessAlertSuperSmallForm.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. namespace LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm
  11. {
  12. public partial class SetProcessAlertSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.SetProcessAlertSuperSmallForm
  13. {
  14. public SetProcessAlertSuperSmallForm()
  15. {
  16. }
  17. public bool IsSave = false;
  18. /// <summary>
  19. /// 窗体加载
  20. /// </summary>
  21. /// <param name="sender"></param>
  22. /// <param name="e"></param>
  23. protected override void SetProcessAlertSuperSmallForm_Load(object sender, EventArgs e)
  24. {
  25. DataTable tbl = new BLL.BLL_ErpSystemConfigure().GetSystemConfigureCustom("Sconfig_Code,Sconfig_Value", "Sconfig_Remark = 'Alert'").Tables[0];
  26. for (int i = 0; i < tbl.Rows.Count; i++)
  27. {
  28. if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_OrderLater_NotShot")
  29. {
  30. this.txtA.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
  31. this.txtA.Tag = "ProcessMonitor_OrderLater_NotShot";
  32. }
  33. else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_photographedLater_NotEnd")
  34. {
  35. this.txtB.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
  36. this.txtB.Tag = "ProcessMonitor_photographedLater_NotEnd";
  37. }
  38. else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_photograpOKLater_NotSelect")
  39. {
  40. this.txtC.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
  41. this.txtC.Tag = "ProcessMonitor_photograpOKLater_NotSelect";
  42. }
  43. else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotLook")
  44. {
  45. this.txtD.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
  46. this.txtD.Tag = "ProcessMonitor_SelectOKLater_NotLook";
  47. }
  48. else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotQi")
  49. {
  50. this.txtE.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
  51. this.txtE.Tag = "ProcessMonitor_SelectOKLater_NotQi";
  52. }
  53. else if (tbl.Rows[i]["Sconfig_Code"].ToString().Trim() == "ProcessMonitor_SelectOKLater_NotTake")
  54. {
  55. this.txtF.Text = tbl.Rows[i]["Sconfig_Value"].ToString().Trim();
  56. this.txtF.Tag = "ProcessMonitor_SelectOKLater_NotTake";
  57. }
  58. }
  59. }
  60. /// <summary>
  61. /// 保存
  62. /// </summary>
  63. /// <param name="sender"></param>
  64. /// <param name="e"></param>
  65. protected override void btnSave_Click(object sender, EventArgs e)
  66. {
  67. Hashtable htData = new Hashtable();
  68. htData["Sconfig_Code = '" + this.txtA.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtA.Text.Trim() + "'";
  69. htData["Sconfig_Code = '" + this.txtB.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtB.Text.Trim() + "'";
  70. htData["Sconfig_Code = '" + this.txtC.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtC.Text.Trim() + "'";
  71. htData["Sconfig_Code = '" + this.txtD.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtD.Text.Trim() + "'";
  72. htData["Sconfig_Code = '" + this.txtE.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtE.Text.Trim() + "'";
  73. htData["Sconfig_Code = '" + this.txtF.Tag.ToString().Trim() + "'"] = "Sconfig_Value = '" + this.txtF.Text.Trim() + "'";
  74. if (htData.Count > 0)
  75. {
  76. if (new BLL.BLL_ErpSystemConfigure().UpdateToErpSystemConfigure(htData) > 0)
  77. { IsSave = true; MessageBoxCustom.Show("保存成功"); this.Close(); return; }
  78. }
  79. MessageBoxCustom.Show("保存出错");
  80. }
  81. /// <summary>
  82. /// 取消
  83. /// </summary>
  84. /// <param name="sender"></param>
  85. /// <param name="e"></param>
  86. protected override void btnCancel_Click(object sender, EventArgs e)
  87. { this.Close(); }
  88. /// <summary>
  89. ///
  90. /// </summary>
  91. /// <param name="sender"></param>
  92. /// <param name="e"></param>
  93. protected override void txtF_KeyPress(object sender, KeyPressEventArgs e)
  94. {
  95. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  96. { e.Handled = true; }
  97. }
  98. /// <summary>
  99. ///
  100. /// </summary>
  101. /// <param name="sender"></param>
  102. /// <param name="e"></param>
  103. protected override void txtE_KeyPress(object sender, KeyPressEventArgs e)
  104. {
  105. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  106. { e.Handled = true; }
  107. }
  108. /// <summary>
  109. ///
  110. /// </summary>
  111. /// <param name="sender"></param>
  112. /// <param name="e"></param>
  113. protected override void txtD_KeyPress(object sender, KeyPressEventArgs e)
  114. {
  115. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  116. { e.Handled = true; }
  117. }
  118. /// <summary>
  119. ///
  120. /// </summary>
  121. /// <param name="sender"></param>
  122. /// <param name="e"></param>
  123. protected override void txtC_KeyPress(object sender, KeyPressEventArgs e)
  124. {
  125. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  126. { e.Handled = true; }
  127. }
  128. /// <summary>
  129. ///
  130. /// </summary>
  131. /// <param name="sender"></param>
  132. /// <param name="e"></param>
  133. protected override void txtB_KeyPress(object sender, KeyPressEventArgs e)
  134. {
  135. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  136. { e.Handled = true; }
  137. }
  138. /// <summary>
  139. ///
  140. /// </summary>
  141. /// <param name="sender"></param>
  142. /// <param name="e"></param>
  143. protected override void txtA_KeyPress(object sender, KeyPressEventArgs e)
  144. {
  145. if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
  146. { e.Handled = true; }
  147. }
  148. }
  149. }