/// <summary> /// 店铺等级列表 /// </summary> /// <returns></returns> public ActionResult List() { StoreRankListModel model = new StoreRankListModel() { StoreRankList = AdminStoreRanks.GetStoreRankList() }; MallUtils.SetAdminRefererCookie(Url.Action("list")); return(View(model)); }
/// <summary> /// 店铺列表 /// </summary> public ActionResult StoreList(string storeName, int storeRid = 0, int storeIid = 0, int state = -1, int pageNumber = 1, int pageSize = 15) { string condition = AdminStores.AdminGetStoreListCondition(storeName, storeRid, storeIid, state); PageModel pageModel = new PageModel(pageSize, pageNumber, AdminStores.AdminGetStoreCount(condition)); List <SelectListItem> storeRankList = new List <SelectListItem>(); storeRankList.Add(new SelectListItem() { Text = "全部等级", Value = "0" }); foreach (StoreRankInfo storeRankInfo in AdminStoreRanks.GetStoreRankList()) { storeRankList.Add(new SelectListItem() { Text = storeRankInfo.Title, Value = storeRankInfo.StoreRid.ToString() }); } List <SelectListItem> storeIndustryList = new List <SelectListItem>(); storeIndustryList.Add(new SelectListItem() { Text = "全部行业", Value = "0" }); foreach (StoreIndustryInfo storeIndustryInfo in AdminStoreIndustries.GetStoreIndustryList()) { storeIndustryList.Add(new SelectListItem() { Text = storeIndustryInfo.Title, Value = storeIndustryInfo.StoreIid.ToString() }); } List <SelectListItem> storeStateList = new List <SelectListItem>(); storeStateList.Add(new SelectListItem() { Text = "全部", Value = "-1" }); storeStateList.Add(new SelectListItem() { Text = "营业", Value = ((int)StoreState.Open).ToString() }); storeStateList.Add(new SelectListItem() { Text = "关闭", Value = ((int)StoreState.Close).ToString() }); StoreListModel model = new StoreListModel() { PageModel = pageModel, StoreList = AdminStores.AdminGetStoreList(pageModel.PageSize, pageModel.PageNumber, condition), StoreName = storeName, StoreRid = storeRid, StoreRankList = storeRankList, StoreIid = storeIid, StoreIndustryList = storeIndustryList, State = state, StoreStateList = storeStateList }; MallUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&storeName={3}&storeRid={4}&storeIid={5}&state={6}", Url.Action("storelist"), pageModel.PageNumber, pageModel.PageSize, storeName, storeRid, storeIid, state)); return(View(model)); }
private void LoadStore(int storeId, int regionId) { ViewData["storeId"] = storeId; List <SelectListItem> storeRankList = new List <SelectListItem>(); storeRankList.Add(new SelectListItem() { Text = "选择店铺等级", Value = "-1" }); foreach (StoreRankInfo storeRankInfo in AdminStoreRanks.GetStoreRankList()) { storeRankList.Add(new SelectListItem() { Text = storeRankInfo.Title, Value = storeRankInfo.StoreRid.ToString() }); } ViewData["storeRankList"] = storeRankList; List <SelectListItem> storeIndustryList = new List <SelectListItem>(); storeIndustryList.Add(new SelectListItem() { Text = "选择店铺行业", Value = "-1" }); foreach (StoreIndustryInfo storeIndustryInfo in AdminStoreIndustries.GetStoreIndustryList()) { storeIndustryList.Add(new SelectListItem() { Text = storeIndustryInfo.Title, Value = storeIndustryInfo.StoreIid.ToString() }); } ViewData["storeIndustryList"] = storeIndustryList; List <SelectListItem> themeList = new List <SelectListItem>(); DirectoryInfo dir = new DirectoryInfo(IOHelper.GetMapPath("/themes")); foreach (DirectoryInfo themeDir in dir.GetDirectories()) { themeList.Add(new SelectListItem() { Text = themeDir.Name, Value = themeDir.Name }); } ViewData["themeList"] = themeList; RegionInfo regionInfo = Regions.GetRegionById(regionId); if (regionInfo != null) { ViewData["provinceId"] = regionInfo.ProvinceId; ViewData["cityId"] = regionInfo.CityId; ViewData["countyId"] = regionInfo.RegionId; } else { ViewData["provinceId"] = -1; ViewData["cityId"] = -1; ViewData["countyId"] = -1; } string allowImgType = string.Empty; string[] imgTypeList = StringHelper.SplitString(BMAConfig.MallConfig.UploadImgType, ","); foreach (string imgType in imgTypeList) { allowImgType += string.Format("{0},", imgType.ToLower()); } allowImgType = allowImgType.Replace(".", ""); allowImgType = allowImgType.TrimEnd(','); string[] sizeList = StringHelper.SplitString(WorkContext.MallConfig.StoreLogoThumbSize); ViewData["size"] = sizeList[sizeList.Length / 2]; ViewData["allowImgType"] = allowImgType; ViewData["maxImgSize"] = BMAConfig.MallConfig.UploadImgSize; ViewData["referer"] = MallUtils.GetMallAdminRefererCookie(); }
private void LoadStore(int storeId, int regionId) { ViewData["storeId"] = storeId; List <SelectListItem> storeRankList = new List <SelectListItem>(); storeRankList.Add(new SelectListItem() { Text = "选择店铺等级", Value = "-1" }); foreach (StoreRankInfo storeRankInfo in AdminStoreRanks.GetStoreRankList()) { storeRankList.Add(new SelectListItem() { Text = storeRankInfo.Title, Value = storeRankInfo.StoreRid.ToString() }); } ViewData["storeRankList"] = storeRankList; List <SelectListItem> storeIndustryList = new List <SelectListItem>(); storeIndustryList.Add(new SelectListItem() { Text = "选择店铺行业", Value = "-1" }); foreach (StoreIndustryInfo storeIndustryInfo in AdminStoreIndustries.GetStoreIndustryList()) { storeIndustryList.Add(new SelectListItem() { Text = storeIndustryInfo.Title, Value = storeIndustryInfo.StoreIid.ToString() }); } ViewData["storeIndustryList"] = storeIndustryList; List <SelectListItem> themeList = new List <SelectListItem>(); DirectoryInfo dir = new DirectoryInfo(IOHelper.GetMapPath("/themes")); foreach (DirectoryInfo themeDir in dir.GetDirectories()) { themeList.Add(new SelectListItem() { Text = themeDir.Name, Value = themeDir.Name }); } ViewData["themeList"] = themeList; RegionInfo regionInfo = Regions.GetRegionById(regionId); if (regionInfo != null) { ViewData["provinceId"] = regionInfo.ProvinceId; ViewData["cityId"] = regionInfo.CityId; ViewData["countyId"] = regionInfo.RegionId; } else { ViewData["provinceId"] = -1; ViewData["cityId"] = -1; ViewData["countyId"] = -1; } ViewData["allowImgType"] = BMAConfig.UploadConfig.UploadImgType.Replace(".", ""); ViewData["maxImgSize"] = BMAConfig.UploadConfig.UploadImgSize; ViewData["referer"] = MallUtils.GetMallAdminRefererCookie(); }