/// <summary> /// 删除一条或多条数据 /// </summary> /// <returns></returns> public async Task <ApiResult <string> > DeleteAsync(string parm) { var res = new ApiResult <string>() { data = "1", statusCode = 200 }; try { var list = Utils.StrToListString(parm); var dbres = ErpPackLogDb.Update(m => new ErpPackLog() { IsDel = true }, m => list.Contains(m.Guid)); 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> > ModifyAsync(ErpPackLog parm) { var res = new ApiResult <string>() { data = "1", statusCode = 200 }; try { var dbres = ErpPackLogDb.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)); }