public async Task <IActionResult> Post([FromBody] DemandViewModel editModel) { var demand = _mapper.Map <Demand>(editModel); var dt = DateTime.Now; demand.BillCode = dt.ToString("yyMMddHHmmss"); demand.MakeDate = dt; demand.Maker = this.aspNetUser.Name; int r = await _demandService.AddAsync(demand); return(ApiResult(r > 0? "提交成功!" : "提交失败!")); }
public async Task <IActionResult> Post([FromBody] DemandView value) { string id = ""; var demand = this.mapper.Map <Demand>(value); var tm = this.mapper.ConfigurationProvider.FindTypeMapFor <DemandView, Demand>(); int r = await demandService.AddAsync(demand); ApiResult apiResult = new ApiResult(); if (r > 0) { apiResult.msg = "添加成功!"; } else { apiResult.msg = "添加失败!"; } var res = await billOperation.PostAsync(value); return(Ok(apiResult)); }