Browse Source

设备添加修改删除

章政 7 years ago
parent
commit
4759ee9bde
2 changed files with 39 additions and 27 deletions
  1. 36 24
      UAS_DeviceMonitor/Main.Designer.cs
  2. 3 3
      UAS_DeviceMonitor/Main.cs

+ 36 - 24
UAS_DeviceMonitor/Main.Designer.cs

@@ -63,6 +63,8 @@ namespace UAS_DeviceMonitor
             this.ComboxDeviceListWC_label = new DevExpress.XtraEditors.LabelControl();
             this.GridDeviceList = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewDeviceList = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
+            this.DeviceListCheckedColumn = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.dpc_enableCheckEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.de_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.de_code = new DevExpress.XtraGrid.Columns.GridColumn();
             this.de_name = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -105,7 +107,6 @@ namespace UAS_DeviceMonitor
             this.GridDeviceNetSetting = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewDeviceNetSetting = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
             this.NetSettingCheckedColumn = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.dpc_enableCheckEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.dnc_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dnc_decode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dnc_getway = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -175,6 +176,7 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.ComboxDeviceListLC.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceList)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceList)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).BeginInit();
             this.PageCommandSet.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.Brand.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridCommandSetting)).BeginInit();
@@ -184,7 +186,6 @@ namespace UAS_DeviceMonitor
             this.PageDeviceNetSetting.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceNetSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceNetSetting)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).BeginInit();
             this.PagePollingSetting.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridPollingSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPollSetting)).BeginInit();
@@ -516,6 +517,7 @@ namespace UAS_DeviceMonitor
             // GridViewDeviceList
             // 
             this.GridViewDeviceList.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
+            this.DeviceListCheckedColumn,
             this.de_id,
             this.de_code,
             this.de_name,
@@ -536,6 +538,24 @@ namespace UAS_DeviceMonitor
             this.GridViewDeviceList.OptionsView.ShowGroupPanel = false;
             this.GridViewDeviceList.RowCellClick += new DevExpress.XtraGrid.Views.Grid.RowCellClickEventHandler(this.GridViewDeviceList_RowCellClick);
             // 
+            // DeviceListCheckedColumn
+            // 
+            this.DeviceListCheckedColumn.Caption = " ";
+            this.DeviceListCheckedColumn.ColumnEdit = this.dpc_enableCheckEdit;
+            this.DeviceListCheckedColumn.FieldName = "CHECKEDCOLUMN";
+            this.DeviceListCheckedColumn.Name = "DeviceListCheckedColumn";
+            this.DeviceListCheckedColumn.Visible = true;
+            this.DeviceListCheckedColumn.VisibleIndex = 0;
+            // 
+            // dpc_enableCheckEdit
+            // 
+            this.dpc_enableCheckEdit.AutoHeight = false;
+            this.dpc_enableCheckEdit.Name = "dpc_enableCheckEdit";
+            this.dpc_enableCheckEdit.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
+            this.dpc_enableCheckEdit.NullText = "0";
+            this.dpc_enableCheckEdit.ValueChecked = "-1";
+            this.dpc_enableCheckEdit.ValueUnchecked = "0";
+            // 
             // de_id
             // 
             this.de_id.Caption = "de_id";
@@ -548,7 +568,7 @@ namespace UAS_DeviceMonitor
             this.de_code.FieldName = "DE_CODE";
             this.de_code.Name = "de_code";
             this.de_code.Visible = true;
-            this.de_code.VisibleIndex = 0;
+            this.de_code.VisibleIndex = 1;
             // 
             // de_name
             // 
@@ -556,7 +576,7 @@ namespace UAS_DeviceMonitor
             this.de_name.FieldName = "DE_NAME";
             this.de_name.Name = "de_name";
             this.de_name.Visible = true;
-            this.de_name.VisibleIndex = 1;
+            this.de_name.VisibleIndex = 2;
             // 
             // de_runstatus
             // 
@@ -564,7 +584,7 @@ namespace UAS_DeviceMonitor
             this.de_runstatus.FieldName = "DE_RUNSTATUS";
             this.de_runstatus.Name = "de_runstatus";
             this.de_runstatus.Visible = true;
-            this.de_runstatus.VisibleIndex = 2;
+            this.de_runstatus.VisibleIndex = 3;
             // 
             // de_stepcode
             // 
@@ -572,7 +592,7 @@ namespace UAS_DeviceMonitor
             this.de_stepcode.FieldName = "DE_STEPCODE";
             this.de_stepcode.Name = "de_stepcode";
             this.de_stepcode.Visible = true;
-            this.de_stepcode.VisibleIndex = 4;
+            this.de_stepcode.VisibleIndex = 5;
             // 
             // de_stepname
             // 
@@ -580,7 +600,7 @@ namespace UAS_DeviceMonitor
             this.de_stepname.FieldName = "DE_STEPNAME";
             this.de_stepname.Name = "de_stepname";
             this.de_stepname.Visible = true;
-            this.de_stepname.VisibleIndex = 5;
+            this.de_stepname.VisibleIndex = 6;
             // 
             // de_indate
             // 
@@ -591,7 +611,7 @@ namespace UAS_DeviceMonitor
             this.de_indate.FilterMode = DevExpress.XtraGrid.ColumnFilterMode.DisplayText;
             this.de_indate.Name = "de_indate";
             this.de_indate.Visible = true;
-            this.de_indate.VisibleIndex = 3;
+            this.de_indate.VisibleIndex = 4;
             // 
             // de_spec
             // 
@@ -599,7 +619,7 @@ namespace UAS_DeviceMonitor
             this.de_spec.FieldName = "DE_SPEC";
             this.de_spec.Name = "de_spec";
             this.de_spec.Visible = true;
-            this.de_spec.VisibleIndex = 6;
+            this.de_spec.VisibleIndex = 7;
             // 
             // de_inman
             // 
@@ -607,7 +627,7 @@ namespace UAS_DeviceMonitor
             this.de_inman.FieldName = "DE_INMAN";
             this.de_inman.Name = "de_inman";
             this.de_inman.Visible = true;
-            this.de_inman.VisibleIndex = 7;
+            this.de_inman.VisibleIndex = 8;
             // 
             // de_vendcode
             // 
@@ -621,7 +641,7 @@ namespace UAS_DeviceMonitor
             this.de_vendname.FieldName = "DE_VENDNAME";
             this.de_vendname.Name = "de_vendname";
             this.de_vendname.Visible = true;
-            this.de_vendname.VisibleIndex = 8;
+            this.de_vendname.VisibleIndex = 9;
             // 
             // de_address
             // 
@@ -629,7 +649,7 @@ namespace UAS_DeviceMonitor
             this.de_address.FieldName = "DE_ADDRESS";
             this.de_address.Name = "de_address";
             this.de_address.Visible = true;
-            this.de_address.VisibleIndex = 9;
+            this.de_address.VisibleIndex = 10;
             // 
             // de_linecode
             // 
@@ -637,7 +657,7 @@ namespace UAS_DeviceMonitor
             this.de_linecode.FieldName = "DE_LINECODE";
             this.de_linecode.Name = "de_linecode";
             this.de_linecode.Visible = true;
-            this.de_linecode.VisibleIndex = 10;
+            this.de_linecode.VisibleIndex = 11;
             // 
             // de_wccode
             // 
@@ -645,7 +665,7 @@ namespace UAS_DeviceMonitor
             this.de_wccode.FieldName = "DE_WCCODE";
             this.de_wccode.Name = "de_wccode";
             this.de_wccode.Visible = true;
-            this.de_wccode.VisibleIndex = 11;
+            this.de_wccode.VisibleIndex = 12;
             // 
             // PageCommandSet
             // 
@@ -965,15 +985,6 @@ namespace UAS_DeviceMonitor
             this.NetSettingCheckedColumn.Visible = true;
             this.NetSettingCheckedColumn.VisibleIndex = 0;
             // 
-            // dpc_enableCheckEdit
-            // 
-            this.dpc_enableCheckEdit.AutoHeight = false;
-            this.dpc_enableCheckEdit.Name = "dpc_enableCheckEdit";
-            this.dpc_enableCheckEdit.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
-            this.dpc_enableCheckEdit.NullText = "0";
-            this.dpc_enableCheckEdit.ValueChecked = "-1";
-            this.dpc_enableCheckEdit.ValueUnchecked = "0";
-            // 
             // dnc_id
             // 
             this.dnc_id.Caption = "ID";
@@ -1604,6 +1615,7 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.ComboxDeviceListLC.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceList)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceList)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).EndInit();
             this.PageCommandSet.ResumeLayout(false);
             this.PageCommandSet.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.Brand.Properties)).EndInit();
@@ -1614,7 +1626,6 @@ namespace UAS_DeviceMonitor
             this.PageDeviceNetSetting.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridDeviceNetSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceNetSetting)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).EndInit();
             this.PagePollingSetting.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridPollingSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPollSetting)).EndInit();
@@ -1769,5 +1780,6 @@ namespace UAS_DeviceMonitor
         private CustomerControl.Button.ButtonAddRow ButtonAddDevice;
         private CustomerControl.Button.ButtonDeleteRow ButtonDeleteDevice;
         private CustomerControl.Button.ButtonSaveGrid ButtonSaveDevice;
+        private DevExpress.XtraGrid.Columns.GridColumn DeviceListCheckedColumn;
     }
 }

+ 3 - 3
UAS_DeviceMonitor/Main.cs

@@ -78,7 +78,7 @@ namespace UAS_DeviceMonitor
         private void Main_Load(object sender, EventArgs e)
         {
             //设备列表
-            GridDeviceList.GetDataSQL = "select de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_inman,de_linecode,de_wccode,de_vendcode,de_vendname,de_stepcode,de_stepname from device order by de_code".ToUpper();
+            GridDeviceList.GetDataSQL = "SELECT 0 CHECKEDCOLUMN,DE_ID,DE_CODE,DE_NAME,DE_SPEC,DE_INDATE,DE_RUNSTATUS,DE_ADDRESS,DE_INMAN,DE_LINECODE,DE_WCCODE,DE_VENDCODE,DE_VENDNAME,DE_STEPCODE,DE_STEPNAME FROM DEVICE ORDER BY DE_CODE".ToUpper();
             GridDeviceList.TableName = "device";
             GridDeviceList.ID = "de_id";
             GridDeviceList.InsertSQL = "INSERT INTO DEVICE(DE_ID,DE_CODE,DE_NAME,DE_SPEC,DE_INDATE,DE_RUNSTATUS,DE_ADDRESS,DE_INMAN,DE_LINECODE,DE_WCCODE,DE_VENDCODE,DE_VENDNAME,DE_STEPCODE,DE_STEPNAME) VALUES(DEVICE_SEQ.NEXTVAL,:DE_CODE,:DE_NAME,:DE_SPEC,:DE_INDATE,:DE_RUNSTATUS,:DE_ADDRESS,:DE_INMAN,:DE_LINECODE,:DE_WCCODE,:DE_VENDCODE,:DE_VENDNAME,:DE_STEPCODE,:DE_STEPNAME)";
@@ -160,7 +160,7 @@ namespace UAS_DeviceMonitor
         {
             DeviceListQuerySQL.Clear();
             string WC = BaseUtil.GetComboxEditValue(ComboxDeviceListWC);
-            DeviceListQuerySQL.Append("select de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_wccode,de_inman,de_linecode");
+            DeviceListQuerySQL.Append("select  0 CHECKEDCOLUMN,de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_wccode,de_inman,de_linecode");
             DeviceListQuerySQL.Append("de_vendcode,de_vendname,de_stepcode,de_stepname from device where de_wccode='" + WC + "' order by de_code");
             sql.Clear();
             if (WC == "全部")
@@ -177,7 +177,7 @@ namespace UAS_DeviceMonitor
             DeviceListQuerySQL.Clear();
             string WC = BaseUtil.GetComboxEditValue(ComboxDeviceListWC);
             string LC = BaseUtil.GetComboxEditValue(ComboxDeviceListLC);
-            DeviceListQuerySQL.Append("select de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_wccode, ");
+            DeviceListQuerySQL.Append("select 0 CHECKEDCOLUMN,de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_wccode, ");
             DeviceListQuerySQL.Append("de_vendcode,de_vendname,de_inman,de_linecode,de_stepcode,de_stepname from device ");
             if (WC != "全部" && LC != "全部")
                 DeviceListQuerySQL.Append(" where de_wccode='" + WC + "' and de_linecode='" + LC + "' ");