private void BtnUpdateClick(object sender, EventArgs e) { try { var result = MessageDialog.Instance.ShowMessage(this, "Q011"); if (result == DialogResult.No) { return; } if (_figure.Id == 0) { figureRepository.Insert(_figure); return; } figureRepository.Update(_figure); } catch (Exception ex) { // MessageDialog.Instance.ShowMessage(this, "ERR0002", ex.Message); ExceptionHandler.Instance.HandlerException(ex); } finally { this.Close(); } }
private void btnUpdate_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Bạn có muốn cập nhật không?", "Cập nhật", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr == DialogResult.OK) { // Figure ent = FillToEntity(); if (_figure.Id == 0) { figureRepository.Insert(_figure); } else { figureRepository.Update(_figure); } this.Close(); } }