private void btnSend_Click(object sender, EventArgs e) { CoverObjectUtility.GetAutoBindingData(this, _mReq); _mReq.SetCreate(); _mReq.Email = txtEmail.Text; try { using (IUnitOfWork uow = new UnitOfWork()) { uow.RequestPaymentBaseRepository.Add(_mReq); uow.Commit(); } InformationMailModel mail = new InformationMailModel(); mail.Subject = _mReq.Title; mail.SendersAddress = "*****@*****.**"; mail.SenderPassword = "******"; mail.Content = _mReq.RequestContent; mail.ReceiverAddress = _mReq.Email; IMailHandler iMailHandler = new MailHandler(); iMailHandler.SendMail(mail); if (AddRequestCode != null) { DebtDetail detail = new DebtDetail(); detail.Payment = 0; detail.PaymentDate = null; detail.RequestPaymentCode = _mReq.RequestCode; AddRequestCode(detail, Utility.CRUD.Insert); } lblNotify.SetText(UI.success, ToolBoxCS.LabelNotify.EnumStatus.Success); } catch { lblNotify.SetText(UI.failed, ToolBoxCS.LabelNotify.EnumStatus.Failed); } }