using DevComponents.DotNetBar.Layout; using DevComponents.DotNetBar.SuperGrid; using System; using System.Collections.Generic; using System.Data; using System.Windows.Forms; using WCS_Client.UC; using WCS_Client.Utility; namespace WCS_Client.Frm { public partial class FrmEquMsg : Form { public FrmEquMsg() { InitializeComponent(); InitFrm(); } private void InitFrm() { List GCList = new List() { SuperGridUtil.Get_GridColumn("DEVICECODE", "设备编号", 80), //SuperGridUtil.Get_GridColumn("Equ_PlcName", "PLC名称", 100), //SuperGridUtil.Get_GridColumn("Equ_Area", "设备区域", 100), //SuperGridUtil.Get_GridColumn("Equ_Type", "设备类型", 100), //SuperGridUtil.Get_GridColumn("Equ_BarCode", "条码", 100), //SuperGridUtil.Get_GridColumn("Equ_SystemStatus", "系统状态", 100), //SuperGridUtil.Get_GridColumn("Equ_WorkMode", "工作模式", 100), //SuperGridUtil.Get_GridColumn("Equ_AlaramsMsg", "报警消息", 500), ////SuperGridUtil.Get_GridColumn("PLC_NOTES", "说明", 200), //SuperGridUtil.Get_GridColumn("Equ_Notes", "备注", 200) }; List LCIList = new List(); LCIList.Add(LCItemUtil.Add_TextboxX("STA_EQUIPMENTNO", "设备编号:", 20, SubmitMethods, null)); LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "DEVICECODE like '%{0}%'" }; //LCIList.Add(LCItemUtil.Add_TextboxX("STA_PLCNAME", "PLC名称:", 20, SubmitMethods, null)); //LCIList[LCIList.Count - 1].Tag = new LCWhereInfo() { QWhereText = "Equ_PlcName like '%{0}%'" }; LCIList.Add(LCItemUtil.Add_ButtonX("btn_QDB", "查询", 80, 30, SubmitMethods)); LCIList.Add(LCItemUtil.Add_ButtonX("btn_QClear", "重置", 80, 30, SubmitMethods)); //LCIList.Add(LCItemUtil.Add_ButtonX("updateEquNotes", "修改备注", 100, 30, SubmitMethods)); uC_QueryPage1.Init_QueryPage(30, true, true, "", GCList, LCIList, QueryPageDataMethodsms, RefreshRoleMethodsms, DoubleClikMethod, null, ClikMethod); CommonShow.ShowProcessing("正在处理中,请稍候...", this, (obj) => { uC_QueryPage1.RefreshData(1, 0); }, null); } private PageData QueryPageDataMethodsms(int PageIndex, int PageSize) { string _SQLText = string.Format(@"SELECT distinct(DEVICECODE) FROM [dbo].[WCS_DEVICEPROTOCOL] WHERE ENABLED=1 "); string _Orderby = "DEVICECODE asc"; PageData pd = BaseWorkflow.QueryPageData(_SQLText, _Orderby, uC_QueryPage1.GetQueryWhere(), PageIndex, 3000); return pd; } private void SubmitMethods(string LCName) { if (LCName == "btn_QDB") { uC_QueryPage1.RefreshData(); } else if (LCName == "btn_QClear") { uC_QueryPage1.ShowOpaqueLayer(); uC_QueryPage1.ClearLCItemValue(); uC_QueryPage1.RefreshData(1, 0); uC_QueryPage1.HideOpaqueLayer(); } else if (LCName == "updateEquNotes") { DataTable dt = this.uC_QueryPage1.SCGrid_GetChkRows(); if (dt == null || dt.Rows.Count == 0) { MessageUtil.ShowTips("请选择配置信息。"); return; } var frmupdate = new Frm.MBtn_Monitor.FrmUpdateEquMsg(dt.Rows[0]); frmupdate.ShowDialog(); uC_QueryPage1.RefreshData(1, 0); } } private void RefreshRoleMethodsms(bool ChkValue) { } private void DoubleClikMethod(DataRow dr) { Current.RefreshData(); string code = dr["DEVICECODE"].ToString(); //var pack = eqpData.deviceDataPack; //if (code.Contains("SRM")) //{ //} //else if (code.Contains("BCR")) //{ //} //else if (code.Contains("RGV")) //{ //} //else //{ //} FrmEquMsg_dtl Frm = new FrmEquMsg_dtl(code); Frm.Show(); } private void ClikMethod(DataRow dr) { try { } catch (Exception ex) { MessageUtil.ShowTips(ex.Message); } } } }