public ActionResult Create()
 {
     AccountingPeriodAccountBalanceViewModel accountingPeriodAccountBalanceViewModel = new AccountingPeriodAccountBalanceViewModel();
     accountingPeriodAccountBalanceViewModel.AccountingPeriodAccountBalance = new Models.AccountingPeriodAccountBalance();
     accountingPeriodAccountBalanceViewModel.AccountingPeriodAccountBalance.Active = true;
     return View(SetupAccountingPeriodAccountBalanceViewModel(accountingPeriodAccountBalanceViewModel));
 }
        public ActionResult Edit(AccountingPeriodAccountBalanceViewModel accountingPeriodAccountBalanceViewModel)
        {
            if (ModelState.IsValid)
            {
                unitOfWork.AccountingPeriodAccountBalanceRepository.Update(accountingPeriodAccountBalanceViewModel.AccountingPeriodAccountBalance);
                unitOfWork.Save();
                return RedirectToAction("Index");
            }

            return View(accountingPeriodAccountBalanceViewModel);
        }
        public ActionResult Create(AccountingPeriodAccountBalanceViewModel accountingPeriodAccountBalanceViewModel)
        {
            if (ModelState.IsValid)
            {
                unitOfWork.AccountingPeriodAccountBalanceRepository.Insert(accountingPeriodAccountBalanceViewModel.AccountingPeriodAccountBalance);
                unitOfWork.Save();
                return RedirectToAction("Index");
            }

            return View(SetupAccountingPeriodAccountBalanceViewModel(accountingPeriodAccountBalanceViewModel));
        }
 private AccountingPeriodAccountBalanceViewModel SetupAccountingPeriodAccountBalanceViewModel(AccountingPeriodAccountBalanceViewModel accountingPeriodAccountBalanceViewModel)
 {
     accountingPeriodAccountBalanceViewModel.AccountingAccountSelectList = unitOfWork.AccountingTransactionAccountRepository.AccountingAccountSelectList(accountingPeriodAccountBalanceViewModel.AccountingPeriodAccountBalance.AccountTransactionAccountID);
     accountingPeriodAccountBalanceViewModel.AccountingPeriodTimeFrameSelectList = unitOfWork.AccountingPeriodTimeFrameRepository.AccountingPeriodTimeFrameSelectList(accountingPeriodAccountBalanceViewModel.AccountingPeriodAccountBalance.AccountingPeriodTimeFrameID);
     return accountingPeriodAccountBalanceViewModel;
 }
 public ActionResult Edit(int accountTransactionAccountID, int accountingPeriodTimeFrameID)
 {
     AccountingPeriodAccountBalanceViewModel accountingPeriodAccountBalanceViewModel = new AccountingPeriodAccountBalanceViewModel();
     accountingPeriodAccountBalanceViewModel.AccountingPeriodAccountBalance = unitOfWork.AccountingPeriodAccountBalanceRepository.GetByID(accountTransactionAccountID, accountingPeriodTimeFrameID);
     return View(accountingPeriodAccountBalanceViewModel);
 }