Exemple #1
0
        private void 修改ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.gridView1.RowCount == 0 || this.gridView1.GetSelectedRows()[0] < 0)
                {
                    MessageBox.Show("请选中要修改的行行");
                    return;
                }
                strOperationFlag = "modify";
                Dictionary <string, string> dic = new Dictionary <string, string>();
                dic.Add("序号", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[0]).ToString());
                dic.Add("车型", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[1]).ToString());
                dic.Add("列号", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[2]).ToString());
                dic.Add("修程", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[3]).ToString());
                dic.Add("车号", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[4]).ToString());
                dic.Add("吊挂设备", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[5]).ToString());
                dic.Add("检查时间", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[6]).ToString());
                dic.Add("故障横梁号", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[7]).ToString());
                dic.Add("缺陷尖端距一位侧边梁", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[8]).ToString());
                dic.Add("缺陷尖端距二位侧边梁", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[9]).ToString());
                dic.Add("缺陷位置", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[10]).ToString());
                dic.Add("缺陷长度", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[11]).ToString());
                dic.Add("缺陷深度", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[12]).ToString());
                dic.Add("是否贯穿", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[13]).ToString());
                dic.Add("检测技术", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[14]).ToString());
                dic.Add("信号幅值", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[15]).ToString());
                dic.Add("信号相位", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[16]).ToString());
                dic.Add("探伤工", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[17]).ToString());
                dic.Add("班主长", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[18]).ToString());
                dic.Add("录入人", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[19]).ToString());


                dic.Add("车型编号", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[20]).ToString());
                dic.Add("车列编号", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[21]).ToString());
                dic.Add("吊挂设备编号", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[22]).ToString());
                dic.Add("检测技术编号", this.gridView1.GetRowCellValue(this.gridView1.FocusedRowHandle, this.gridView1.Columns[23]).ToString());

                FormFaultInfoEdit frm = new FormFaultInfoEdit(strOperationFlag, dic);
                frm.Owner = this;
                frm.ShowDialog();
                if (frm.DialogResult == DialogResult.OK)
                {
                    FreshForm();
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("修改故障信息时发生错误!" + ex.Message, "提示信息");
                return;
            }
        }
Exemple #2
0
 private void 添加ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         strOperationFlag = "add";
         FormFaultInfoEdit frm = new FormFaultInfoEdit(strOperationFlag, null);
         frm.Owner = this;
         frm.ShowDialog();
         if (frm.DialogResult == DialogResult.OK)
         {
             FreshForm();
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("添加故障信息时发生错误!" + ex.Message, "提示信息");
         return;
     }
 }