/// <summary> /// 描述:新增问题 /// </summary> /// <param name="model"></param> /// <param name="loginUser"></param> /// <returns></returns> public static ProblemViewModel SaveNewProblem(ProblemInfoModel model, UserLoginInfo loginUser) { var result = new ProblemViewModel() { IsSuccess = true }; try { //add if (model.Id == 0) { //add model.PIProblemNo = GenerateProblemNo(); model.PIIsValid = 1; model.PICreateUserNo = loginUser.JobNum; model.PICreateUserName = loginUser.UserName; model.PICreateTime = DateTime.Now; model.PIOperateUserNo = loginUser.JobNum; model.PIOperateUserName = loginUser.UserName; model.PIOperateTime = DateTime.Now; model.Id = _problemDal.Insert(model); result.Message = EncryptHelper.DesEncrypt(model.Id.ToString()); //TODO result.data = model; LogBusiness.Problemfollow(model.PIProblemNo, "Create Problem", "ProblemInfo", string.Empty); } else { //Update model.PIOperateUserNo = loginUser.JobNum; model.PIOperateUserName = loginUser.UserName; model.PIOperateTime = DateTime.Now; _problemDal.Update(model); result.Message = EncryptHelper.DesEncrypt(model.Id.ToString()); //TODO result.data = model; LogBusiness.Problemfollow(model.PIProblemNo, "Edit Problem", "ProblemInfo", string.Empty); } } catch (Exception ex) { result.IsSuccess = false; result.Message = ex.Message; } return(result); }
/// <summary> /// 更新状态 /// </summary> /// <param name="proId"></param> /// <param name="status"></param> /// <returns></returns> public static ProblemViewModel UpdateProblemStatus(ProblemInfoModel proInfo, UserLoginInfo loginUser) { var returnvalue = new ProblemViewModel() { IsSuccess = false }; proInfo.PIOperateUserNo = loginUser.JobNum; proInfo.PIOperateUserName = loginUser.UserName; proInfo.PIOperateTime = DateTime.Now; try { var result = _problemDal.Update(proInfo); LogBusiness.Problemfollow(proInfo.PIProblemNo, "Approve Problem", "ProblemInfo", string.Empty); returnvalue.IsSuccess = result; } catch (Exception ex) { returnvalue.IsSuccess = false; returnvalue.Message = ex.Message; } return(returnvalue); }