FrmEquMsg.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. using DevComponents.DotNetBar.Layout;
  2. using DevComponents.DotNetBar.SuperGrid;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Windows.Forms;
  7. using WCS_Client.UC;
  8. using WCS_Client.Utility;
  9. namespace WCS_Client.Frm
  10. {
  11. public partial class FrmEquMsg : Form
  12. {
  13. public FrmEquMsg()
  14. {
  15. InitializeComponent();
  16. InitFrm();
  17. }
  18. private void InitFrm()
  19. {
  20. List<GridColumn> GCList = new List<GridColumn>()
  21. {
  22. SuperGridUtil.Get_GridColumn("DEVICECODE", "设备编号", 80),
  23. //SuperGridUtil.Get_GridColumn("Equ_PlcName", "PLC名称", 100),
  24. //SuperGridUtil.Get_GridColumn("Equ_Area", "设备区域", 100),
  25. //SuperGridUtil.Get_GridColumn("Equ_Type", "设备类型", 100),
  26. //SuperGridUtil.Get_GridColumn("Equ_BarCode", "条码", 100),
  27. //SuperGridUtil.Get_GridColumn("Equ_SystemStatus", "系统状态", 100),
  28. //SuperGridUtil.Get_GridColumn("Equ_WorkMode", "工作模式", 100),
  29. //SuperGridUtil.Get_GridColumn("Equ_AlaramsMsg", "报警消息", 500),
  30. ////SuperGridUtil.Get_GridColumn("PLC_NOTES", "说明", 200),
  31. //SuperGridUtil.Get_GridColumn("Equ_Notes", "备注", 200)
  32. };
  33. List<LayoutControlItem> LCIList = new List<LayoutControlItem>();
  34. LCIList.Add(LCItemUtil.Add_TextboxX("STA_EQUIPMENTNO", "设备编号:", 20, SubmitMethods, null));
  35. LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "DEVICECODE like '%{0}%'" };
  36. //LCIList.Add(LCItemUtil.Add_TextboxX("STA_PLCNAME", "PLC名称:", 20, SubmitMethods, null));
  37. //LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "Equ_PlcName like '%{0}%'" };
  38. LCIList.Add(LCItemUtil.Add_ButtonX("btn_QDB", "查询", 80, 30, SubmitMethods));
  39. LCIList.Add(LCItemUtil.Add_ButtonX("btn_QClear", "重置", 80, 30, SubmitMethods));
  40. //LCIList.Add(LCItemUtil.Add_ButtonX("updateEquNotes", "修改备注", 100, 30, SubmitMethods));
  41. uC_QueryPage1.Init_QueryPage(30, true, true, "", GCList, LCIList, QueryPageDataMethodsms, RefreshRoleMethodsms, DoubleClikMethod, null, ClikMethod);
  42. CommonShow.ShowProcessing("正在处理中,请稍候...", this, (obj) =>
  43. {
  44. uC_QueryPage1.RefreshData(1, 0);
  45. }, null);
  46. }
  47. private PageData QueryPageDataMethodsms(int PageIndex, int PageSize)
  48. {
  49. string _SQLText = string.Format(@"SELECT distinct(DEVICECODE) FROM [dbo].[WCS_DEVICEPROTOCOL] WHERE ENABLED=1 ");
  50. string _Orderby = "DEVICECODE asc";
  51. PageData pd = BaseWorkflow.QueryPageData(_SQLText, _Orderby, uC_QueryPage1.GetQueryWhere(), PageIndex, 3000);
  52. return pd;
  53. }
  54. private void SubmitMethods(string LCName)
  55. {
  56. if (LCName == "btn_QDB")
  57. {
  58. uC_QueryPage1.RefreshData();
  59. }
  60. else if (LCName == "btn_QClear")
  61. {
  62. uC_QueryPage1.ShowOpaqueLayer();
  63. uC_QueryPage1.ClearLCItemValue();
  64. uC_QueryPage1.RefreshData(1, 0);
  65. uC_QueryPage1.HideOpaqueLayer();
  66. }
  67. else if (LCName == "updateEquNotes")
  68. {
  69. DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows();
  70. if (dt == null || dt.Rows.Count == 0)
  71. {
  72. MessageUtil.ShowTips("请选择配置信息。");
  73. return;
  74. }
  75. var frmupdate = new Frm.MBtn_Monitor.FrmUpdateEquMsg(dt.Rows[0]);
  76. frmupdate.ShowDialog();
  77. uC_QueryPage1.RefreshData(1, 0);
  78. }
  79. }
  80. private void RefreshRoleMethodsms(bool ChkValue)
  81. {
  82. }
  83. private void DoubleClikMethod(DataRow dr)
  84. {
  85. Current.RefreshData();
  86. string code = dr["DEVICECODE"].ToString();
  87. //var pack = eqpData.deviceDataPack;
  88. //if (code.Contains("SRM"))
  89. //{
  90. //}
  91. //else if (code.Contains("BCR"))
  92. //{
  93. //}
  94. //else if (code.Contains("RGV"))
  95. //{
  96. //}
  97. //else
  98. //{
  99. //}
  100. FrmEquMsg_dtl Frm = new FrmEquMsg_dtl(code);
  101. Frm.Show();
  102. }
  103. private void ClikMethod(DataRow dr)
  104. {
  105. try
  106. {
  107. }
  108. catch (Exception ex)
  109. {
  110. MessageUtil.ShowTips(ex.Message);
  111. }
  112. }
  113. }
  114. }