/// <summary> /// 商品咨询列表 /// </summary> public ActionResult ProductConsultList() { int pid = WebHelper.GetQueryInt("pid"); int consultTypeId = WebHelper.GetQueryInt("consultTypeId"); string consultMessage = WebHelper.GetQueryString("consultMessage"); int page = WebHelper.GetQueryInt("page"); //判断商品是否存在 PartProductInfo productInfo = Products.GetPartProductById(pid); if (productInfo == null) { return(PromptView(Url.Action("index", "home"), "你访问的商品不存在")); } if (!SecureHelper.IsSafeSqlString(consultMessage)) { return(PromptView(WorkContext.UrlReferrer, "您搜索的内容不存在")); } PageModel pageModel = new PageModel(10, page, ProductConsults.GetProductConsultCount(pid, consultTypeId, consultMessage)); ProductConsultListModel model = new ProductConsultListModel() { ProductInfo = productInfo, ConsultTypeId = consultTypeId, ConsultMessage = consultMessage, PageModel = pageModel, ProductConsultList = ProductConsults.GetProductConsultList(pageModel.PageSize, pageModel.PageNumber, pid, consultTypeId, consultMessage), ProductConsultTypeList = ProductConsults.GetProductConsultTypeList(), IsVerifyCode = CommonHelper.IsInArray(WorkContext.PageKey, WorkContext.ShopConfig.VerifyPages) }; return(View(model)); }
/// <summary> /// 商品咨询列表 /// </summary> public ActionResult AjaxProductConsultList() { int pid = WebHelper.GetQueryInt("pid"); int consultTypeId = WebHelper.GetQueryInt("consultTypeId"); string consultMessage = WebHelper.GetQueryString("consultMessage"); int page = WebHelper.GetQueryInt("page"); if (!SecureHelper.IsSafeSqlString(consultMessage)) { return(View(new AjaxProductConsultListModel())); } PageModel pageModel = new PageModel(10, page, ProductConsults.GetProductConsultCount(pid, consultTypeId, consultMessage)); AjaxProductConsultListModel model = new AjaxProductConsultListModel() { Pid = pid, ConsultTypeId = consultTypeId, ConsultMessage = consultMessage, PageModel = pageModel, ProductConsultList = ProductConsults.GetProductConsultList(pageModel.PageSize, pageModel.PageNumber, pid, consultTypeId, consultMessage), ProductConsultTypeList = ProductConsults.GetProductConsultTypeList(), IsVerifyCode = CommonHelper.IsInArray(WorkContext.PageKey, WorkContext.MallConfig.VerifyPages) }; return(View(model)); }
/// <summary> /// 商品咨询列表 /// </summary> public ActionResult ProductConsultList() { int pid = WebHelper.GetQueryInt("pid"); int consultTypeId = WebHelper.GetQueryInt("consultTypeId"); string consultMessage = WebHelper.GetQueryString("consultMessage"); int page = WebHelper.GetQueryInt("page"); //判断商品是否存在 PartProductInfo productInfo = Products.GetPartProductById(pid); if (productInfo == null) { return(PromptView("/", "你访问的商品不存在")); } PageModel pageModel = new PageModel(10, page, ProductConsults.GetProductConsultCount(pid, consultTypeId, consultMessage)); ProductConsultListModel model = new ProductConsultListModel() { ProductInfo = productInfo, CategoryInfo = Categories.GetCategoryById(productInfo.CateId), BrandInfo = Brands.GetBrandById(productInfo.BrandId), ConsultTypeId = consultTypeId, ConsultMessage = consultMessage, PageModel = pageModel, ProductConsultList = ProductConsults.GetProductConsultList(pageModel.PageSize, pageModel.PageNumber, pid, consultTypeId, consultMessage), ProductConsultTypeList = ProductConsults.GetProductConsultTypeList(), IsVerifyCode = CommonHelper.IsInArray(WorkContext.PageKey, WorkContext.ShopConfig.VerifyPages) }; return(View(model)); }
/// <summary> /// 商品咨询列表 /// </summary> public ActionResult ProductConsultList() { int pid = WebHelper.GetQueryInt("pid"); int consultTypeId = WebHelper.GetQueryInt("consultTypeId"); string consultMessage = WebHelper.GetQueryString("consultMessage"); int page = WebHelper.GetQueryInt("page"); //判断商品是否存在 PartProductInfo productInfo = Products.GetPartProductById(pid); if (productInfo == null) { return(PromptView("/", "你访问的商品不存在")); } if (!SecureHelper.IsSafeSqlString(consultMessage)) { return(PromptView(WorkContext.UrlReferrer, "您搜索的内容不存在")); } //店铺信息 StoreInfo storeInfo = Stores.GetStoreById(productInfo.StoreId); if (storeInfo.State != (int)StoreState.Open) { return(PromptView("/", "你访问的商品不存在")); } PageModel pageModel = new PageModel(10, page, ProductConsults.GetProductConsultCount(pid, consultTypeId, consultMessage)); ProductConsultListModel model = new ProductConsultListModel() { ProductInfo = productInfo, CategoryInfo = Categories.GetCategoryById(productInfo.CateId), BrandInfo = Brands.GetBrandById(productInfo.BrandId), StoreInfo = storeInfo, StoreKeeperInfo = Stores.GetStoreKeeperById(storeInfo.StoreId), StoreRegion = Regions.GetRegionById(storeInfo.RegionId), StoreRankInfo = StoreRanks.GetStoreRankById(storeInfo.StoreRid), ConsultTypeId = consultTypeId, ConsultMessage = consultMessage, PageModel = pageModel, ProductConsultList = ProductConsults.GetProductConsultList(pageModel.PageSize, pageModel.PageNumber, pid, consultTypeId, consultMessage), ProductConsultTypeList = ProductConsults.GetProductConsultTypeList(), IsVerifyCode = CommonHelper.IsInArray(WorkContext.PageKey, WorkContext.MallConfig.VerifyPages) }; return(View(model)); }
/// <summary> /// 商品咨询列表 /// </summary> public ActionResult ProductConsultList() { int pid = WebHelper.GetQueryInt("pid"); int consultTypeId = WebHelper.GetQueryInt("consultTypeId"); string consultMessage = WebHelper.GetQueryString("consultMessage"); int page = WebHelper.GetQueryInt("page"); //判断商品是否存在 PartProductInfo productInfo = Products.GetPartProductById(pid); if (productInfo == null) { return(PromptView(Url.Action("index", "home"), "你访问的商品不存在")); } //店铺信息 StoreInfo storeInfo = Stores.GetStoreById(productInfo.StoreId); if (storeInfo.State != (int)StoreState.Open) { return(PromptView(Url.Action("index", "home"), "你访问的商品不存在")); } PageModel pageModel = new PageModel(10, page, ProductConsults.GetProductConsultCount(pid, consultTypeId, consultMessage)); ProductConsultListModel model = new ProductConsultListModel() { ProductInfo = productInfo, StoreInfo = storeInfo, ConsultTypeId = consultTypeId, ConsultMessage = consultMessage, PageModel = pageModel, ProductConsultList = ProductConsults.GetProductConsultList(pageModel.PageSize, pageModel.PageNumber, pid, consultTypeId, consultMessage), ProductConsultTypeList = ProductConsults.GetProductConsultTypeList(), IsVerifyCode = CommonHelper.IsInArray(WorkContext.PageKey, WorkContext.MallConfig.VerifyPages) }; return(View(model)); }