public TransferOutDTO GetTransferDTO(int accountId) { TransferOutDTO dto = new TransferOutDTO(); using (BaseContext context = ContextFactory.Create()) { IUnitOfWork uow = new BaseUnitOfWork(context); IRepository <Account> accountRepository = uow.GetRepository <Account>(); dto.Account = accountRepository.GetAll(x => x.Id == accountId && x.Status == 1).FirstOrDefault(); return(dto); } }
public ActionResult Transfer() { string accountId = Request.QueryString["Acc"]; if (string.IsNullOrWhiteSpace(accountId)) { ViewBag.EmptyAccount = 1; return(View()); } else { int accountIntId = Convert.ToInt32(accountId); TransferOutDTO dto = _accountService.GetTransferDTO(accountIntId); return(View(dto)); } }