コード例 #1
0
ファイル: FrmSetSyetem.cs プロジェクト: BillyWu/Granitypark
        /// <summary>
        /// 巡检硬件设备
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CheckBtn_Click(object sender, EventArgs e)
        {
            int[]  indexlist = this.getCheckedList();
            string msg       = "";

            if (indexlist.Length < 1)
            {
                msg = "请选择一个设备";
            }
            else if (indexlist.Length > 1)
            {
                msg = "不能同时巡检多个设备";
            }
            if (!string.IsNullOrEmpty(msg))
            {
                MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DataTable     tab      = this.dbGrid.DataSource as DataTable;
            FrmQueryState frmstate = new FrmQueryState();
            DataRow       dr       = tab.Rows[indexlist[0]];

            frmstate.deviceID = Convert.ToString(dr["站址"]);
            frmstate.target   = this.getTarget(dr);
            frmstate.ShowDialog(this);
        }
コード例 #2
0
ファイル: FrmSetSyetem.cs プロジェクト: BillyWu/Granitypark
        /// <summary>
        /// 巡检硬件设备
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CheckBtn_Click(object sender, EventArgs e)
        {
            int[] indexlist = this.getCheckedList();
            string msg = "";
            if (indexlist.Length < 1)
                msg = "请选择一个设备";
            else if (indexlist.Length > 1)
                msg = "不能同时巡检多个设备";
            if (!string.IsNullOrEmpty(msg))
            {
                MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DataTable tab = this.dbGrid.DataSource as DataTable;
            FrmQueryState frmstate = new FrmQueryState();
            DataRow dr = tab.Rows[indexlist[0]];
            frmstate.deviceID = Convert.ToString(dr["站址"]);
            frmstate.target = this.getTarget(dr);
            frmstate.ShowDialog(this);
        }