Przeglądaj źródła

修改选择列

章政 7 lat temu
rodzic
commit
c13c233835
2 zmienionych plików z 90 dodań i 21 usunięć
  1. 71 15
      UAS_DeviceMonitor/Main.Designer.cs
  2. 19 6
      UAS_DeviceMonitor/Main.cs

+ 71 - 15
UAS_DeviceMonitor/Main.Designer.cs

@@ -68,11 +68,12 @@ namespace UAS_DeviceMonitor
             this.ButtonSaveCommand = new UAS_DeviceMonitor.CustomerControl.Button.ButtonSaveGrid();
             this.GridCommandSetting = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewCommandSet = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
+            this.CommandSetCheckedColumn = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.CheckEditCommandSet = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.dc_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_code = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_name = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_command = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.CheckEditCommandSet = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.PageDeviceKind = new DevExpress.XtraTab.XtraTabPage();
             this.PageDeviceStatus = new DevExpress.XtraTab.XtraTabPage();
             this.PagePollingSetting = new DevExpress.XtraTab.XtraTabPage();
@@ -88,6 +89,8 @@ namespace UAS_DeviceMonitor
             this.dpc_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_decode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_plcode = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.PollSettingItemSearchLookUpEdit = new DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit();
+            this.PollSettingItemSearchLookUpEditView = new DevExpress.XtraGrid.Views.Grid.GridView();
             this.dpc_plname = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_interval = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_dccode = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -103,6 +106,7 @@ namespace UAS_DeviceMonitor
             this.ButtonSavePolling = new UAS_DeviceMonitor.CustomerControl.Button.ButtonSaveGrid();
             this.GridPolling = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewPolling = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
+            this.PollingCheckedColumn = new DevExpress.XtraGrid.Columns.GridColumn();
             this.pl_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.pl_code = new DevExpress.XtraGrid.Columns.GridColumn();
             this.pl_name = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -124,6 +128,8 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.GridPollingSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPollSetting)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PollSettingItemSearchLookUpEdit)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PollSettingItemSearchLookUpEditView)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PollingSetItemLookUpEdit)).BeginInit();
             this.PagePolling.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).BeginInit();
@@ -487,6 +493,7 @@ namespace UAS_DeviceMonitor
             // GridViewCommandSet
             // 
             this.GridViewCommandSet.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
+            this.CommandSetCheckedColumn,
             this.dc_id,
             this.dc_code,
             this.dc_name,
@@ -494,8 +501,23 @@ namespace UAS_DeviceMonitor
             this.GridViewCommandSet.GridControl = this.GridCommandSetting;
             this.GridViewCommandSet.IndicatorWidth = 30;
             this.GridViewCommandSet.Name = "GridViewCommandSet";
-            this.GridViewCommandSet.OptionsSelection.MultiSelect = true;
-            this.GridViewCommandSet.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
+            // 
+            // CommandSetCheckedColumn
+            // 
+            this.CommandSetCheckedColumn.Caption = " ";
+            this.CommandSetCheckedColumn.ColumnEdit = this.CheckEditCommandSet;
+            this.CommandSetCheckedColumn.FieldName = "CHECKEDCOLUMN";
+            this.CommandSetCheckedColumn.Name = "CommandSetCheckedColumn";
+            this.CommandSetCheckedColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
+            this.CommandSetCheckedColumn.Tag = "0";
+            this.CommandSetCheckedColumn.Visible = true;
+            this.CommandSetCheckedColumn.VisibleIndex = 0;
+            // 
+            // CheckEditCommandSet
+            // 
+            this.CheckEditCommandSet.AutoHeight = false;
+            this.CheckEditCommandSet.Name = "CheckEditCommandSet";
+            this.CheckEditCommandSet.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
             // 
             // dc_id
             // 
@@ -529,12 +551,6 @@ namespace UAS_DeviceMonitor
             this.dc_command.VisibleIndex = 3;
             this.dc_command.Width = 768;
             // 
-            // CheckEditCommandSet
-            // 
-            this.CheckEditCommandSet.AutoHeight = false;
-            this.CheckEditCommandSet.Name = "CheckEditCommandSet";
-            this.CheckEditCommandSet.NullStyle = DevExpress.XtraEditors.Controls.StyleIndeterminate.Unchecked;
-            // 
             // PageDeviceKind
             // 
             this.PageDeviceKind.Name = "PageDeviceKind";
@@ -629,7 +645,8 @@ namespace UAS_DeviceMonitor
             this.GridPollingSetting.Name = "GridPollingSetting";
             this.GridPollingSetting.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
             this.dpc_enableCheckEdit,
-            this.PollingSetItemLookUpEdit});
+            this.PollingSetItemLookUpEdit,
+            this.PollSettingItemSearchLookUpEdit});
             this.GridPollingSetting.RowCount = 0;
             this.GridPollingSetting.Size = new System.Drawing.Size(1027, 544);
             this.GridPollingSetting.TabIndex = 0;
@@ -698,12 +715,29 @@ namespace UAS_DeviceMonitor
             // dpc_plcode
             // 
             this.dpc_plcode.Caption = "业务编号";
+            this.dpc_plcode.ColumnEdit = this.PollSettingItemSearchLookUpEdit;
             this.dpc_plcode.FieldName = "DPC_PLCODE";
             this.dpc_plcode.Name = "dpc_plcode";
             this.dpc_plcode.Visible = true;
             this.dpc_plcode.VisibleIndex = 2;
             this.dpc_plcode.Width = 90;
             // 
+            // PollSettingItemSearchLookUpEdit
+            // 
+            this.PollSettingItemSearchLookUpEdit.AutoHeight = false;
+            this.PollSettingItemSearchLookUpEdit.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.PollSettingItemSearchLookUpEdit.Name = "PollSettingItemSearchLookUpEdit";
+            this.PollSettingItemSearchLookUpEdit.NullText = "";
+            this.PollSettingItemSearchLookUpEdit.View = this.PollSettingItemSearchLookUpEditView;
+            // 
+            // PollSettingItemSearchLookUpEditView
+            // 
+            this.PollSettingItemSearchLookUpEditView.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
+            this.PollSettingItemSearchLookUpEditView.Name = "PollSettingItemSearchLookUpEditView";
+            this.PollSettingItemSearchLookUpEditView.OptionsSelection.EnableAppearanceFocusedCell = false;
+            this.PollSettingItemSearchLookUpEditView.OptionsView.ShowGroupPanel = false;
+            // 
             // dpc_plname
             // 
             this.dpc_plname.Caption = "业务名称";
@@ -844,16 +878,20 @@ namespace UAS_DeviceMonitor
             this.GridPolling.MainView = this.GridViewPolling;
             this.GridPolling.MenuManager = this.RibbonNav;
             this.GridPolling.Name = "GridPolling";
+            this.GridPolling.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
+            this.dpc_enableCheckEdit});
             this.GridPolling.RowCount = 0;
             this.GridPolling.Size = new System.Drawing.Size(1027, 549);
             this.GridPolling.TabIndex = 0;
             this.GridPolling.TableName = null;
             this.GridPolling.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
             this.GridViewPolling});
+            this.GridPolling.VisibleChanged += new System.EventHandler(this.GridPolling_VisibleChanged);
             // 
             // GridViewPolling
             // 
             this.GridViewPolling.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
+            this.PollingCheckedColumn,
             this.pl_id,
             this.pl_code,
             this.pl_name,
@@ -864,6 +902,17 @@ namespace UAS_DeviceMonitor
             this.GridViewPolling.IndicatorWidth = 30;
             this.GridViewPolling.Name = "GridViewPolling";
             // 
+            // PollingCheckedColumn
+            // 
+            this.PollingCheckedColumn.Caption = " ";
+            this.PollingCheckedColumn.ColumnEdit = this.dpc_enableCheckEdit;
+            this.PollingCheckedColumn.FieldName = "CHECKEDCOLUMN";
+            this.PollingCheckedColumn.Name = "PollingCheckedColumn";
+            this.PollingCheckedColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
+            this.PollingCheckedColumn.Tag = "0";
+            this.PollingCheckedColumn.Visible = true;
+            this.PollingCheckedColumn.VisibleIndex = 0;
+            // 
             // pl_id
             // 
             this.pl_id.Caption = "ID";
@@ -876,7 +925,7 @@ namespace UAS_DeviceMonitor
             this.pl_code.FieldName = "PL_CODE";
             this.pl_code.Name = "pl_code";
             this.pl_code.Visible = true;
-            this.pl_code.VisibleIndex = 0;
+            this.pl_code.VisibleIndex = 1;
             // 
             // pl_name
             // 
@@ -884,7 +933,7 @@ namespace UAS_DeviceMonitor
             this.pl_name.FieldName = "PL_NAME";
             this.pl_name.Name = "pl_name";
             this.pl_name.Visible = true;
-            this.pl_name.VisibleIndex = 1;
+            this.pl_name.VisibleIndex = 2;
             // 
             // pl_type
             // 
@@ -892,15 +941,16 @@ namespace UAS_DeviceMonitor
             this.pl_type.FieldName = "PL_TYPE";
             this.pl_type.Name = "pl_type";
             this.pl_type.Visible = true;
-            this.pl_type.VisibleIndex = 2;
+            this.pl_type.VisibleIndex = 3;
             // 
             // pl_dccode
             // 
             this.pl_dccode.Caption = "指令编号";
+            this.pl_dccode.ColumnEdit = this.PollingSetItemLookUpEdit;
             this.pl_dccode.FieldName = "PL_DCCODE";
             this.pl_dccode.Name = "pl_dccode";
             this.pl_dccode.Visible = true;
-            this.pl_dccode.VisibleIndex = 3;
+            this.pl_dccode.VisibleIndex = 4;
             // 
             // pl_remark
             // 
@@ -908,7 +958,7 @@ namespace UAS_DeviceMonitor
             this.pl_remark.FieldName = "PL_REMARK";
             this.pl_remark.Name = "pl_remark";
             this.pl_remark.Visible = true;
-            this.pl_remark.VisibleIndex = 4;
+            this.pl_remark.VisibleIndex = 5;
             // 
             // Main
             // 
@@ -941,6 +991,8 @@ namespace UAS_DeviceMonitor
             ((System.ComponentModel.ISupportInitialize)(this.GridPollingSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridViewPollSetting)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.dpc_enableCheckEdit)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PollSettingItemSearchLookUpEdit)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PollSettingItemSearchLookUpEditView)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.PollingSetItemLookUpEdit)).EndInit();
             this.PagePolling.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.GridPolling)).EndInit();
@@ -1027,5 +1079,9 @@ namespace UAS_DeviceMonitor
         private DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit PollingSetItemLookUpEdit;
         private DevExpress.XtraGrid.Columns.GridColumn POLLSETTINGSTATUSCOLUMN;
         private DevExpress.XtraGrid.Columns.GridColumn PollSettingCheckedColumn;
+        private DevExpress.XtraGrid.Columns.GridColumn CommandSetCheckedColumn;
+        private DevExpress.XtraGrid.Columns.GridColumn PollingCheckedColumn;
+        private DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit PollSettingItemSearchLookUpEdit;
+        private DevExpress.XtraGrid.Views.Grid.GridView PollSettingItemSearchLookUpEditView;
     }
 }

+ 19 - 6
UAS_DeviceMonitor/Main.cs

@@ -33,7 +33,7 @@ namespace UAS_DeviceMonitor
             GridDeviceList.GetDataSQL = "select de_id,de_code,de_name,de_spec,de_indate,de_runstatus,de_address,de_wccode,de_vendcode,de_vendname from device".ToUpper();
             PageControlDeviceList.Gridcontrol = GridDeviceList;
             //轮询业务
-            GridPolling.GetDataSQL = "select pl_id,pl_code,pl_name,pl_type,pl_dccode,pl_remark from polling".ToUpper();
+            GridPolling.GetDataSQL = "select 0 CHECKEDCOLUMN,pl_id,pl_code,pl_name,pl_type,pl_dccode,pl_remark from polling".ToUpper();
             GridPolling.ID = "pl_id";
             GridPolling.TableName = "polling";
             GridPolling.InsertSQL = "insert into polling(pl_id,pl_code,pl_name,pl_type,pl_dccode,pl_remark) values(polling_seq.nextval,:pl_code,:pl_name,:pl_type,:pl_dccode,:pl_remark)";
@@ -51,7 +51,7 @@ namespace UAS_DeviceMonitor
             ButtonDeleteCommandSet.Grid = GridPollingSetting;
 
             //指令设置界面
-            GridCommandSetting.GetDataSQL = "select 0 GRIDVIEWCOMMANDSETCHOOSE,dc_id,dc_code,dc_name,dc_command from devicecommand".ToUpper();
+            GridCommandSetting.GetDataSQL = "select 0 CHECKEDCOLUMN,dc_id,dc_code,dc_name,dc_command from devicecommand".ToUpper();
             GridCommandSetting.TableName = "devicecommand";
             GridCommandSetting.ID = "dc_id";
             GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_command) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_command)";
@@ -169,6 +169,19 @@ namespace UAS_DeviceMonitor
 
         #endregion
 
+        #region PagePolling业务代码
+        private void GridPolling_VisibleChanged(object sender, EventArgs e)
+        {
+            if (PagePollingSetting.PageVisible)
+            {
+                DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("select dc_name,dc_code from devicecommand ", "select");
+                PollingSetItemLookUpEdit.DataSource = dt;
+                PollingSetItemLookUpEdit.DisplayMember = "DC_NAME";
+                PollingSetItemLookUpEdit.ValueMember = "DC_CODE";
+            }
+        }
+        #endregion
+
         #region PagePollingSetting业务代码
 
         PollingTask pt = new PollingTask();
@@ -301,10 +314,10 @@ namespace UAS_DeviceMonitor
         {
             if (PagePollingSetting.PageVisible)
             {
-                DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("select dc_name,dc_code from devicecommand ", "select");
-                PollingSetItemLookUpEdit.DataSource = dt;
-                PollingSetItemLookUpEdit.DisplayMember = "DC_NAME";
-                PollingSetItemLookUpEdit.ValueMember = "DC_CODE";
+                DataTable dt = (DataTable)SystemInf.dh.ExecuteSql("SELECT PL_CODE,PL_NAME,PL_TYPE,PL_DCCODE,PL_REMARK FROM POLLING", "select");
+                PollSettingItemSearchLookUpEdit.DataSource = dt;
+                //PollingSetItemLookUpEdit.DisplayMember = "DC_NAME";
+                //PollingSetItemLookUpEdit.ValueMember = "DC_CODE";
             }
         }
         #endregion