예제 #1
0
        private void checkPointInfo()
        {
            service.deviceInformationService dis = new service.deviceInformationService();
            int       flag = 0;
            DataTable dt   = dis.checkPointInfo(flag);

            if (dt != null)
            {
                this.dataGridView1.DataSource                     = dt;
                this.dataGridView1.Columns[0].Visible             = false;
                this.dataGridView1.Columns[1].HeaderCell.Value    = "管理主机编号";
                this.dataGridView1.Columns[2].HeaderCell.Value    = "测点(仪表)编号";
                this.dataGridView1.Columns[3].HeaderCell.Value    = "测点(仪表)名称";
                this.dataGridView1.Columns[4].Visible             = false;
                this.dataGridView1.Columns[5].HeaderCell.Value    = "通信协议";
                this.dataGridView1.Columns[6].Visible             = false;
                this.dataGridView1.Columns[7].Visible             = false;
                this.dataGridView1.Columns[8].Visible             = false;
                this.dataGridView1.Columns[9].Visible             = false;
                this.dataGridView1.Columns[10].Visible            = false;
                this.dataGridView1.Columns[11].HeaderCell.Value   = "库房类型名称";
                this.dataGridView1.Columns[12].Visible            = false;
                this.dataGridView1.RowsDefaultCellStyle.ForeColor = Color.Black;
                this.dataGridView1.Columns[1].Width               = 150;
                this.dataGridView1.Columns[2].Width               = 130;
                this.dataGridView1.Columns[3].Width               = 150;
                this.dataGridView1.Columns[5].Width               = 220;
                this.dataGridView1.AllowUserToAddRows             = false;
            }
            else
            {
                this.dataGridView1.DataSource = null;
            }
        }
예제 #2
0
        private void readHistoryData_Load(object sender, EventArgs e)
        {
            string str = Application.StartupPath;//项目路径

            this.button1_click.BackgroundImage = Image.FromFile(@str + "/images/read.png");
            this.button4.BackgroundImage       = Image.FromFile(@str + "/images/stop.png");
            this.button2.BackgroundImage       = Image.FromFile(@str + "/images/clear.png");
            this.button3.BackgroundImage       = Image.FromFile(@str + "/images/close.png");
            service.deviceInformationService dis = new service.deviceInformationService();
            int flag = 0;

            dtcdinfo = dis.checkPointInfo(flag);
        }
예제 #3
0
        private void dataSynchronous_Load(object sender, EventArgs e)
        {
            string str = Application.StartupPath;//项目路径

            this.button1.BackgroundImage = Image.FromFile(@str + "/images/assign.png");
            this.button2.BackgroundImage = Image.FromFile(@str + "/images/close.png");
            //让默认的日期时间减一天
            this.dateTimePicker1.Value = this.dateTimePicker2.Value.AddDays(-1);

            ipport = getFromXml();

            service.changGuicheckService cds = new service.changGuicheckService();
            DataTable dta = cds.checkCedianCar().Tables[0];
            int       t   = dta.Rows.Count;

            if (t > 0)
            {
                CheckBox ckb = new CheckBox();
                ckb.Text     = "全选";
                ckb.Checked  = true;
                ckb.Location = new Point(330, 10);
                ckb.Click   += new EventHandler(cbk_Click);
                this.tabControl1.TabPages[0].Controls.Add(ckb);
                CheckBox[] checkBox = new CheckBox[t];
                int        p        = 10;
                for (int i = 0; i < t; i++)
                {
                    checkBox[i]          = new CheckBox();
                    checkBox[i].AutoSize = true;
                    checkBox[i].Text     = dta.Rows[i]["terminalname"].ToString();
                    string storeType = dta.Rows[i]["storeType"].ToString();
                    checkBox[i].Tag      = dta.Rows[i]["measureCode"] + "-" + dta.Rows[i]["meterNo"];
                    checkBox[i].Location = new Point(10, p);
                    this.tabControl1.TabPages[0].Controls.Add(checkBox[i]);
                    p += 20;
                    checkBox[i].Checked = true;
                }
            }

            int flag = 3;

            dtcdinfo = dis.checkPointInfo(flag);
        }