Frm_ALARAMRE.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using DevComponents.DotNetBar.Layout;
  2. using DevComponents.DotNetBar.SuperGrid;
  3. using System;
  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.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using WCS_Client.UC;
  13. using WCS_Client.Utility;
  14. namespace WCS_Client.Frm
  15. {
  16. public partial class Frm_ALARAMRE : Form
  17. {
  18. public Frm_ALARAMRE()
  19. {
  20. InitializeComponent();
  21. InitFrm();
  22. }
  23. private void InitFrm()
  24. {
  25. List<GridColumn> GCList = new List<GridColumn>()
  26. {
  27. SuperGridUtil.Get_GridColumn("ALARAMR_EQUNO", "设备编号", 80),
  28. SuperGridUtil.Get_GridColumn("ALARAMR_EQUTYPE", "设备类型", 100),
  29. SuperGridUtil.Get_GridColumn("ALARAMR_ALARAMNO", "故障代码", 100),
  30. SuperGridUtil.Get_GridColumn("ALARAMR_ALARAMMSG", "故障信息", 400),
  31. SuperGridUtil.Get_Datetime_GridColumn("ALARAMR_ALARAMSTARTTIME", "报警时间", 200),
  32. SuperGridUtil.Get_Datetime_GridColumn("ALARAMR_ALARAMENDTIME", "结束时间", 200)
  33. };
  34. List<LayoutControlItem> LCIList = new List<LayoutControlItem>();
  35. LCIList.Add(LCItemUtil.Add_TextboxX("ALARAMR_EQUNO", "设备编号:", 20, SubmitMethods, null));
  36. LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "ALARAMR_EQUNO like '%{0}%'" };
  37. LCIList.Add(LCItemUtil.Add_TextboxX("ALARAMR_EQUTYPE", "设备类型:", 20, SubmitMethods, null));
  38. LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "ALARAMR_EQUTYPE like '%{0}%'" };
  39. LCIList.Add(LCItemUtil.Add_ButtonX("btn_QDB", "查询", 80, 30, SubmitMethods));
  40. LCIList.Add(LCItemUtil.Add_ButtonX("btn_QClear", "重置", 80, 30, SubmitMethods));
  41. uC_QueryPage1.Init_QueryPage(30, true, true, "", GCList, LCIList, QueryPageDataMethodsms, RefreshRoleMethodsms, null, null, null);
  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 [ALARAMR_EQUNO],[ALARAMR_EQUTYPE],[ALARAMR_ALARAMNO],[ALARAMR_ALARAMMSG],[ALARAMR_ALARAMSTARTTIME],[ALARAMR_ALARAMENDTIME]
  50. FROM [dbo].[WCS_ALARAMRECORD] where 1=1 and [ALARAMR_ALARAMENDTIME] is not null");
  51. string _Orderby = "ALARAMR_ALARAMSTARTTIME desc";
  52. PageData pd = BaseWorkflow.QueryPageData(_SQLText, _Orderby, uC_QueryPage1.GetQueryWhere(), PageIndex, 1000);
  53. return pd;
  54. }
  55. private void SubmitMethods(string LCName)
  56. {
  57. if (LCName == "btn_QDB")
  58. {
  59. uC_QueryPage1.RefreshData();
  60. }
  61. else if (LCName == "btn_QClear")
  62. {
  63. uC_QueryPage1.ShowOpaqueLayer();
  64. uC_QueryPage1.ClearLCItemValue();
  65. uC_QueryPage1.RefreshData(1, 0);
  66. uC_QueryPage1.HideOpaqueLayer();
  67. }
  68. }
  69. private void RefreshRoleMethodsms(bool ChkValue)
  70. {
  71. }
  72. }
  73. }