public async Task <IActionResult> Create(long id) { var contract = this.contractService.GetById(id); MoneyInCreateInputModel moneyInCreateInputModel = new MoneyInCreateInputModel() { ContractId = id, OperationAmount = contract.PremiumAmount }; return(this.View(moneyInCreateInputModel)); }
public async Task <IActionResult> Create(MoneyInCreateInputModel moneyInCreateInputModel) { if (!this.ModelState.IsValid) { return(this.View()); } MoneyInServiceModel moneyInServiceModel = AutoMapper.Mapper.Map <MoneyInServiceModel>(moneyInCreateInputModel); moneyInServiceModel.ContractId = moneyInCreateInputModel.Id; moneyInServiceModel.Id = 0; await this.moneyInService.Create(moneyInServiceModel); await this.contractService.TryToApplyFinancial(moneyInServiceModel.ContractId); this.TempData["info"] = String.Format(MONEYIN_CREATED); return(this.Redirect($"/Contract/Details/{moneyInServiceModel.ContractId}")); }