private void btnOk_Click(object sender, EventArgs e) { var emptyCellsList = dGVErrata.Rows.Cast <DataGridViewRow>() .Where(row => String.IsNullOrEmpty(row.Cells[1].EditedFormattedValue.ToString())) .Select(row => row.Cells[1]) .ToList(); if (emptyCellsList.Any()) { emptyCellsList.ForEach(item => item.ErrorText = "this field is required"); //TODO return; } DialogResult dResult = fBDConformance.ShowDialog(); if (DialogResult.OK != dResult) { return; } DoCGenerator dGenerator = new DoCGenerator(CTTSettings.GetDoCErrataTemplateFilename()); String docFilename = Path.Combine(fBDConformance.SelectedPath, GetDoCFilename()); dGenerator.Generate(mConformanceValues, GetErratumNumbers(), docFilename); String featureListFilename = Path.Combine(fBDConformance.SelectedPath, GetFeatureListFilename()); new FeatureListGenerator(mConformanceValues).Generate(featureListFilename); //PdfViewer.View(docFilename); Close(); }
private void btnOk_Click(object sender, EventArgs e) { var emptyCellsList = dGVErrata.Rows.Cast <DataGridViewRow>() .Where(row => String.IsNullOrEmpty(row.Cells[1].EditedFormattedValue.ToString())) .Select(row => row.Cells[1]) .ToList(); if (0 != emptyCellsList.Count) { emptyCellsList.ForEach(item => item.ErrorText = "this field is required"); return; } sFDConformance.FileName = mConformanceInfo.GetDoCFilename(errata: true); DialogResult dResult = sFDConformance.ShowDialog(); if (DialogResult.OK != dResult) { return; } String filename = sFDConformance.FileName; var generator = new DoCWithErrataGenerator(GetErratumTable(), mConformanceInfo, CTTSettings.GetDoCErrataTemplateFilename()); generator.Generate(filename); //PdfViewer.View(docFilename); Close(); }