private void btnSave_Click(object sender, EventArgs e) { if (!ValidationUtility.FieldNotAllowNull(this)) { return; } Model.Bank bank = new Model.Bank(); CoverObjectUtility.GetAutoBindingData(this, bank); //bank.BankCode = txtCode.Text; //bank.BankName = txtName.Text; //bank.Address = txtAddress.Text; //bank.Phone = txtPhone.Text; //bank.Fax = txtFax.Text; //bank.Email = txtEmail.Text; //bank.Note = txtNote.Text; bank.SetCreate(); if (bank == null) { return; } try { using (IUnitOfWork uow = new UnitOfWork()) { uow.BankBaseRepository.Add(bank); uow.Commit(); } labelNotify1.SetText(UI.createsuccess, ToolBoxCS.LabelNotify.EnumStatus.Success); if (addnewBank != null) { addnewBank(bank, CRUD.Insert); } Close(); } catch { labelNotify1.SetText(UI.createfailed, ToolBoxCS.LabelNotify.EnumStatus.Failed); } }