| | |
| | | if (String.IsNullOrEmpty(entity.Id)) |
| | | { |
| | | entity.Id = Guid.NewGuid().ToString(); |
| | | dto.Id = entity.Id; |
| | | var datestreing = DateTime.Now.ToString("yyyyMMdd"); |
| | | var OrderNo = _context.CooperOrders.Where(x => x.OrderNo.Contains(datestreing)).Max(x=>x.OrderNo); |
| | | if (string.IsNullOrEmpty(OrderNo)) |
| | |
| | | public List<TChallengeItemDTO> GetListChallengeItem(string ChallengeId) |
| | | { |
| | | |
| | | var entity = _context.TChallengeItems.Where(x => x.ChallengeId == ChallengeId).ToList(); |
| | | var entity = _context.TChallengeItems.Where(x => x.ChallengeId == ChallengeId).OrderBy(x => x.Sort).ToList(); |
| | | |
| | | |
| | | |
| | |
| | | updateproject.Evidential = entity.Evidential; |
| | | updateproject.Law = entity.Law; |
| | | updateproject.Sort = entity.Sort; |
| | | |
| | | updateproject.Lawcoment = entity.Lawcoment; |
| | | |
| | | } |
| | | |
| | |
| | | public List<TComplaintItemDTO> GetListComplaintItem(string ComplaintId) |
| | | { |
| | | |
| | | var entity = _context.TComplaintItems.Where(x => x.ComplaintId == ComplaintId).ToList(); |
| | | var entity = _context.TComplaintItems.Where(x => x.ComplaintId == ComplaintId).OrderBy(x => x.Sort).ToList(); |
| | | |
| | | |
| | | |
| | |
| | | updateproject.Evidential = entity.Evidential; |
| | | updateproject.Law = entity.Law; |
| | | updateproject.Sort = entity.Sort; |
| | | updateproject.Lawcoment = entity.Lawcoment; |
| | | |
| | | |
| | | } |
| | |
| | | public List<TComplaintRespondentDTO> GetListComplaintRespondent(string ComplaintId) |
| | | { |
| | | |
| | | var entity = _context.TComplaintRespondents.Where(x => x.ComplaintId == ComplaintId).ToList(); |
| | | var entity = _context.TComplaintRespondents.Where(x => x.ComplaintId == ComplaintId).OrderBy(x => x.Sort).ToList(); |
| | | |
| | | |
| | | |
| | |
| | | return resultEntity; |
| | | } |
| | | |
| | | public List<TComplaintGongyingshangDTO> GetListComplaintGongyingshang(string ComplaintId) |
| | | { |
| | | |
| | | var entity = _context.TComplaintGongyingshangs.Where(x => x.ComplaintId == ComplaintId).OrderBy(x => x.Sort).ToList(); |
| | | |
| | | |
| | | |
| | | var result = _mapper.Map<List<TComplaintGongyingshangDTO>>(entity); |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public ResultEntity saveComplaintGongyingshang(TComplaintGongyingshangDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | |
| | | |
| | | var entity = _mapper.Map<TComplaintGongyingshang>(dto); |
| | | |
| | | |
| | | if (entity.Id <= 0) |
| | | { |
| | | |
| | | |
| | | _context.TComplaintGongyingshangs.Add(entity); |
| | | } |
| | | else |
| | | { |
| | | var updateproject = _context.TComplaintGongyingshangs.Find(entity.Id); |
| | | |
| | | |
| | | updateproject.ComplaintId = entity.ComplaintId; |
| | | updateproject.Gongytingshang = entity.Gongytingshang; |
| | | updateproject.Dizhi = entity.Dizhi; |
| | | updateproject.Youbian = entity.Youbian; |
| | | updateproject.Lianxiren = entity.Lianxiren; |
| | | updateproject.Lianxidianhua = entity.Lianxidianhua; |
| | | |
| | | updateproject.Sort = entity.Sort; |
| | | |
| | | |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = entity.Id.ToString(); |
| | | resultEntity.Result = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "保存失败,请联系管理员"; |
| | | |
| | | } |
| | | return resultEntity; |
| | | } |
| | | |
| | | public List<TComplaintShouquandaibiaoDTO> GetListComplaintShouquandaibiao(string ComplaintId) |
| | | { |
| | | |
| | | var entity = _context.TComplaintShouquandaibiaos.Where(x => x.ComplaintId == ComplaintId).OrderBy(x=>x.Sort).ToList(); |
| | | |
| | | |
| | | |
| | | var result = _mapper.Map<List<TComplaintShouquandaibiaoDTO>>(entity); |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public ResultEntity saveComplaintShouquandaibiao(TComplaintShouquandaibiaoDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | |
| | | |
| | | var entity = _mapper.Map<TComplaintShouquandaibiao>(dto); |
| | | |
| | | |
| | | if (entity.Id <= 0) |
| | | { |
| | | |
| | | |
| | | _context.TComplaintShouquandaibiaos.Add(entity); |
| | | } |
| | | else |
| | | { |
| | | var updateproject = _context.TComplaintShouquandaibiaos.Find(entity.Id); |
| | | |
| | | |
| | | updateproject.ComplaintId = entity.ComplaintId; |
| | | updateproject.Shouquandaibiao = entity.Shouquandaibiao; |
| | | updateproject.Dizhi = entity.Dizhi; |
| | | updateproject.Youbian = entity.Youbian; |
| | | updateproject.Lianxidianhua = entity.Lianxidianhua; |
| | | updateproject.Sort = entity.Sort; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = entity.Id.ToString(); |
| | | resultEntity.Result = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "保存失败,请联系管理员"; |
| | | |
| | | } |
| | | return resultEntity; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除质疑函子表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResultEntity deleteChallengeItem(string ChallengeId) |
| | | { |
| | | ResultEntity result = new ResultEntity(); |
| | | result.Result = true; |
| | | |
| | | var models = _context.TChallengeItems.Where(x => x.ChallengeId == ChallengeId).ToList(); ; |
| | | |
| | | foreach(var challengeItem in models) |
| | | { |
| | | _context.TChallengeItems.Remove(challengeItem); |
| | | } |
| | | _context.SaveChanges(); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除投诉书子表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResultEntity deleteComplaintItem(string ComplaintId) |
| | | { |
| | | ResultEntity result = new ResultEntity(); |
| | | result.Result = true; |
| | | |
| | | var models = _context.TComplaintItems.Where(x => x.ComplaintId == ComplaintId).ToList(); ; |
| | | |
| | | foreach (var complaintItem in models) |
| | | { |
| | | _context.TComplaintItems.Remove(complaintItem); |
| | | } |
| | | _context.SaveChanges(); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除被投诉人子表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResultEntity deleteComplaintRespondent(string ComplaintId) |
| | | { |
| | | ResultEntity result = new ResultEntity(); |
| | | result.Result = true; |
| | | |
| | | var models = _context.TComplaintRespondents.Where(x => x.ComplaintId == ComplaintId).ToList(); ; |
| | | |
| | | foreach (var complaintRespondent in models) |
| | | { |
| | | _context.TComplaintRespondents.Remove(complaintRespondent); |
| | | } |
| | | _context.SaveChanges(); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除相关供应商子表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResultEntity deleteComplaintGongyingshang(string ComplaintId) |
| | | { |
| | | ResultEntity result = new ResultEntity(); |
| | | result.Result = true; |
| | | |
| | | var models = _context.TComplaintGongyingshangs.Where(x => x.ComplaintId == ComplaintId).ToList(); ; |
| | | |
| | | foreach (var complaintGongyingshang in models) |
| | | { |
| | | _context.TComplaintGongyingshangs.Remove(complaintGongyingshang); |
| | | } |
| | | _context.SaveChanges(); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除相关供应商子表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResultEntity deleteComplaintShouquandaibiao(string ComplaintId) |
| | | { |
| | | ResultEntity result = new ResultEntity(); |
| | | result.Result = true; |
| | | |
| | | var models = _context.TComplaintShouquandaibiaos.Where(x => x.ComplaintId == ComplaintId).ToList(); ; |
| | | |
| | | foreach (var complaintShouquandaibiao in models) |
| | | { |
| | | _context.TComplaintShouquandaibiaos.Remove(complaintShouquandaibiao); |
| | | } |
| | | _context.SaveChanges(); |
| | | return result; |
| | | } |
| | | } |
| | | } |