📄 formnwrtupackage.cs
字号:
using System;using System.Collections;using System.ComponentModel;using System.Drawing;using System.Windows.Forms;using System.Data;using CommCLB.Comm;
using CommCLB.asswconf_ws;namespace GPRSDrvWinApp.gprs{ public class FormnwRtuPackage : GPRSDrvWinApp.FormParent {
private System.Windows.Forms.TreeView tvMain;
private System.Windows.Forms.DataGrid dgdTgt;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox tbName;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.Button btnSearch;
private System.Windows.Forms.Button btnModify;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.NumericUpDown nUDNum;
private System.Windows.Forms.ComboBox cbRtuSeq;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lb;
private System.Windows.Forms.TextBox tbMemo;
private System.Windows.Forms.NumericUpDown nUDChannel;
private System.Windows.Forms.CheckBox chbUse;
private System.Windows.Forms.NumericUpDown nUDBytes;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridBoolColumn dataGridBoolColumn1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn2;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn3;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn4;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn5;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn6;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn7;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn8;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn9;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn10;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn11; private System.ComponentModel.IContainer components = null; public FormnwRtuPackage() { // 该调用是 Windows 窗体设计器所必需的。 InitializeComponent(); // TODO: 在 InitializeComponent 调用后添加任何初始化 GetData(); } public FormnwRtuPackage(string moduleNo) { // 该调用是 Windows 窗体设计器所必需的。
InitializeComponent();
// TODO: 在 InitializeComponent 调用后添加任何初始化
//设置模块编号以及按钮权限
this.ModuleNO=moduleNo;
Class_Comm.SetFunctionRight(this,this.ModuleNO);
try
{
GetData();
}
catch(Exception exp)
{
Class_Comm.ErrMsgBox("系统运行发生错误,请和系统管理员联系!\n\n错误信息:"+exp.Message);
} } /// <summary> /// 清理所有正在使用的资源。 /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region 设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FormnwRtuPackage));
this.tvMain = new System.Windows.Forms.TreeView();
this.dgdTgt = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
this.dataGridBoolColumn1 = new System.Windows.Forms.DataGridBoolColumn();
this.dataGridTextBoxColumn1 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn2 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn3 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn4 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn5 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn6 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn7 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn8 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn9 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn10 = new System.Windows.Forms.DataGridTextBoxColumn();
this.dataGridTextBoxColumn11 = new System.Windows.Forms.DataGridTextBoxColumn();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tbMemo = new System.Windows.Forms.TextBox();
this.chbUse = new System.Windows.Forms.CheckBox();
this.nUDChannel = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.nUDNum = new System.Windows.Forms.NumericUpDown();
this.cbRtuSeq = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.tbName = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.lb = new System.Windows.Forms.Label();
this.nUDBytes = new System.Windows.Forms.NumericUpDown();
this.btnClose = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnSearch = new System.Windows.Forms.Button();
this.btnModify = new System.Windows.Forms.Button();
this.btnAdd = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgdTgt)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nUDChannel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDNum)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nUDBytes)).BeginInit();
this.SuspendLayout();
//
// imgLstMain
//
this.imgLstMain.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgLstMain.ImageStream")));
//
// tvMain
//
this.tvMain.Dock = System.Windows.Forms.DockStyle.Left;
this.tvMain.HideSelection = false;
this.tvMain.ImageList = this.imgLstMain;
this.tvMain.Location = new System.Drawing.Point(0, 0);
this.tvMain.Name = "tvMain";
this.tvMain.Size = new System.Drawing.Size(136, 479);
this.tvMain.TabIndex = 21;
this.tvMain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvMain_AfterSelect);
//
// dgdTgt
//
this.dgdTgt.AllowSorting = false;
this.dgdTgt.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dgdTgt.CaptionVisible = false;
this.dgdTgt.DataMember = "";
this.dgdTgt.Dock = System.Windows.Forms.DockStyle.Top;
this.dgdTgt.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgdTgt.Location = new System.Drawing.Point(136, 0);
this.dgdTgt.Name = "dgdTgt";
this.dgdTgt.ReadOnly = true;
this.dgdTgt.RowHeaderWidth = 0;
this.dgdTgt.Size = new System.Drawing.Size(634, 160);
this.dgdTgt.TabIndex = 22;
this.dgdTgt.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
this.dgdTgt.CurrentCellChanged += new System.EventHandler(this.dgdTgt_CurrentCellChanged);
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.AllowSorting = false;
this.dataGridTableStyle1.AlternatingBackColor = System.Drawing.SystemColors.Info;
this.dataGridTableStyle1.DataGrid = this.dgdTgt;
this.dataGridTableStyle1.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] {
this.dataGridBoolColumn1,
this.dataGridTextBoxColumn1,
this.dataGridTextBoxColumn2,
this.dataGridTextBoxColumn3,
this.dataGridTextBoxColumn4,
this.dataGridTextBoxColumn5,
this.dataGridTextBoxColumn6,
this.dataGridTextBoxColumn7,
this.dataGridTextBoxColumn8,
this.dataGridTextBoxColumn9,
this.dataGridTextBoxColumn10,
this.dataGridTextBoxColumn11});
this.dataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "tb_nwRtuPackage";
this.dataGridTableStyle1.ReadOnly = true;
//
// dataGridBoolColumn1
//
this.dataGridBoolColumn1.FalseValue = "0";
this.dataGridBoolColumn1.HeaderText = "通道已用";
this.dataGridBoolColumn1.MappingName = "fd_useFlag";
this.dataGridBoolColumn1.NullText = "";
this.dataGridBoolColumn1.NullValue = ((object)(resources.GetObject("dataGridBoolColumn1.NullValue")));
this.dataGridBoolColumn1.ReadOnly = true;
this.dataGridBoolColumn1.TrueValue = "1";
this.dataGridBoolColumn1.Width = 75;
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.MappingName = "fd_seq";
this.dataGridTextBoxColumn1.NullText = "";
this.dataGridTextBoxColumn1.Width = 0;
//
// dataGridTextBoxColumn2
//
this.dataGridTextBoxColumn2.Format = "";
this.dataGridTextBoxColumn2.FormatInfo = null;
this.dataGridTextBoxColumn2.MappingName = "fd_date";
this.dataGridTextBoxColumn2.NullText = "";
this.dataGridTextBoxColumn2.Width = 0;
//
// dataGridTextBoxColumn3
//
this.dataGridTextBoxColumn3.Format = "";
this.dataGridTextBoxColumn3.FormatInfo = null;
this.dataGridTextBoxColumn3.MappingName = "fd_empseq";
this.dataGridTextBoxColumn3.NullText = "";
this.dataGridTextBoxColumn3.Width = 0;
//
// dataGridTextBoxColumn4
//
this.dataGridTextBoxColumn4.Format = "";
this.dataGridTextBoxColumn4.FormatInfo = null;
this.dataGridTextBoxColumn4.MappingName = "fd_monseq";
this.dataGridTextBoxColumn4.NullText = "";
this.dataGridTextBoxColumn4.Width = 0;
//
// dataGridTextBoxColumn5
//
this.dataGridTextBoxColumn5.Format = "";
this.dataGridTextBoxColumn5.FormatInfo = null;
this.dataGridTextBoxColumn5.MappingName = "fd_rtuseq";
this.dataGridTextBoxColumn5.NullText = "";
this.dataGridTextBoxColumn5.Width = 0;
//
// dataGridTextBoxColumn6
//
this.dataGridTextBoxColumn6.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.dataGridTextBoxColumn6.Format = "";
this.dataGridTextBoxColumn6.FormatInfo = null;
this.dataGridTextBoxColumn6.HeaderText = "指标名";
this.dataGridTextBoxColumn6.MappingName = "fd_name";
this.dataGridTextBoxColumn6.NullText = "";
this.dataGridTextBoxColumn6.ReadOnly = true;
this.dataGridTextBoxColumn6.Width = 130;
//
// dataGridTextBoxColumn7
//
this.dataGridTextBoxColumn7.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.dataGridTextBoxColumn7.Format = "";
this.dataGridTextBoxColumn7.FormatInfo = null;
this.dataGridTextBoxColumn7.HeaderText = "RTU设备号";
this.dataGridTextBoxColumn7.MappingName = "fd_rtuid";
this.dataGridTextBoxColumn7.NullText = "";
this.dataGridTextBoxColumn7.ReadOnly = true;
this.dataGridTextBoxColumn7.Width = 75;
//
// dataGridTextBoxColumn8
//
this.dataGridTextBoxColumn8.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.dataGridTextBoxColumn8.Format = "";
this.dataGridTextBoxColumn8.FormatInfo = null;
this.dataGridTextBoxColumn8.HeaderText = "通道";
this.dataGridTextBoxColumn8.MappingName = "fd_channel";
this.dataGridTextBoxColumn8.NullText = "";
this.dataGridTextBoxColumn8.ReadOnly = true;
this.dataGridTextBoxColumn8.Width = 75;
//
// dataGridTextBoxColumn9
//
this.dataGridTextBoxColumn9.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.dataGridTextBoxColumn9.Format = "";
this.dataGridTextBoxColumn9.FormatInfo = null;
this.dataGridTextBoxColumn9.HeaderText = "排序";
this.dataGridTextBoxColumn9.MappingName = "fd_num";
this.dataGridTextBoxColumn9.NullText = "";
this.dataGridTextBoxColumn9.ReadOnly = true;
this.dataGridTextBoxColumn9.Width = 75;
//
// dataGridTextBoxColumn10
//
this.dataGridTextBoxColumn10.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.dataGridTextBoxColumn10.Format = "";
this.dataGridTextBoxColumn10.FormatInfo = null;
this.dataGridTextBoxColumn10.HeaderText = "指标字节数";
this.dataGridTextBoxColumn10.MappingName = "fd_nums";
this.dataGridTextBoxColumn10.NullText = "";
this.dataGridTextBoxColumn10.ReadOnly = true;
this.dataGridTextBoxColumn10.Width = 75;
//
// dataGridTextBoxColumn11
//
this.dataGridTextBoxColumn11.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.dataGridTextBoxColumn11.Format = "";
this.dataGridTextBoxColumn11.FormatInfo = null;
this.dataGridTextBoxColumn11.HeaderText = "备注";
this.dataGridTextBoxColumn11.MappingName = "fd_memo";
this.dataGridTextBoxColumn11.NullText = "";
this.dataGridTextBoxColumn11.ReadOnly = true;
this.dataGridTextBoxColumn11.Width = 75;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.tbMemo);
this.groupBox1.Controls.Add(this.chbUse);
this.groupBox1.Controls.Add(this.nUDChannel);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -