| | |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | var list = _context.Experts.Where(e => e.IdCard == expertDTO.IdCard && e.RecStatus == "A" && e.Id != expertDTO.Id).ToList(); |
| | | if (list.Count > 0 ) |
| | | if (!string.IsNullOrEmpty(expertDTO.IdCard)) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该专家信息已经存在"; |
| | | return resultEntity; |
| | | var list = _context.Experts.Where(e => e.IdCard == expertDTO.IdCard && e.RecStatus == "A" && e.Id != expertDTO.Id).ToList(); |
| | | if (list.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该专家身份证信息已经存在"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(expertDTO.Phone1)) |
| | | { |
| | | var list = _context.Experts.Where(e => e.Phone1 == expertDTO.Phone1 && e.RecStatus == "A" && e.Id != expertDTO.Id).ToList(); |
| | | if (list.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该专家联系电话信息已经存在"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(expertDTO.CertiNumber)) |
| | | { |
| | | var list = _context.Experts.Where(e => e.CertiNumber == expertDTO.CertiNumber && e.RecStatus == "A" && e.Id != expertDTO.Id).ToList(); |
| | | if (list.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该专家专家证号信息已经存在"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Expert expert = _mapper.Map<Expert>(expertDTO); |
| | | if (string.IsNullOrEmpty(expert.Id)) |
| | | { |
| | |
| | | updateplExpert.ShenheStatus = expert.ShenheStatus; |
| | | updateplExpert.Modifier = expert.Modifier; |
| | | updateplExpert.Modifytime = expert.Modifytime; |
| | | updateplExpert.YearJiou = expert.YearJiou; |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | |
| | | from ooo in osssss.DefaultIfEmpty() |
| | | |
| | | |
| | | join p in listCode.Where(x => x.CodeTable == "experts" && x.CodeField == "year_jiou") |
| | | on a.YearJiou equals p.CodeSn |
| | | into psss |
| | | from ppp in psss.DefaultIfEmpty() |
| | | |
| | | |
| | | where a.RecStatus == "A" |
| | | && (searchEntity.JoinCount<=0 || hhh.JoinCount >= searchEntity.JoinCount) |
| | | select new ExpertDTO |
| | |
| | | ShenheStatus = a.ShenheStatus, |
| | | |
| | | AreaName = nnn.Name + "-" + ooo.Name, |
| | | |
| | | YearJiou = a.YearJiou, |
| | | YearJiouName = ppp.Comments, |
| | | |
| | | }).ToList(); |
| | | |
| | |
| | | { |
| | | query = query.Where(m => m.Creater == searchEntity.Creater).ToList(); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(searchEntity.YearJiou)) |
| | | { |
| | | query = query.Where(m => m.YearJiou == searchEntity.YearJiou).ToList(); |
| | | } |
| | | |
| | | query = query.OrderByDescending(x => x.Modifytime).ToList(); |
| | | query = query.OrderByDescending(x => x.Modifytime).ToList(); |
| | | //if (searchEntity.totalrows == 0) |
| | | searchEntity.totalrows = query.Count(); |
| | | var expertlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | |
| | | var exDTO = _mapper.Map<ExpertOrderDipatchDTO>(entity); |
| | | return exDTO; |
| | | } |
| | | |
| | | |
| | | public ResultEntity IdCardChongfu(string IdCard = "", string Id = "") |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | try |
| | | { |
| | | if (!string.IsNullOrEmpty(IdCard)) |
| | | { |
| | | var list = _context.Experts.Where(e => e.IdCard == IdCard && e.RecStatus == "A" && e.Id != Id).ToList(); |
| | | if (list.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该专家身份证信息已经存在"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "查询失败,请联系管理员"; |
| | | ex.Message.ToString(); |
| | | } |
| | | return resultEntity; |
| | | } |
| | | |
| | | public ResultEntity CertiNumberChongfu(string CertiNumber = "", string Id = "") |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | try |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty(CertiNumber)) |
| | | { |
| | | var list = _context.Experts.Where(e => e.CertiNumber == CertiNumber && e.RecStatus == "A" && e.Id != Id).ToList(); |
| | | if (list.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该专家专家证号信息已经存在"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "查询失败,请联系管理员"; |
| | | ex.Message.ToString(); |
| | | } |
| | | return resultEntity; |
| | | } |
| | | |
| | | |
| | | public ResultEntity Phone1Chongfu(string Phone1 = "", string Id = "") |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | try |
| | | { |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty(Phone1)) |
| | | { |
| | | var list = _context.Experts.Where(e => e.Phone1 == Phone1 && e.RecStatus == "A" && e.Id != Id).ToList(); |
| | | if (list.Count > 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "该专家联系电话信息已经存在"; |
| | | return resultEntity; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "查询失败,请联系管理员"; |
| | | ex.Message.ToString(); |
| | | } |
| | | return resultEntity; |
| | | } |
| | | } |
| | | } |