Esempio n. 1
0
        /// <summary>
        /// 加载控制参数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DownComBtn_Click(object sender, EventArgs e)
        {
            int[] indexlist = this.getCheckedList();
            if (indexlist.Length < 1)
            {
                MessageBox.Show("请选择一个设备", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataTable tab      = this.dbGrid.DataSource as DataTable;
            DataRow   drtarget = tab.Rows[indexlist[0]];

            UnitItem       unitPark = new UnitItem(DataAccRes.AppSettings("WorkConfig"), "设备控制维护");
            BindManager    bg       = new BindManager(this);
            NameObjectList ps       = new NameObjectList();

            ps["code"] = drtarget["编号"];
            DataSet ds = bg.BuildDataset(unitPark, ps);

            FrmCommPara win = new FrmCommPara();

            win.DataSource = ds;
            win.Query      = new QueryDataRes(unitPark.DataSrcFile);
            win.Position   = 0;
            win.Target     = this.getTarget(drtarget);
            win.FunType    = "通讯";
            win.ShowDialog(this);
        }
Esempio n. 2
0
        /// <summary>
        /// 加载控制参数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DownComBtn_Click(object sender, EventArgs e)
        {
            int[] indexlist = this.getCheckedList();
            if (indexlist.Length < 1)
            {
                MessageBox.Show("请选择一个设备", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataTable tab = this.dbGrid.DataSource as DataTable;
            DataRow drtarget = tab.Rows[indexlist[0]];

            UnitItem unitPark = new UnitItem(DataAccRes.AppSettings("WorkConfig"), "设备控制维护");
            BindManager bg = new BindManager(this);
            NameObjectList ps = new NameObjectList();
            ps["code"] = drtarget["编号"];
            DataSet ds = bg.BuildDataset(unitPark, ps);

            FrmCommPara win = new FrmCommPara();
            win.DataSource = ds;
            win.Query = new QueryDataRes(unitPark.DataSrcFile);
            win.Position = 0;
            win.Target = this.getTarget(drtarget);
            win.FunType = "通讯";
            win.ShowDialog(this);
        }