Ejemplo n.º 1
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string bs = this.dataGridView1.SelectedRows[0].Cells[11].Value.ToString();

            if (!"未处理".Equals(bs))
            {
                string hostcode  = this.dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
                string metercode = this.dataGridView1.SelectedRows[0].Cells[3].Value.ToString();
                string time      = this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
                service.warningCheckService wcs = new service.warningCheckService();
                DataTable dtw = wcs.warningCheck(hostcode + "_" + metercode, time);
                if (dtw.Rows.Count > 0)
                {
                    warningHandle wh = new warningHandle();
                    wh.Text                  = this.dataGridView1.SelectedRows[0].Cells[1].Value.ToString() + "报警处理";
                    wh.label2.Text           = dtw.Rows[0][1].ToString();
                    wh.textBox1.Text         = time;
                    wh.dateTimePicker1.Value = Convert.ToDateTime(dtw.Rows[0][3].ToString());
                    wh.textBox3.Text         = dtw.Rows[0][4].ToString();
                    wh.textBox4.Text         = dtw.Rows[0][5].ToString();
                    wh.richTextBox1.Text     = dtw.Rows[0][6].ToString();
                    wh.button1.Visible       = false;
                    wh.button2.Visible       = false;
                    wh.Show();
                }
            }
            else
            {
                MessageBox.Show("报警未处理!请先处理报警信息。");
            }
        }
Ejemplo n.º 2
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.RowCount > 0)
     {
         string warn = this.dataGridView1.SelectedRows[0].Cells[11].Value.ToString();
         if (!"已处理".Equals(warn))
         {
             warningHandle wh = new warningHandle();
             wh.Text                  = this.dataGridView1.SelectedRows[0].Cells[1].Value.ToString() + "报警处理";
             wh.label2.Text           = frmLogin.name;
             wh.textBox1.Text         = this.dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
             wh.dateTimePicker1.Value = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
             wh.textBox5.Text         = this.dataGridView1.SelectedRows[0].Cells[2].Value.ToString() + "_" + this.dataGridView1.SelectedRows[0].Cells[3].Value.ToString();
             if (wh.ShowDialog() == DialogResult.OK)
             {
                 button1_Click(sender, e);
             }
         }
         else
         {
             MessageBox.Show("报警已处理,报警处理详情请去报警处理功能中查看!");
         }
     }
     else
     {
         MessageBox.Show("无报警数据!");
     }
 }