/// <summary> /// 新增校准品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAdd_Click(object sender, EventArgs e) { if (lisassayProjectInfo != null) { if (calibAddAndEdit == null) { calibAddAndEdit = new CalibAddAndEdit(); calibAddAndEdit.DataHandleEvent += calibAddAndEdit_DataHandleEvent; calibAddAndEdit.CalibrationSaveOrEnditSuccessEvent += calibAddAndEdit_SaveOrEnditSuccessEvent; calibAddAndEdit.StartPosition = FormStartPosition.CenterScreen; } else { calibAddAndEdit.clear(); calibAddAndEdit.ClearCalibAddAndEditParamer(); } calibAddAndEdit.LisassayProjectInfo = lisassayProjectInfo; calibAddAndEdit.Text = "装载校准品"; this.AddOrEditCalibPos(); calibAddAndEdit.ShowDialog(); } }
/// <summary> /// 编辑校准品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEdit_Click(object sender, EventArgs e) { if (gridView1.SelectedRowsCount > 0) { if (calibAddAndEdit == null) { calibAddAndEdit = new CalibAddAndEdit(); calibAddAndEdit.DataHandleEvent += calibAddAndEdit_DataHandleEvent; calibAddAndEdit.CalibrationSaveOrEnditSuccessEvent += calibAddAndEdit_SaveOrEnditSuccessEvent; calibAddAndEdit.StartPosition = FormStartPosition.CenterScreen; } else { calibAddAndEdit.ClearCalibAddAndEditParamer(); } Calibratorinfo calibratorinfo = new Calibratorinfo(); int selectedHandle = this.gridView1.GetSelectedRows()[0]; calibratorinfo.CalibName = this.gridView1.GetRowCellValue(selectedHandle, "校准品名称").ToString(); calibratorinfo.InvalidDate = Convert.ToDateTime(this.gridView1.GetRowCellValue(selectedHandle, "失效日期")); calibratorinfo.LotNum = this.gridView1.GetRowCellValue(selectedHandle, "批号").ToString(); calibratorinfo.Manufacturer = this.gridView1.GetRowCellValue(selectedHandle, "生产厂家").ToString(); calibratorinfo.Pos = this.gridView1.GetRowCellValue(selectedHandle, "装载位置").ToString(); calibAddAndEdit.EditCalibratorName = calibratorinfo.CalibName; ////显示所有项目信息 calibAddAndEdit.LisassayProjectInfo = lisassayProjectInfo; //显示校准品包含的项目信息 calibAddAndEdit.LstCalibrationCorrespondingProInfo = lstCalibrationCorrespondingProInfo; this.AddOrEditCalibPos(); calibAddAndEdit.Calibratorinfo_Load(calibratorinfo); calibAddAndEdit.Text = "编辑校准品"; calibAddAndEdit.ShowDialog(); } else { } }