Ejemplo n.º 1
0
        private void DGV_MeterInfo_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            string type = "";
            string ever = "";
            string id   = "";

            if ((e.ColumnIndex == 2 || e.ColumnIndex == 3 || e.ColumnIndex == 4 || e.ColumnIndex == 5) && !((this.DGV_MeterInfo.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString()).Equals("不测")))
            {
                switch (e.ColumnIndex)
                {
                case 2:
                    id   = this.DGV_MeterInfo.Rows[e.RowIndex].Cells[0].Value.ToString();
                    type = "IC卡卡控测试";
                    ever = (Myadapter.GetDataBy1(id).Rows[0]["MeterEvery"].ToString()).Substring(10, 2);
                    break;

                case 3:
                    id   = this.DGV_MeterInfo.Rows[e.RowIndex].Cells[0].Value.ToString();
                    type = "初检测试";
                    ever = (Myadapter.GetDataBy1(id).Rows[0]["MeterEvery"].ToString()).Substring(0, 8);
                    break;

                case 4:
                    id   = this.DGV_MeterInfo.Rows[e.RowIndex].Cells[0].Value.ToString();
                    ever = (Myadapter.GetDataBy1(id).Rows[0]["MeterEvery"].ToString()).Substring(14, 4);
                    type = "命令检测测试";
                    break;

                case 5:
                    id   = this.DGV_MeterInfo.Rows[e.RowIndex].Cells[0].Value.ToString();
                    ever = (Myadapter.GetDataBy1(id).Rows[0]["MeterEvery"].ToString()).Substring(20, 10);
                    type = "终检测试";
                    break;
                }
                DialogResult dr = MessageBox.Show("是否要查看表:" + id + " " + type + "的详细测试信息",
                                                  "提示!",
                                                  MessageBoxButtons.YesNo,
                                                  MessageBoxIcon.Information,
                                                  MessageBoxDefaultButton.Button1,
                                                  MessageBoxOptions.DefaultDesktopOnly);
                if (dr == DialogResult.Yes)
                {
                    der = new DetailResult(id, e.ColumnIndex, ever, "AAAA");
                    der.Show();
                }
            }
        }
Ejemplo n.º 2
0
 private void DGV_result_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (DGV_result.Columns[e.ColumnIndex].Name == "MeterDetil")
     {
         if (der != null)
         {
             der.Close();
         }
         string fla = "";
         fla += this.DGV_result.Rows[e.RowIndex].Cells["MeterChuState"].Value.ToString().Equals("不测") ? "5" : "A";
         fla += this.DGV_result.Rows[e.RowIndex].Cells["MeterIcState"].Value.ToString().Equals("不测") ? "5" : "A";
         fla += this.DGV_result.Rows[e.RowIndex].Cells["MeterComState"].Value.ToString().Equals("不测") ? "5" : "A";
         fla += this.DGV_result.Rows[e.RowIndex].Cells["MeterZhongState"].Value.ToString().Equals("不测") ? "5" : "A";
         string id   = this.DGV_result.Rows[e.RowIndex].Cells[0].Value.ToString();
         string ever = this.DGV_result.Rows[e.RowIndex].Cells["MeterEvery"].Value.ToString();
         der = new DetailResult(id, 6, ever, fla);
         der.Show();
     }
 }