/// <summary> /// 修改一条数据 /// </summary> /// <returns></returns> public async Task <ApiResult <string> > ModifyAsync(ErpTransfer parm) { var res = new ApiResult <string>() { data = "1", statusCode = 200 }; try { var dbres = ErpTransferDb.Update(parm); if (!dbres) { res.statusCode = (int)ApiEnum.Error; res.message = "修改数据失败~"; } } catch (Exception ex) { res.statusCode = (int)ApiEnum.Error; res.message = ApiEnum.Error.GetEnumText() + ex.Message; } return(await Task.Run(() => res)); }
/// <summary> /// 添加一条数据 /// </summary> /// <returns></returns> public async Task <ApiResult <string> > AddAsync(ErpTransfer parm) { var res = new ApiResult <string>() { data = "1", statusCode = 200 }; try { parm.Guid = Guid.NewGuid().ToString(); var dbres = ErpTransferDb.Insert(parm); if (!dbres) { res.statusCode = (int)ApiEnum.Error; res.message = "插入数据失败~"; } } catch (Exception ex) { res.statusCode = (int)ApiEnum.Error; res.message = ApiEnum.Error.GetEnumText() + ex.Message; } return(await Task.Run(() => res)); }
public async Task <ApiResult <string> > EditTransfer(ErpTransfer parm) { return(await _transferService.ModifyAsync(parm)); }
public async Task <ApiResult <string> > AddTransferAsync(ErpTransfer parm) { return(await _transferService.AddAsync(parm)); }