public async Task <ApiResult> Update(Wfprocess obj) { ApiResult ret = new ApiResult(); try { Wfprocess et = await _repo.GetByID(obj.ID); if (et != null) { DateTime dt = DateTime.Now; //obj.UpdatedTime = dt; //obj.UpdatedBy = _userID; ret.data = await _repo.Update(obj); ret.code = Code.Success; } else { ret.code = Code.DataIsnotExist; ret.msg = "所要修改的数据不存在"; } return(ret); } catch (Exception ex) { ret.code = Code.Failure; ret.msg = ex.Message; return(ret); } }
public async Task <ApiResult> GetByID(int id) { ApiResult ret = new ApiResult(); try { Wfprocess obj = await _repo.GetByID(id); ret.data = obj; ret.code = Code.Success; return(ret); } catch (Exception ex) { ret.code = Code.Failure; ret.msg = ex.Message; return(ret); } }
public async Task <ApiResult> Save(Wfprocess obj) { ApiResult ret = new ApiResult(); try { //DateTime dt = DateTime.Now; //obj.UpdatedTime = dt; //obj.CreatedTime = dt; //obj.UpdatedBy = _userID; //obj.CreatedBy = _userID; ret.data = await _repo.Save(obj); ret.code = Code.Success; return(ret); } catch (Exception ex) { ret.code = Code.Failure; ret.msg = ex.Message; return(ret); } }