private void btnSave_Click(object sender, EventArgs e) { if (!Document.UpdateDocument()) { string msg = "Изменения не внесены.\n" + Document.Error.Message; ErrorMsgBox.Show("Ошибка.", msg, Document.Error.ToString()); this.Close(); } else { Document.EndEdit(); MessageBox.Show("Изменения внесены.", "Информация", MessageBoxButtons.OK); Document.BeginEdit(); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (!Document.UpdateDocument()) { string msg = Document.Error.Message; ErrorMsgBox.Show("Ошбика.", msg, Document.Error.ToString()); } ; Document.EndEdit(); MessageBox.Show("Изменения сохранены", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); Document.BeginEdit(); //this.Close(); } catch (Exception exception) { ErrorMsgBox.Show("Ошбика.", "Изменения не были внесены. " + exception.Message, exception.ToString()); this.Close(); } }
public static void Show(string caption, string message, string info) { ErrorMsgBox box = new ErrorMsgBox(caption, message, info); box.ShowDialog(); }