public ActionResult Price() { var brands = RecommendManager.GetBrands(); var tireSizes = RecommendManager.SelectALLTireSize(); return(View(Tuple.Create(brands, tireSizes))); }
private ActionResult ChePinIndex(string categoryName) { ViewBag.Title = "车品分期购配置"; var brands = RecommendManager.GetBrandsByCategoryName(categoryName); return(View(Tuple.Create(brands))); }
public ActionResult Index() { var brands = RecommendManager.GetBrands(); //var datas = ThirdShopManager.BuildProductMin_maoliValue(); return(View(brands)); }
public HomeModel GetHomeInfo() { HomeModel homeModel = new HomeModel(); //首页Banner BannerManager bannerManager = new BannerManager(); homeModel.Banners = bannerManager.GetHomeBanners(); //热卖商品列表 RecommendManager recommandManager = new RecommendManager(); homeModel.HotSaleProducts = recommandManager.GetHomeHotSaleItemList(); //新品上市商品列表: homeModel.RecommendProducts = recommandManager.GetHomeRecommendProductList(); //今日特卖商品列表: homeModel.TodayHotSaleProducts = recommandManager.GetTodayHotSaleItemlist(); //首页楼层列表 FloorManager floorManager = new FloorManager(); homeModel.Floors = floorManager.GetHomeFloors(); //精选品牌 homeModel.Brands = recommandManager.GetRecommendBrands(); //限时抢购 QueryResult <CountDownItemModel> countDownList = new CountdownManager().GetCountDownList(0, 3); homeModel.CountDownList = countDownList.ResultList; return(homeModel); }
private ActionResult HubIndex(string categoryName) { ViewBag.Title = "轮毂分期购配置"; var brands = RecommendManager.GetBrandsByCategoryName(categoryName); var hubSizes = RecommendManager.SelectALLHubSize(); return(View(Tuple.Create(brands, hubSizes))); }
public JsonResult GetHomeDiscountItemList() { RecommendManager manager = new RecommendManager(); List <RecommendItemModel> list = manager.GetHomeDiscountItemList(); var result = new AjaxResult { Success = true, Data = list }; return(Json(result)); }
private ActionResult TireIndex(string categoryName) { ViewBag.Title = "轮胎分期购配置"; var brands = RecommendManager.GetBrandsByCategoryName(categoryName); IEnumerable <TireSizeModel> tireSizes = null; if (categoryName == "Tires") { tireSizes = RecommendManager.SelectALLTireSize(); } else if (categoryName == "hub") { tireSizes = RecommendManager.SelectALLHubSize(); } else { tireSizes = new List <TireSizeModel>(); } return(View("Index", Tuple.Create(brands, tireSizes))); }
public ActionResult GetAllVehicleDepartment() { var result = RecommendManager.GetVehicleDepartment(); return(Json(new { Status = result != null, Data = result }, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage ExportQZTJIndexExcel() { JObject o = JObject.Parse(ContextRequest["searchCondition"]); var selectModel = o.ToObject <QZTJSelectModel>(); //创建Excel文件的对象 NPOI.HSSF.UserModel.HSSFWorkbook book = new HSSFWorkbook(); //添加一个sheet NPOI.SS.UserModel.ISheet sheet1 = book.CreateSheet("Sheet1"); //获取list数据 //给sheet1添加第一行的头部标题 NPOI.SS.UserModel.IRow row = sheet1.CreateRow(0); var user = HttpContext.Current.User.Identity.Name; var fileName = $"轮胎强制推荐配置{user}.xls"; row.CreateCell(0).SetCellValue("原轮胎"); row.CreateCell(1).SetCellValue("推荐轮胎1"); row.CreateCell(2).SetCellValue("推荐原因1"); row.CreateCell(3).SetCellValue("轮胎图片1"); row.CreateCell(4).SetCellValue("推荐轮胎2"); row.CreateCell(5).SetCellValue("推荐原因2"); row.CreateCell(6).SetCellValue("轮胎图片2"); row.CreateCell(7).SetCellValue("推荐轮胎3"); row.CreateCell(8).SetCellValue("推荐原因3"); row.CreateCell(9).SetCellValue("轮胎图片3"); row.CreateCell(10).SetCellValue("浮层推荐PID"); row.CreateCell(11).SetCellValue("浮层推荐语"); var pageSize = int.Parse(System.Configuration.ConfigurationManager.AppSettings["ExportSize"]); PagerModel pager = new PagerModel(1, pageSize); var list = RecommendManager.SelectQZTJTires(selectModel, pager); var i = 0; while (list.Any()) { foreach (var item in list) { var temp1 = item.Products.FirstOrDefault(C => C.Postion == 1); var temp2 = item.Products.FirstOrDefault(C => C.Postion == 2); var temp3 = item.Products.FirstOrDefault(C => C.Postion == 3); var temp4 = item.Products.FirstOrDefault(C => C.Postion == 4); NPOI.SS.UserModel.IRow rowtemp = sheet1.CreateRow(++i); rowtemp.CreateCell(0).SetCellValue(item.PID); rowtemp.CreateCell(1).SetCellValue(string.IsNullOrWhiteSpace(temp1?.PID) ? "无": temp1?.RecommendPID); rowtemp.CreateCell(2).SetCellValue(string.IsNullOrWhiteSpace(temp1?.Reason) ? "无" : temp1?.Reason); rowtemp.CreateCell(3).SetCellValue(string.IsNullOrWhiteSpace(temp1?.Image) ? "无" : "https://img1.tuhu.org" + temp1?.Image); rowtemp.CreateCell(4).SetCellValue(string.IsNullOrWhiteSpace(temp2?.PID) ? "无" : temp2?.RecommendPID); rowtemp.CreateCell(5).SetCellValue(string.IsNullOrWhiteSpace(temp2?.Reason) ? "无" : temp2?.Reason); rowtemp.CreateCell(6).SetCellValue(string.IsNullOrWhiteSpace(temp2?.Image) ? "无" : "https://img1.tuhu.org" + temp2?.Image); rowtemp.CreateCell(7).SetCellValue(string.IsNullOrWhiteSpace(temp3?.PID) ? "无" : temp3?.RecommendPID); rowtemp.CreateCell(8).SetCellValue(string.IsNullOrWhiteSpace(temp3?.Reason) ? "无" : temp3?.Reason); rowtemp.CreateCell(9).SetCellValue(string.IsNullOrWhiteSpace(temp3?.Image) ? "无" : "https://img1.tuhu.org" + temp3?.Image); rowtemp.CreateCell(10).SetCellValue(string.IsNullOrWhiteSpace(temp4?.PID) ? "无" : temp4?.RecommendPID); rowtemp.CreateCell(11).SetCellValue(string.IsNullOrWhiteSpace(temp4?.Reason) ? "无" : temp4?.Reason); } pager.CurrentPage += 1; list = RecommendManager.SelectQZTJTires(selectModel, pager); } // 写入到客户端 System.IO.MemoryStream ms = new System.IO.MemoryStream(); book.Write(ms); ms.Seek(0, SeekOrigin.Begin); var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StreamContent(ms) }; response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/ms-excel"); response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = HttpUtility.UrlEncode(fileName) }; return(response); }
public HttpResponseMessage ExportRecommendByVehicleExcel() { JObject o = JObject.Parse(ContextRequest["searchCondition"]); var selectModel = o.ToObject <VehicleRequestModel>(); //创建Excel文件的对象 NPOI.HSSF.UserModel.HSSFWorkbook book = new HSSFWorkbook(); //添加一个sheet NPOI.SS.UserModel.ISheet sheet1 = book.CreateSheet("Sheet1"); //获取list数据 //给sheet1添加第一行的头部标题 NPOI.SS.UserModel.IRow row = sheet1.CreateRow(0); var user = HttpContext.Current.User.Identity.Name; var fileName = $"轮胎人工推荐配置{user}.xls"; row.CreateCell(0).SetCellValue("品牌序列"); row.CreateCell(1).SetCellValue("品牌"); row.CreateCell(2).SetCellValue("车系"); row.CreateCell(3).SetCellValue("规格"); row.CreateCell(4).SetCellValue("车价"); row.CreateCell(5).SetCellValue("1 人工推荐"); row.CreateCell(6).SetCellValue("推荐理由"); row.CreateCell(7).SetCellValue("2 人工推荐"); row.CreateCell(8).SetCellValue("推荐理由"); row.CreateCell(9).SetCellValue("3 人工推荐"); row.CreateCell(10).SetCellValue("推荐理由"); var list = RecommendManager.SelectListNew(selectModel.Departments, selectModel.VehicleIDS, selectModel.PriceRanges, selectModel.VehicleBodyTypes, selectModel.Specifications, selectModel.Brands, selectModel.IsShow, selectModel.IsRof, selectModel.PID, selectModel.Province, selectModel.City, selectModel.StartPrice, selectModel.EndPrice); var i = 0; foreach (var item in list) { NPOI.SS.UserModel.IRow rowtemp = sheet1.CreateRow(++i); rowtemp.CreateCell(0).SetCellValue(item.BrandCategory ?? "其它"); rowtemp.CreateCell(1).SetCellValue(item.Brand); rowtemp.CreateCell(2).SetCellValue(item.Vehicle); rowtemp.CreateCell(3).SetCellValue(item.TireSize); rowtemp.CreateCell(4).SetCellValue(item.MinPrice); rowtemp.CreateCell(5).SetCellValue(item.RecommendTires?.FirstOrDefault(C => C.Postion == 1)?.PID ?? "无"); rowtemp.CreateCell(6).SetCellValue(item.RecommendTires?.FirstOrDefault(C => C.Postion == 1)?.Reason ?? "无"); rowtemp.CreateCell(7).SetCellValue(item.RecommendTires?.FirstOrDefault(C => C.Postion == 2)?.PID ?? "无"); rowtemp.CreateCell(8).SetCellValue(item.RecommendTires?.FirstOrDefault(C => C.Postion == 2)?.Reason ?? "无"); rowtemp.CreateCell(9).SetCellValue(item.RecommendTires?.FirstOrDefault(C => C.Postion == 3)?.PID ?? "无"); rowtemp.CreateCell(10).SetCellValue(item.RecommendTires?.FirstOrDefault(C => C.Postion == 3)?.Reason ?? "无"); } // 写入到客户端 System.IO.MemoryStream ms = new System.IO.MemoryStream(); book.Write(ms); ms.Seek(0, SeekOrigin.Begin); var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StreamContent(ms) }; response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/ms-excel"); response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = HttpUtility.UrlEncode(fileName) }; return(response); }