/// <summary> /// 修改一条数据 /// </summary> /// <returns></returns> public async Task <ApiResult <string> > ModifyAsync(ErpPurchaseGoods parm) { var res = new ApiResult <string>() { data = "1", statusCode = 200 }; try { var dbres = ErpPurchaseGoodsDb.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(ErpPurchaseGoods parm) { var res = new ApiResult <string>() { data = "1", statusCode = 200 }; try { parm.Guid = Guid.NewGuid().ToString(); var dbres = ErpPurchaseGoodsDb.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> > EditGoods(ErpPurchaseGoods parm) { return(await _purchaseGoodsService.ModifyAsync(parm)); }
public async Task <ApiResult <string> > AddGoods(ErpPurchaseGoods parm) { return(await _purchaseGoodsService.AddAsync(parm)); }