Пример #1
0
        public ActionResult ImportMovements(ImportMovementEditModel model)
        {
            if (model.Expenses != null)
            {
                model.Expenses.ForEach(x => { x.AccountId = model.AccountId; x.HasBeenAlreadyDebited = true; });
                _expenditureService.CreateExpenditures(model.Expenses.ToList());
            }

            if (model.Incomes != null)
            {
                model.Incomes.ForEach(x => { x.AccountId = model.AccountId; });
                _incomeService.CreateIncomes(model.Incomes.ToList());
            }

            if (model.AtmWithdraws != null)
            {
                model.AtmWithdraws.ForEach(x => { x.AccountId = model.AccountId; x.HasBeenAlreadyDebited = true; });
                _atmWithdrawService.CreateAtmWithdraws(model.AtmWithdraws.ToList());
            }

            return(RedirectToAction("Index"));
        }
 public void CreateIncomes([FromBody] List <IncomeDetails> createdObjs)
 {
     _IncomeService.CreateIncomes(createdObjs);
 }