public AccountController() { var propertyRepository = RepositoryFactory.GetPropertyRepository(); var accountRepository = RepositoryFactory.GetAccountRepository(); var transactionRepository = RepositoryFactory.GetTransactionRepository(); _accountApp = new AccountApp(accountRepository, propertyRepository, transactionRepository); }
public ActionResult SaveAccount(AccountDto accountToSave) { var login = Request.Headers["login"]; var token = Request.Headers["token"]; var propertyId = Convert.ToInt32(Request.Headers["propertyId"]); if (!ValidatePost(login, token, propertyId)) return Json("usuário inválido", JsonRequestBehavior.AllowGet); var accountApp = new AccountApp(_accountRepository, _propertyRepository, _transactionRepository); accountApp.Save(propertyId, accountToSave); return Json("OK"); }