private void SelectCreatedDocumentButton_Click(object sender, EventArgs e) { ComboBox documentsBox = (ComboBox)Utils.FindControl(this, "createdDocumentsBox"); Document document = (Document)documentsBox.SelectedItem; if (document == null) { MessageBox.Show("Документ не выбран!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DocumentInfoForm documentInfoForm = new DocumentInfoForm(document); documentInfoForm.Activate(); documentInfoForm.ShowDialog(); } }
private void SelectPendingDocumentEvent(object sender, EventArgs e) { ComboBox pendingDocumentBox = (ComboBox)Utils.FindControl(this, "pendingDocumentsBox"); if (pendingDocumentBox.SelectedItem == null) { MessageBox.Show("Документ не выбран!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Document document = (Document)pendingDocumentBox.SelectedValue; DocumentInfoForm documentInfoForm = new DocumentInfoForm(document); documentInfoForm.Activate(); documentInfoForm.Show(); } }