Exemplo n.º 1
0
 public ActionResult _ReceiveCollections(ReceiveCollectionsVM mReceiveCollectionsVM)
 {
     try
     {
         var collectionsWithPayments = mReceiveCollectionsVM.Collections.Where(c => c.Payment != 0);
         foreach (var collection in collectionsWithPayments)
         {
             _accountTransactionService.AddAccountTransaction(collection.CustomerAccountId,
                                                              (AccountTransactionType)collection.AccountTransactionType, -(decimal)collection.Payment, AccountTransactionInputType.Payment, collection.GroupId, collection.Note);
         }
         _accountTransactionService.CommitChanges();
         return(ReturnJsonFormSuccess());
     }
     catch (Exception ex)
     {
         return(ReturnJsonError(ex.Message));
     }
 }
        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));
        }