/// <summary> /// 得到所有省 /// </summary> /// <returns></returns> public ActionResult GetProvinceRegionList() { List <RegionResultDTO> result = new List <RegionResultDTO>(); result = AreaRegionProvider.GetProvinceRegionList(); return(Json(result, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 得到搜索框所有省(带请选择) /// </summary> /// <returns></returns> public ActionResult GetSearchProvinceRegionList() { List <RegionResultDTO> result = new List <RegionResultDTO>(); result = AreaRegionProvider.GetProvinceRegionList(); result.Insert(0, new RegionResultDTO { RegionID = -1, RegionName = "请选择" }); return(Json(result, JsonRequestBehavior.AllowGet)); }
private bool CheckCustomer(object obj) { bool result = true; CustomerSearchDTO dto = new CustomerSearchDTO(); dto.rows = 100000000; string strimporter = ((UserLoginDTO)Session["UserLoginInfo"]).FullName; dto.page = 1; var CustomerList = CustomerProvider.GetCustomerList(dto); var ProvinceRegionList = AreaRegionProvider.GetProvinceRegionList(); List <ExcelCustomerInfoDTO> exceldto = (List <ExcelCustomerInfoDTO>)obj; foreach (var p in exceldto) { StringBuilder sb = new StringBuilder(); if (String.IsNullOrEmpty(p.CustomerName)) { sb.Append("客户名称不能为空"); } else { var CustomerID = CustomerList.Object.Where(m => m.CustomerName == p.CustomerName).Select(m => m.CustomerID).FirstOrDefault(); if (CustomerID != null) { p.CustomerID = CustomerID; p.UpLogic = 2; } else { p.UpLogic = 1; } } if (string.IsNullOrEmpty(p.XSWNO)) { sb.Append("携手网编号不可为空!"); } if (string.IsNullOrEmpty(p.Province)) { sb.Append("省份不能为空!"); } else { var exist = ProvinceRegionList.Where(m => m.RegionName == p.Province).FirstOrDefault(); if (exist != null) { p.Province = exist.RegionName; } else { sb.Append("注册省份不存在!"); } } if (string.IsNullOrEmpty(p.City)) { sb.Append("城市不能为空!"); } else { var nextArea = GlobalStaticData.RegionList.Where(m => m.RegionName == p.City).FirstOrDefault(); if (nextArea == null) { sb.Append("注册城市" + p.City + "不存在!"); } else { } } p.Importer = strimporter; if (sb.Length > 0) { p.CheckInfo = sb.ToString(); result = false; } } return(result); }