public ActionResult _MakeAdjustment(int customerId) { InitialiseCustomerAccountsViewBagAndAddSelector(customerId); var ad = new AdjustmentVM() { CustomerId = customerId, CustomerAccountId = -1, }; return(PartialView(ad)); }
public ActionResult _MakeAdjustment(int id) { var transaction = _accountsService.GetTransaction(id); var ad = new AdjustmentVM() { CustomerId = transaction.CustomerAccount.CustomerId, CustomerAccountId = transaction.CustomerAccountId, CustomerAccount = string.Format("{0} - {1}", transaction.CustomerAccountId, transaction.CustomerAccount.AccountType), TransactionDate = DateTime.Today, AccountTransactionTypeId = (int)transaction.AccountTransactionType, AccountTransactionType = transaction.AccountTransactionType.GetDescription(), Amount = transaction.Amount, GroupId = transaction.GroupId, }; return(PartialView(ad)); }
public ActionResult _MakeAdjustment(AdjustmentVM mAdjustmentVM) { if (TryValidateModel(mAdjustmentVM)) { if (ExecuteRepositoryAction(() => { _accountsService.AddAccountTransaction( mAdjustmentVM.CustomerAccountId, (AccountTransactionType)mAdjustmentVM.AccountTransactionTypeId, mAdjustmentVM.Amount, AccountTransactionInputType.Adjustment, mAdjustmentVM.GroupId, mAdjustmentVM.Note); _accountsService.CommitChanges(); })) { return(ReturnJsonFormSuccess()); } } return(PartialView(mAdjustmentVM)); }