//发布者审核 认领人上传的 处理结果信息 审核不通过,志愿者重新上传处理结果 public BaseViewModel SetSignReturn(ContentIDandVIDModel model) { BaseViewModel result = new BaseViewModel(); //该互助信息 VHelpArea area = _IVHelpAreaRepository.SearchInfoByID(model.ContentID); //获取 志愿者 上传的 处理结果的信息进行审核 List <VHA_Sign> list = _IVHA_SignRepository.GetByContentID(model.ContentID, "2"); VHA_Sign item = list.First(); item.opinion = "审核不通过,志愿者重新上传处理结果"; item.Status = "2"; item.UpdateUser = area.CreateUser; item.UpdateDate = DateTime.Now; _IVHA_SignRepository.Update(item); int a = _IVHA_SignRepository.SaveChanges(); //本次处理结果 审核信息通过 VHA_Handle modelHandle = _IVHA_HandleRepository.GetVolunteerHandle(item.bak1); modelHandle.Status = "2"; modelHandle.UpdateUser = area.CreateUser; modelHandle.UpdateDate = DateTime.Now; _IVHA_HandleRepository.Update(modelHandle); int b = _IVHA_HandleRepository.SaveChanges(); if (b > 0) { //提示信息:您认领标题为XXX互助信息,互助信息,处理审核不通过,请重新上传处理结果 Volunteer_MessageMiddle middle = new Volunteer_MessageMiddle(); middle.Contents = "您认领标题为 " + area.Title + " 互助信息,处理审核不通过,请重新上传处理结果"; Volunteer_Info volunteer_Info = _IVolunteerInfoRepository.SearchInfoByID(model.VID); middle.Name = volunteer_Info.Name; middle.VID = volunteer_Info.ID; middle.VNO = volunteer_Info.VNO; Volunteer_Message message = _IMapper.Map <Volunteer_MessageMiddle, Volunteer_Message>(middle); message.ID = Guid.NewGuid().ToString(); message.CreateDate = DateTime.Now; message.CreateUser = model.VID; message.Status = "0"; _IVolunteer_MessageRepository.Add(message); int f = _IVolunteer_MessageRepository.SaveChanges(); result.ResponseCode = 200; result.Message = "操作成功"; } else { result.ResponseCode = 400; result.Message = "操作失败"; } return(result); }
//获取 处理信息 public VHA_Handle GetVolunteerHandle(string ID) { VHA_Handle model = new VHA_Handle(); //查询条件 var predicate = WhereExtension.True <VHA_Handle>();//初始化where表达式 if (!String.IsNullOrEmpty(ID)) { predicate = predicate.And(p => p.ID.Contains(ID)); } var result = DbSet.Where(predicate) .OrderBy(o => o.CreateDate).ToList(); if (result.Count() > 0) { model = result.First(); } return(model); }
//发布者审核 认领人上传的 处理结果信息 审核通过任务完结 public BaseViewModel SetSignPass(ContentIDandVIDModel model) { BaseViewModel result = new BaseViewModel(); var VolunteerInfo = _IVolunteerInfoRepository.SearchInfoByID(model.VID); if (VolunteerInfo == null) { result.ResponseCode = 400; result.Message = "操作失败"; return(result); } //该互助信息 更新状态为 已完结 2 VHelpArea area = _IVHelpAreaRepository.SearchInfoByID(model.ContentID); //获取 志愿者 上传的 处理结果的信息进行审核 List <VHA_Sign> list = _IVHA_SignRepository.GetByContentID(model.ContentID, "2"); VHA_Sign item = list.First(); item.opinion = "审核通过,任务完结"; item.Status = "1"; item.UpdateUser = area.CreateUser; item.UpdateDate = DateTime.Now; _IVHA_SignRepository.Update(item); int a = _IVHA_SignRepository.SaveChanges(); //本次处理结果 审核信息通过 VHA_Handle modelHandle = _IVHA_HandleRepository.GetVolunteerHandle(item.bak1); modelHandle.Status = "1"; modelHandle.UpdateUser = area.CreateUser; modelHandle.UpdateDate = DateTime.Now; _IVHA_HandleRepository.Update(modelHandle); int b = _IVHA_HandleRepository.SaveChanges(); area.Status = "2"; area.UpdateUser = area.CreateUser; area.UpdateDate = DateTime.Now; _IVHelpAreaRepository.Update(area); int c = _IVHelpAreaRepository.SaveChanges(); if (c > 0) { string id = Guid.NewGuid().ToString(); //插入积分表 Volunteer_Score score = new Volunteer_Score(); score.ID = id; score.ContentID = model.ContentID; score.tableName = "VHelpArea"; score.VID = model.VID; score.type = "done"; score.Score = double.Parse(area.Score); score.CreateUser = model.VID; score.CreateDate = DateTime.Now; _IVolunteer_ScoreRepository.Add(score); int n = _IVolunteer_ScoreRepository.SaveChanges(); if (n > 0) { //插入到 泰便利积分表 20200622 ET_points ipointMiddle = new ET_points(); ipointMiddle.ID = id; ipointMiddle.uid = VolunteerInfo.ID; ipointMiddle.points = double.Parse(area.Score); ipointMiddle.type = "VolunteerHelp"; ipointMiddle.tableName = "TedaVolunteerDB.dbo.Volunteer_Score"; ipointMiddle.CreateUser = VolunteerInfo.ID; ipointMiddle.CreateDate = DateTime.Now; eT_PointsRepository.Add(ipointMiddle); int j = eT_PointsRepository.SaveChanges(); } //提示信息:您认领标题为XXX互助信息,互助信息,处理审核通过,任务完结 Volunteer_MessageMiddle middle = new Volunteer_MessageMiddle(); middle.Contents = "您认领标题为 " + area.Title + " 互助信息,处理审核通过,任务完结"; Volunteer_Info volunteer_Info = _IVolunteerInfoRepository.SearchInfoByID(model.VID); middle.Name = volunteer_Info.Name; middle.VID = volunteer_Info.ID; middle.VNO = volunteer_Info.VNO; Volunteer_Message message = _IMapper.Map <Volunteer_MessageMiddle, Volunteer_Message>(middle); message.ID = Guid.NewGuid().ToString(); message.CreateDate = DateTime.Now; message.CreateUser = model.VID; message.Status = "0"; _IVolunteer_MessageRepository.Add(message); int f = _IVolunteer_MessageRepository.SaveChanges(); result.ResponseCode = 200; result.Message = "操作成功"; } else { result.ResponseCode = 400; result.Message = "操作失败"; } return(result); }
public virtual void Update(VHA_Handle obj) { DbSet.Update(obj); }
public virtual void Add(VHA_Handle obj) { DbSet.Add(obj); }