| | |
| | | updateproject.Modifier = entity.Modifier; |
| | | updateproject.Modifytime = entity.Modifytime; |
| | | |
| | | updateproject.SonghuoGongsi = entity.SonghuoGongsi; |
| | | updateproject.SonghuoDanhao = entity.SonghuoDanhao; |
| | | updateproject.SonghuoTime1 = entity.SonghuoTime1; |
| | | updateproject.HuifangJdr = entity.HuifangJdr; |
| | | updateproject.HuifangKehuyijian = entity.HuifangKehuyijian; |
| | | |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | |
| | | |
| | | } |
| | | return resultEntity; |
| | | } |
| | | |
| | | public string GetOrderNo() |
| | | { |
| | | string OrderNoback = ""; |
| | | var datestreing = DateTime.Now.ToString("yyyyMMdd"); |
| | | var OrderNo = _context.CooperOrders.Where(x => x.OrderNo.Contains(datestreing)).Max(x => x.OrderNo); |
| | | if (string.IsNullOrEmpty(OrderNo)) |
| | | { |
| | | OrderNoback = datestreing + 1.ToString().PadLeft(3, '0'); |
| | | } |
| | | else |
| | | { |
| | | OrderNoback = datestreing + (int.Parse(OrderNo.Substring(OrderNo.Length - 3)) + 1).ToString().PadLeft(3, '0'); |
| | | } |
| | | |
| | | |
| | | return OrderNoback; |
| | | } |
| | | |
| | | public CooperOrderDTO Get(string id) |
| | |
| | | string[] XdTimes = searchEntity.XdTime.Split("|"); |
| | | DateTime.TryParse(XdTimes[0], out XdTimestart); |
| | | DateTime.TryParse(XdTimes[1], out XdTimeend); |
| | | //XdTimeend = XdTimeend.AddDays(1); |
| | | XdTimeend = XdTimeend.AddDays(1); |
| | | } |
| | | |
| | | |
| | |
| | | into ksssss |
| | | from kkk in ksssss.DefaultIfEmpty() |
| | | |
| | | join l in _context.FiBooks |
| | | on a.OrderType1 equals l.Id |
| | | into lsssss |
| | | from lll in lsssss.DefaultIfEmpty() |
| | | |
| | | join m in _context.FiMembers |
| | | on a.OrderType1 equals m.Id |
| | | into msssss |
| | | from mmm in msssss.DefaultIfEmpty() |
| | | |
| | | where a.RecStatus == "A" |
| | | && (string.IsNullOrWhiteSpace(searchEntity.XdTime) || (a.XdTime >= XdTimestart && a.XdTime <= XdTimeend)) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.Ywjl) || ggg.Ywjl == searchEntity.Ywjl.Trim()) |
| | |
| | | && (string.IsNullOrWhiteSpace(searchEntity.WangongStatus) || a.WangongStatus == searchEntity.WangongStatus.Trim()) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.SonghuoStatus) || a.SonghuoStatus == searchEntity.SonghuoStatus.Trim()) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.HuifangStatussss) || a.HuifangStatus == searchEntity.HuifangStatussss.Trim()) |
| | | && (string.IsNullOrWhiteSpace(searchEntity.HuiyuanId) || ggg.HuiyuanId == searchEntity.HuiyuanId.Trim()) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | select new CooperOrderDTO |
| | | select new CooperOrderDTO |
| | | { |
| | | Id = a.Id, |
| | | XdTime = a.XdTime, |
| | |
| | | YouhuiStatus = kkk.Id, |
| | | OrderType1 = a.OrderType1, |
| | | OrderType2 = a.OrderType2, |
| | | OrderType1Name = string.IsNullOrEmpty(lll.BookName)? string.IsNullOrEmpty(mmm.MemberType)? a.OrderType1 : mmm.MemberType : lll.BookName, |
| | | |
| | | SonghuoGongsi = a.SonghuoGongsi, |
| | | SonghuoDanhao = a.SonghuoDanhao, |
| | | SonghuoTime1 = a.SonghuoTime1, |
| | | HuifangJdr = a.HuifangJdr, |
| | | HuifangKehuyijian = a.HuifangKehuyijian, |
| | | } |
| | | ).OrderByDescending(x => x.OrderNo).ToList(); |
| | | |
| | | |
| | | |
| | | if (searchEntity.totalrows == 0) |
| | | //if (searchEntity.totalrows == 0) |
| | | searchEntity.totalrows = query.Count(); |
| | | var lianlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | data.LoadData(searchEntity, lianlist); |
| | |
| | | updateproject.SonghuoStatus = dto.SonghuoStatus; |
| | | updateproject.Songhuoer = dto.Songhuoer; |
| | | updateproject.Songhuotime = dto.Songhuotime; |
| | | updateproject.ShouliStatus = dto.ShouliStatus; |
| | | |
| | | |
| | | updateproject.SonghuoTime1 = dto.SonghuoTime1; |
| | | updateproject.SonghuoDanhao = dto.SonghuoDanhao; |
| | | updateproject.SonghuoGongsi = dto.SonghuoGongsi; |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = dto.Id; |
| | |
| | | var updateproject = _context.CooperOrders.Find(dto.Id); |
| | | |
| | | |
| | | |
| | | |
| | | updateproject.HuifangKehuyijian = dto.HuifangKehuyijian; |
| | | updateproject.HuifangJdr = dto.HuifangJdr; |
| | | updateproject.Huifanger = dto.Huifanger; |
| | | updateproject.Huifangtime = dto.Huifangtime; |
| | | updateproject.HuifangStatus = dto.HuifangStatus; |
| | | updateproject.Huifangremark = dto.Huifangremark; |
| | | |
| | | updateproject.PingjiaStatus = dto.PingjiaStatus; |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = dto.Id; |
| | |
| | | public List<CooperOrderDTO> GetList(string userid, DateTime datemin, DateTime datemax) |
| | | { |
| | | |
| | | var entity = _context.CooperOrders.Where(x => x.RecStatus == "A" && x.Creater == userid && x.Shoulitime >= datemin && x.Shoulitime < datemax).ToList(); |
| | | var entity = _context.CooperOrders.Where(x => x.RecStatus == "A" && x.ShouliStatus != "0" && x.Creater == userid && x.Createtime >= datemin && x.Createtime < datemax).ToList(); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public List<CooperOrderDTO> GetListtongji(string userid, DateTime datemin, DateTime datemax) |
| | | { |
| | | var listCode = (from a in _context.SysCodeDtls |
| | | join b in _context.SysCodes |
| | | on a.CodeId equals b.Id |
| | | where a.RecStatus == "A" |
| | | && b.RecStatus == "A" |
| | | select new CodeDataEntity() |
| | | { |
| | | CodeId = b.Id, |
| | | CodeTable = b.CodeTable, |
| | | CodeField = b.CodeField, |
| | | CodeSn = a.CodeSn, |
| | | Comments = a.Comments, |
| | | Contents = a.Contents, |
| | | RecStatus = a.RecStatus, |
| | | Sort = a.Sort |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | var entity = (from a in _context.CooperOrders.Where(x => x.RecStatus == "A" && x.ShouliStatus != "0" && x.Creater == userid && x.Createtime >= datemin && x.Createtime < datemax) |
| | | |
| | | join b in listCode.Where(x => x.CodeTable == "CooperOrder" && x.CodeField == "shouli_status") |
| | | on a.ShouliStatus equals b.CodeSn |
| | | into bsss |
| | | from bbb in bsss.DefaultIfEmpty() |
| | | |
| | | join c in listCode.Where(x => x.CodeTable == "CooperOrder" && x.CodeField == "huifang_status") |
| | | on a.HuifangStatus equals c.CodeSn |
| | | into csss |
| | | from ccc in csss.DefaultIfEmpty() |
| | | |
| | | join d in listCode.Where(x => x.CodeTable == "CooperOrder" && x.CodeField == "pingjia_status") |
| | | on a.PingjiaStatus equals d.CodeSn |
| | | into dsss |
| | | from ddd in dsss.DefaultIfEmpty() |
| | | |
| | | join e in listCode.Where(x => x.CodeTable == "system" && x.CodeField == "shifou") |
| | | on a.ChedanStatus equals e.CodeSn |
| | | into esssss |
| | | from eee in esssss.DefaultIfEmpty() |
| | | |
| | | join f in listCode.Where(x => x.CodeTable == "CooperVisit" && x.CodeField == "jtype") |
| | | on a.OrderType equals f.CodeSn |
| | | into fsssss |
| | | from fff in fsssss.DefaultIfEmpty() |
| | | |
| | | |
| | | join g in _context.CooperatecustomCustomers.Where(x => x.RecStatus == "A") |
| | | on a.Khdw equals g.Id |
| | | into gsss |
| | | from ggg in gsss.DefaultIfEmpty() |
| | | |
| | | join h in _context.Projects.Where(x => x.RecStatus == "A") |
| | | on a.OrderPro equals h.Id |
| | | into hsss |
| | | from hhh in hsss.DefaultIfEmpty() |
| | | |
| | | join i in listCode.Where(x => x.CodeTable == "system" && x.CodeField == "shifou") |
| | | on a.WangongStatus equals i.CodeSn |
| | | into isssss |
| | | from iii in isssss.DefaultIfEmpty() |
| | | |
| | | join j in listCode.Where(x => x.CodeTable == "system" && x.CodeField == "shifou") |
| | | on a.SonghuoStatus equals j.CodeSn |
| | | into jsssss |
| | | from jjj in jsssss.DefaultIfEmpty() |
| | | |
| | | join k in _context.Oayouhuis.Where(x => x.Recstatus == "A") |
| | | on a.Id equals k.CooperOrderId |
| | | into ksssss |
| | | from kkk in ksssss.DefaultIfEmpty() |
| | | |
| | | join l in _context.FiBooks |
| | | on a.OrderType1 equals l.Id |
| | | into lsssss |
| | | from lll in lsssss.DefaultIfEmpty() |
| | | |
| | | join m in _context.FiMembers |
| | | on a.OrderType1 equals m.Id |
| | | into msssss |
| | | from mmm in msssss.DefaultIfEmpty() |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | select new CooperOrderDTO |
| | | { |
| | | Id = a.Id, |
| | | XdTime = a.XdTime, |
| | | XdTimeName = a.XdTime.ToString("yyyy-MM-dd"), |
| | | OrderNo = a.OrderNo, |
| | | Khdw = a.Khdw, |
| | | KhdwName = ggg.Name, |
| | | OrderType = a.OrderType, |
| | | OrderTypeName = fff.Comments, |
| | | |
| | | OrderPro = a.OrderPro, |
| | | OrderProName = hhh.Name, |
| | | OrderNum = a.OrderNum, |
| | | |
| | | Price = a.Price, |
| | | Money = a.Money, |
| | | Shr = a.Shr, |
| | | ShrAddress = a.ShrAddress, |
| | | ShrTel = a.ShrTel, |
| | | |
| | | Remark = a.Remark, |
| | | |
| | | Creater = a.Creater, |
| | | Createtime = a.Createtime, |
| | | |
| | | RecStatus = a.RecStatus, |
| | | Modifier = a.Modifier, |
| | | Modifytime = a.Modifytime, |
| | | |
| | | ShouliStatus = a.ShouliStatus, |
| | | ShouliStatusName = bbb.Comments, |
| | | Shoulier = a.Shoulier, |
| | | Shoulitime = a.Shoulitime, |
| | | ChedanStatus = a.ChedanStatus, |
| | | ChedanStatusName = eee.Comments, |
| | | Chedaner = a.Chedaner, |
| | | Chedantime = a.Chedantime, |
| | | Chedan = a.Chedan, |
| | | HuifangStatus = a.HuifangStatus, |
| | | HuifangStatusName = ccc.Comments, |
| | | Huifanger = a.Huifanger, |
| | | Huifangtime = a.Huifangtime, |
| | | Huifangremark = a.Huifangremark, |
| | | PingjiaStatus = a.PingjiaStatus, |
| | | PingjiaStatusName = ddd.Comments, |
| | | Pingjiaer = a.Pingjiaer, |
| | | Pingjiatime = a.Pingjiatime, |
| | | Youhui = a.Youhui, |
| | | Youhuier = a.Youhuier, |
| | | Youhuitime = a.Youhuitime, |
| | | SonghuoStatusName = jjj.Comments, |
| | | SonghuoStatus = a.SonghuoStatus, |
| | | Songhuoer = a.Songhuoer, |
| | | Songhuotime = a.Songhuotime, |
| | | WangongStatusName = iii.Comments, |
| | | WangongStatus = a.WangongStatus, |
| | | Wangonger = a.Wangonger, |
| | | Wangongtime = a.Wangongtime, |
| | | YouhuiStatus = kkk.Id, |
| | | OrderType1 = a.OrderType1, |
| | | OrderType2 = a.OrderType2, |
| | | OrderType1Name = string.IsNullOrEmpty(lll.BookName) ? string.IsNullOrEmpty(mmm.MemberType) ? a.OrderType1 : mmm.MemberType : lll.BookName, |
| | | |
| | | SonghuoGongsi = a.SonghuoGongsi, |
| | | SonghuoDanhao = a.SonghuoDanhao, |
| | | SonghuoTime1 = a.SonghuoTime1, |
| | | HuifangJdr = a.HuifangJdr, |
| | | HuifangKehuyijian = a.HuifangKehuyijian, |
| | | } |
| | | ).OrderByDescending(x => x.OrderNo).ToList(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return entity; |
| | | } |
| | | |
| | | |
| | | |
| | | public List<TChallengeletterDTO> GetListChallengeletter(string OrderId) |
| | | { |
| | | |
| | | var entity = _context.TChallengeletters.Where(x => x.Status == 1 && x.OrderId == OrderId).ToList(); |
| | | |
| | | |
| | | |
| | | var result = _mapper.Map<List<TChallengeletterDTO>>(entity); |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public ResultEntity saveChallengeletter(TChallengeletterDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | |
| | | |
| | | var entity = _mapper.Map<TChallengeletter>(dto); |
| | | |
| | | |
| | | if (String.IsNullOrEmpty(entity.Id)) |
| | | { |
| | | entity.Id = Guid.NewGuid().ToString(); |
| | | dto.Id = entity.Id; |
| | | |
| | | _context.TChallengeletters.Add(entity); |
| | | } |
| | | else |
| | | { |
| | | var updateproject = _context.TChallengeletters.Find(entity.Id); |
| | | |
| | | |
| | | updateproject.PrintNum = entity.PrintNum; |
| | | updateproject.OrderId = entity.OrderId; |
| | | updateproject.GysId = entity.GysId; |
| | | updateproject.GysName = entity.GysName; |
| | | updateproject.GysAddress = entity.GysAddress; |
| | | updateproject.GysPostcode = entity.GysPostcode; |
| | | updateproject.GysContacts = entity.GysContacts; |
| | | updateproject.GysPhone = entity.GysPhone; |
| | | updateproject.SqdbId = entity.SqdbId; |
| | | updateproject.SqdbName = entity.SqdbName; |
| | | updateproject.SqdbPhone = entity.SqdbPhone; |
| | | updateproject.SqdbAddress = entity.SqdbAddress; |
| | | updateproject.SqdbPostcode = entity.SqdbPostcode; |
| | | updateproject.XmId = entity.XmId; |
| | | updateproject.XmName = entity.XmName; |
| | | updateproject.XmCode = entity.XmCode; |
| | | updateproject.XmPackage = entity.XmPackage; |
| | | updateproject.PurchaserName = entity.PurchaserName; |
| | | updateproject.DocumentsDate = entity.DocumentsDate; |
| | | updateproject.RequestInfo = entity.RequestInfo; |
| | | |
| | | updateproject.IsReply = entity.IsReply; |
| | | |
| | | |
| | | updateproject.Respondent = entity.Respondent; |
| | | updateproject.RespondDate = entity.RespondDate; |
| | | updateproject.RespondInfo = entity.RespondInfo; |
| | | |
| | | |
| | | updateproject.Modifier = entity.Modifier; |
| | | updateproject.Modifytime = entity.Modifytime; |
| | | |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = entity.Id; |
| | | resultEntity.Result = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "保存失败,请联系管理员"; |
| | | |
| | | } |
| | | return resultEntity; |
| | | } |
| | | |
| | | |
| | | public List<TChallengeItemDTO> GetListChallengeItem(string ChallengeId) |
| | | { |
| | | |
| | | var entity = _context.TChallengeItems.Where(x => x.ChallengeId == ChallengeId).ToList(); |
| | | |
| | | |
| | | |
| | | var result = _mapper.Map<List<TChallengeItemDTO>>(entity); |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public ResultEntity saveChallengeItem(TChallengeItemDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | |
| | | |
| | | var entity = _mapper.Map<TChallengeItem>(dto); |
| | | |
| | | |
| | | if (entity.Id<=0) |
| | | { |
| | | |
| | | |
| | | _context.TChallengeItems.Add(entity); |
| | | } |
| | | else |
| | | { |
| | | var updateproject = _context.TChallengeItems.Find(entity.Id); |
| | | |
| | | |
| | | updateproject.ChallengeId = entity.ChallengeId; |
| | | updateproject.Question = entity.Question; |
| | | updateproject.Evidential = entity.Evidential; |
| | | updateproject.Law = entity.Law; |
| | | 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<TComplaintletterDTO> GetListComplaintletter(string OrderId) |
| | | { |
| | | |
| | | var entity = _context.TComplaintletters.Where(x => x.Status == 1 && x.OrderId == OrderId).ToList(); |
| | | |
| | | |
| | | |
| | | var result = _mapper.Map<List<TComplaintletterDTO>>(entity); |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public ResultEntity saveComplaintletter(TComplaintletterDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | |
| | | |
| | | var entity = _mapper.Map<TComplaintletter>(dto); |
| | | |
| | | |
| | | if (String.IsNullOrEmpty(entity.Id)) |
| | | { |
| | | entity.Id = Guid.NewGuid().ToString(); |
| | | dto.Id = entity.Id; |
| | | |
| | | _context.TComplaintletters.Add(entity); |
| | | } |
| | | else |
| | | { |
| | | var updateproject = _context.TComplaintletters.Find(entity.Id); |
| | | |
| | | |
| | | updateproject.PrintNum = entity.PrintNum; |
| | | updateproject.OrderId = entity.OrderId; |
| | | updateproject.TsrId = entity.TsrId; |
| | | |
| | | updateproject.TsrName = entity.TsrName; |
| | | updateproject.TsrAddress = entity.TsrAddress; |
| | | updateproject.TsrPostcode = entity.TsrPostcode; |
| | | updateproject.TsrCorporation = entity.TsrCorporation; |
| | | updateproject.TsrPhone = entity.TsrPhone; |
| | | |
| | | updateproject.SqdbId = entity.SqdbId; |
| | | updateproject.SqdbName = entity.SqdbName; |
| | | updateproject.SqdbPhone = entity.SqdbPhone; |
| | | updateproject.SqdbAddress = entity.SqdbAddress; |
| | | updateproject.SqdbPostcode = entity.SqdbPostcode; |
| | | |
| | | |
| | | |
| | | updateproject.GysId = entity.GysId; |
| | | updateproject.GysName = entity.GysName; |
| | | updateproject.GysAddress = entity.GysAddress; |
| | | updateproject.GysPostcode = entity.GysPostcode; |
| | | updateproject.GysContacts = entity.GysContacts; |
| | | updateproject.GysPhone = entity.GysPhone; |
| | | |
| | | updateproject.XmId = entity.XmId; |
| | | updateproject.XmName = entity.XmName; |
| | | updateproject.XmCode = entity.XmCode; |
| | | updateproject.XmPackage = entity.XmPackage; |
| | | updateproject.PurchaserName = entity.PurchaserName; |
| | | |
| | | updateproject.Agency = entity.Agency; |
| | | updateproject.IsNotice = entity.IsNotice; |
| | | updateproject.NoticeDate = entity.NoticeDate; |
| | | |
| | | updateproject.ChallengeDate = entity.ChallengeDate; |
| | | updateproject.Questioned = entity.Questioned; |
| | | updateproject.Respondent = entity.Respondent; |
| | | updateproject.RespondDate = entity.RespondDate; |
| | | |
| | | updateproject.IsResultnotice = entity.IsResultnotice; |
| | | updateproject.ResultnoticeDate = entity.ResultnoticeDate; |
| | | |
| | | updateproject.DocumentsDate = entity.DocumentsDate; |
| | | updateproject.RequestInfo = entity.RequestInfo; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | updateproject.Modifier = entity.Modifier; |
| | | updateproject.Modifytime = entity.Modifytime; |
| | | |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = entity.Id; |
| | | resultEntity.Result = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "保存失败,请联系管理员"; |
| | | |
| | | } |
| | | return resultEntity; |
| | | } |
| | | |
| | | |
| | | public List<TComplaintItemDTO> GetListComplaintItem(string ComplaintId) |
| | | { |
| | | |
| | | var entity = _context.TComplaintItems.Where(x => x.ComplaintId == ComplaintId).ToList(); |
| | | |
| | | |
| | | |
| | | var result = _mapper.Map<List<TComplaintItemDTO>>(entity); |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public ResultEntity saveComplaintItem(TComplaintItemDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | |
| | | |
| | | var entity = _mapper.Map<TComplaintItem>(dto); |
| | | |
| | | |
| | | if (entity.Id <= 0) |
| | | { |
| | | |
| | | |
| | | _context.TComplaintItems.Add(entity); |
| | | } |
| | | else |
| | | { |
| | | var updateproject = _context.TComplaintItems.Find(entity.Id); |
| | | |
| | | |
| | | updateproject.ComplaintId = entity.ComplaintId; |
| | | updateproject.Question = entity.Question; |
| | | updateproject.Evidential = entity.Evidential; |
| | | updateproject.Law = entity.Law; |
| | | 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<TComplaintRespondentDTO> GetListComplaintRespondent(string ComplaintId) |
| | | { |
| | | |
| | | var entity = _context.TComplaintRespondents.Where(x => x.ComplaintId == ComplaintId).ToList(); |
| | | |
| | | |
| | | |
| | | var result = _mapper.Map<List<TComplaintRespondentDTO>>(entity); |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public ResultEntity saveComplaintRespondent(TComplaintRespondentDTO dto) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | |
| | | |
| | | var entity = _mapper.Map<TComplaintRespondent>(dto); |
| | | |
| | | |
| | | if (entity.Id <= 0) |
| | | { |
| | | |
| | | |
| | | _context.TComplaintRespondents.Add(entity); |
| | | } |
| | | else |
| | | { |
| | | var updateproject = _context.TComplaintRespondents.Find(entity.Id); |
| | | |
| | | |
| | | updateproject.ComplaintId = entity.ComplaintId; |
| | | updateproject.Respondent = entity.Respondent; |
| | | updateproject.Address = entity.Address; |
| | | updateproject.Postcode = entity.Postcode; |
| | | updateproject.Contacts = entity.Contacts; |
| | | updateproject.Phone = entity.Phone; |
| | | updateproject.Sort = entity.Sort; |
| | | |
| | | |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = entity.Id.ToString(); |
| | | resultEntity.Result = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "保存失败,请联系管理员"; |
| | | |
| | | } |
| | | return resultEntity; |
| | | } |
| | | |
| | | } |
| | | } |