public Form3Editing(DataRow rowToEdit, List <Document> attachDocsBefore, FormResultCallback callback) { InitializeComponent(); this.callback = callback; this.rowToEdit = rowToEdit; editId = (int)rowToEdit["Номер"]; attachDocuments = attachDocsBefore; docsType = attachDocuments.FirstOrDefault() != null?attachDocuments.First().Type : TypeRecognizeHelper(); int cost; int.TryParse(rowToEdit["Cost"].ToString(), out cost); formCreateDocs = new Form12AttachDocuments(editId, attachDocsBefore, docsType, cost, new CreateDocsCallback(ReadDocsCallback)); }
void AttachDocuments(DocType type) { //TODO: Тут должен быть проверка на смену ранее прикрепленных документов if (docsForInsert != null) { docsForInsert.Clear(); } formCreateDocs = new Form12AttachDocuments(new CreateDocsCallback(ReadAttachDocsCallback), type); try { formCreateDocs.ShowDialog(); //linkLabel1.Sho //label6.Visible = true; } catch (Exception exc) { MessageBox.Show("Форма не смогла создать документы, возможно были введены некорректные данные" + exc.Message, "Критическая ошибка", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }