private void btnUpdate_Click(object sender, EventArgs e) { var dr = MessageBox.Show(ConstantInfo.CONFIRM_UPDATE, "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr != DialogResult.Yes) { return; } if (_mode == 1) { if (validate()) { tblCompany company = new tblCompany(); company.CompanyCode = txtCompanyCode.Text; company.CompanyName = txtCompanyName.Text.Trim(); company.Description = txtDescription.Text.Trim(); company.ModifiedBy = _userInfo.UserID; if (CompanyFactory.Update(company) > 0) { try { _frmListCompany.search(); } catch (Exception ex) { //do nothing } MessageBox.Show("Cập doanh nghiệp hình thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Cập nhật doanh nghiệp không thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }