public ActionResult EditAccount(Models.ViewModels.Financials.EditAccountViewModel model) { var account = _financialService.GetAccounts().Where(a => a.Id == model.Id).FirstOrDefault(); account.AccountCode = model.AccountCode; account.AccountName = model.AccountName; _financialService.UpdateAccount(account); return(RedirectToAction("Accounts")); }
public ActionResult EditAccount(int id) { var account = _financialService.GetAccounts().Where(a => a.Id == id).FirstOrDefault(); Models.ViewModels.Financials.EditAccountViewModel model = new Models.ViewModels.Financials.EditAccountViewModel() { Id = account.Id, AccountCode = account.AccountCode, AccountName = account.AccountName, AccountClass = account.AccountClass.Name, Balance = account.Balance }; return(View(model)); }
public ActionResult EditAccount(int id) { var account = _financialService.GetAccounts().Where(a => a.Id == id).FirstOrDefault(); Models.ViewModels.Financials.EditAccountViewModel model = new Models.ViewModels.Financials.EditAccountViewModel() { Id = account.Id, AccountCode = account.AccountCode, AccountName = account.AccountName, AccountClass = account.AccountClass.Name, IsContraAccount = account.IsContraAccount, Balance = account.Balance, ParentAccountId = account.ParentAccountId }; model.Transactions = _financialService.MasterGeneralLedger(null, null, model.AccountCode); return(View(model)); }
public ActionResult EditAccount(int id) { var account = _financialService.GetAccounts().Where(a => a.Id == id).FirstOrDefault(); Models.ViewModels.Financials.EditAccountViewModel model = new Models.ViewModels.Financials.EditAccountViewModel() { Id = account.Id, AccountCode = account.AccountCode, AccountName = account.AccountName, AccountClass = account.AccountClass.Name, IsContraAccount = account.IsContraAccount, Balance = account.Balance, ParentAccountId = account.ParentAccountId }; model.Transactions = _financialService.MasterGeneralLedger(null, null, model.AccountCode); return View(model); }