private void btnAdd_Click(object sender, EventArgs e) { if (dtInspection.Columns.Count < 0) { XtraMessageBox.Show( "当前没有配置检验项", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (frmPhysicochemicalInspectionBatchSystem.currentOpType == "MPLH") { using (Dialogs.frmNoneblankphotoEditor photoEditor = new Dialogs.frmNoneblankphotoEditor( EditStatus.New, "新增", dtInspection, -1, strfilename)) { if (photoEditor.ShowDialog() == DialogResult.OK) { vgrdInspectParams.RefreshDataSource(); vgrdInspectParams.FocusedRecord = vgrdInspectParams.RecordCount - 1; frmPhysicochemicalInspectionBatchSystem.saveState = false; SaveFact_SmeltBatchInspecting(pwo.FactID, pwo.T102LeafID, pwo.T107LeafID, pwo.LotNumber, pwo.PWONo); frmPhysicochemicalInspectionBatchSystem.saveState = true; dtInspection.Rows.Clear(); dtInspection.Columns.Clear(); vgrdInspectParams.Rows.Clear(); RefreshUC(pwo); } } } else { using (Dialogs.frmNoneblankEditor formEditor = new Dialogs.frmNoneblankEditor( EditStatus.New, "新增", dtInspection, -1)) { if (formEditor.ShowDialog() == DialogResult.OK) { vgrdInspectParams.RefreshDataSource(); vgrdInspectParams.FocusedRecord = vgrdInspectParams.RecordCount - 1; frmPhysicochemicalInspectionBatchSystem.saveState = false; RefreshCtrl(); } } } }
private void btnModify_Click(object sender, EventArgs e) { if (optype == "MPLH") { XtraMessageBox.Show( "当前不能修改检验项", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (dtInspection.Columns.Count < 0) { XtraMessageBox.Show( "当前没有配置检验项", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } int idx = this.vgrdInspectParams.FocusedRecord; if (idx < _readOnlyCount) { return; } if (idx >= 0) { using (Dialogs.frmNoneblankEditor formEditor = new Dialogs.frmNoneblankEditor( EditStatus.Edit, "修改", dtInspection, idx)) { if (formEditor.ShowDialog() == DialogResult.OK) { vgrdInspectParams.RefreshDataSource(); frmPhysicochemicalInspectionBatchSystem.saveState = false; RefreshCtrl(); } } } }