/// <summary> /// 修改 /// </summary> /// <param name="id"></param> /// <param name="model"></param> /// <returns></returns> public async Task <FuncResult> Update(int id, ApdFtcGasModel model) { ApdFctGas entity; try { entity = await context.ApdFctGas.FirstOrDefaultAsync(m => m.RecordId == model.RecordId); if (entity == null) { return(new FuncResult() { IsSuccess = false, Message = "用户ID错误!" }); } entity.OrgCode = model.OrgCode; entity.Gas = model.Gas; entity.Other = model.Other; entity.Remark = model.Remark; //entity.LAST_UPDATED_BY = HttpContext.CurrentUser(cache).Id; entity.LastUpdateDate = DateTime.Now; context.ApdFctGas.Update(entity); await context.SaveChangesAsync(); } catch (Exception ex) { LogService.WriteError(ex); return(new FuncResult() { IsSuccess = false, Message = "修改时发生了意料之外的错误" }); } return(new FuncResult() { IsSuccess = true, Content = entity, Message = "修改成功" }); }
public async Task <FuncResult> Update(int id, [FromBody] ApdFtcGasModel model) { FuncResult data = await gasBll.Update(id, model); return(data); }