public ActionResult ChangeProductImage(string productId, string color, string sizeCategory) { //decode size category sizeCategory = sizeCategory.Replace("_amp_", "'"); var imgsModel = DetailManager.GetProductImageModelByColor(productId, color); var videoModel = DetailManager.GetProductVideoModel(productId); var sizesModel = DetailManager.GetSizesByColorAndSizeCategory(productId, color, sizeCategory); var detailModel = new DetailModel { ProductImages = imgsModel, ProductVideos = videoModel }; return(RenderMultipleViews(new List <RenderViewInfo>() { new RenderViewInfo() { ViewName = "zoomedView", ViewPath = "~/Views/Partials/Detail/_ZoomedImagePartial.cshtml", Model = imgsModel }, new RenderViewInfo() { ViewName = "imagesView", ViewPath = "~/Views/Partials/Detail/_ImagesPartial.cshtml", Model = detailModel }, new RenderViewInfo() { ViewName = "sizesView", ViewPath = "~/Views/Partials/Detail/_SizesPartial.cshtml", Model = sizesModel }, new RenderViewInfo() { ViewName = "shareView", ViewPath = "~/Views/Partials/Detail/_SocialSharePartial.cshtml", Model = imgsModel } })); }
//员工缴费状态 public ActionResult JiaoFeiDelete(int id) { //根据id,找到这个对象 DetailManager aa = new DetailManager(); var info = aa.GetByPK(id); if (info.detail_Condition == "可见") { info.detail_Condition = "不可见"; var qq = aa.Update(info); if (qq) { return(Redirect("~/ZhengLiang/FinanceHT/JiaoFeiJiLu")); } else { return(Content("<script>alert('异常');window.location = '/ZhengLiang/FinanceHT/JiaoFeiJiLu';</script>")); } } else { info.detail_Condition = "可见"; var qq = aa.Update(info); if (qq) { return(Redirect("~/ZhengLiang/FinanceHT/JiaoFeiJiLu")); } else { return(Content("<script>alert('异常');window.location = '/ZhengLiang/FinanceHT/JiaoFeiJiLu';</script>")); } } }
public ActionResult JiaoFeiJiLu(int current = 1) { if (current > 1) { ViewBag.currents = current - 1; } else { ViewBag.currents = 1; } int count = 5; DetailManager a = new DetailManager(); List <detail> detail = a.GetAll(); var list = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList(); int zongshu = detail.Count(); int zongye = zongshu / count; zongye = zongshu % count == 0 ? zongye : zongye + 1; if (current < zongye) { ViewBag.currentc = current + 1; } else { ViewBag.currentc = zongye; } ViewBag.zongye = zongye; ViewBag.current = current; return(View(list)); }
public ActionResult Index(String product) { SetSeoInformation(product); ViewBag.Scripts = new List <string>() { "review.js" }; ViewBag.HasNoFollow = true; ReviewItemModel reviewItemModel = new ReviewItemModel(); try { reviewItemModel.BreadCrumbAndProductId = product; ProductDetailModel productDetail = DetailManager.GetProductDetailModel(product); reviewItemModel.ProductCode = productDetail.Code; reviewItemModel.ProductDescription = productDetail.Description; reviewItemModel.ProductName = productDetail.Name; reviewItemModel.ProductImage = productDetail.Image; reviewItemModel.Rating = "5"; reviewItemModel.Average = DetailManager.GetProductReviewAverage(product); } catch { return(RedirectToAction("Index", "Home")); } return(View(PathFromView("Review"), reviewItemModel)); }
void OnEnable() { Details = new DetailManager(this); Settings = TerraSettings.Instance; if (Settings == null) { Debug.LogError("Cannot find a TerraSettings object in the scene"); } }
public ActionResult ReviewsPagination(string productId, int pageNumber) { var model = new DetailModel(); ReviewFilter reviewFilter = new ReviewFilter(); reviewFilter.Code = productId; reviewFilter.PageNumber = pageNumber; reviewFilter.Size = PAGE_REVIEW_SIZE; model.ProductReviews = DetailManager.GetProductReviewModel(reviewFilter); return(PartialView("~/Views/Partials/Detail/_ReviewsPaginationPartial.cshtml", model)); }
public ActionResult YuanGongJiaoFei(detail info) { ////添加缴费记录 DetailManager a = new DetailManager(); var qq = a.Add(info); if (qq) { //查询出总经费 MoneyManager aa = new MoneyManager(); money mys = aa.GetByPK(1); if (mys.overmoney == null) { mys.overmoney = 0; } //修改总经费 money my = new money(); if (my.overmoney == null) { my.overmoney = 0; } my.sunId = 1; my.overmoney = (mys.overmoney + info.sum); my.openmoney = mys.openmoney + 0; MoneyManager aq = new MoneyManager(); var boo = aq.Update(my); if (boo) { return(Redirect("~/ZhengLiang/FinanceHT/YuanGongJiaoFei")); } else { return(Redirect("~/ZhengLiang/FinanceHT/YuanGongJiaoFei")); } } else { return(Content("<script>alert('添加失败');window.location = '/ZhengLiang/FinanceHT/YuanGongJiaoFei';</script>")); } }
private DetailModel GetDetailModelFromProduct(String productId, BreadcrumbModel bc, bool buildNavigation = true) { DetailModel model; if (!String.IsNullOrEmpty(productId)) { model = DetailManager.GetModel(this.CurrentBrand, productId); model.Breadcrumb = bc; //search for default category size containing default color model.ProductDetail.DefaultCategorySize = model.ColorsAndSizes.ProductCategorySizes.Count > 0 ? model.ColorsAndSizes.ProductCategorySizes[0] : null; foreach (var aSizeCategory in model.ColorsAndSizes.AvailableColorsPerSizeCategory) { var match = aSizeCategory.Value.Find(c => c.ColorCode == model.ProductDetail.DefaultColorCode); if (match != null) { model.ProductDetail.DefaultCategorySize = aSizeCategory.Key; break; } } ReviewFilter reviewFilter = new ReviewFilter(); reviewFilter.Code = productId; reviewFilter.PageNumber = 1; reviewFilter.Size = PAGE_REVIEW_SIZE; model.ProductReviews = DetailManager.GetProductReviewModel(reviewFilter); if (buildNavigation) { BuildProductsNavigation(productId, bc, model); } } else { model = new DetailModel(); } return(model); }
public static List <FavoriteProduct> GetFavoriteProducts(List <FavoriteProduct> codesAndColors) { using (var client = new LandauPortalWebAPI()) { var result = new List <FavoriteProduct>(); var favProducts = client.Products.GetAllByProductCodes(codesAndColors.Select(f => f.ProductCode).Distinct().ToArray()).Results; foreach (var aProd in codesAndColors) { var inputFav = favProducts.Where(c => c.ProductCode == aProd.ProductCode).FirstOrDefault(); if (inputFav != null) { var fav = new FavoriteProduct(); fav.ProductCode = aProd.ProductCode; fav.ProductName = inputFav.ProductName; fav.ColorCode = aProd.ColorCode; fav.ColorHex = aProd.ColorHex; fav.ColorName = aProd.ColorName; fav.ColorUrl = aProd.ColorUrl; fav.SizeCategory = aProd.SizeCategory; fav.SizeCode = aProd.SizeCode; var image = DetailManager.GetProductImageModelByColor(aProd.ProductCode, aProd.ColorCode); fav.ProductDetailImageUri = image != null && image.Count > 0 ? image.First().DetailImageUri : string.Empty; if (string.IsNullOrEmpty(fav.ProductDetailImageUri)) { fav.ProductDetailImageUri = inputFav.Image != null ? inputFav.Image.DetailImageUri : string.Empty; } result.Add(fav); } } return(result); } }
public ActionResult Canonical(String product) { try { var bc = new BreadcrumbModel(); var model = GetDetailModelFromProduct(product, bc, false); if (!ProductUrlIsCorrect(model.ProductDetail)) { throw Utility.Exception404(); } this.BuildBreadcrumb(bc, model.ProductDetail.DefaultCategory, model.ProductDetail.DefaultCollection, Constants.GenderFor(model.ProductDetail.DefaultGender), model.ProductDetail.DefaultGender.ToLower()); //navigation should not be available since it's not entering from a catalog search model.IsCanonicalUrl = true; if (!String.IsNullOrEmpty(Request.QueryString["color"])) { //color selected in previous page model.SelectedColor = model.ColorsAndSizes.GetProductColorModel(Request.QueryString["color"]); if (model.SelectedColor != null) { model.ProductImages = DetailManager.GetProductImageModelByColor(product, model.SelectedColor.ColorCode); } } return(BuildDetailView(model)); } catch { throw Utility.Exception404(); } }
public ActionResult JiaoFeiJiLu(detail info) { if (info.detail_Condition.Equals("全部")) { int current = 1; if (current > 1) { ViewBag.currents = current - 1; } else { ViewBag.currents = 1; } int count = 5; DetailManager a = new DetailManager(); if (info.MonryResult == null) { List <detail> detail = a.GetAll(); var list = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList(); int zongshu = detail.Count(); int zongye = zongshu / count; zongye = zongshu % count == 0 ? zongye : zongye + 1; if (current < zongye) { ViewBag.currentc = current + 1; } else { ViewBag.currentc = zongye; } ViewBag.zongye = zongye; ViewBag.current = current; return(View(list)); } else { List <detail> detail = a.Where(x => x.MonryResult.Contains(info.MonryResult)).ToList(); var list = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList(); int zongshu = detail.Count(); int zongye = zongshu / count; zongye = zongshu % count == 0 ? zongye : zongye + 1; if (current < zongye) { ViewBag.currentc = current + 1; } else { ViewBag.currentc = zongye; } ViewBag.zongye = zongye; ViewBag.current = current; return(View(list)); } } else { int current = 1; if (current > 1) { ViewBag.currents = current - 1; } else { ViewBag.currents = 1; } int count = 5; DetailManager a = new DetailManager(); if (info.MonryResult == null) { List <detail> detail = a.Where(x => x.detail_Condition == info.detail_Condition).ToList(); var list = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList(); int zongshu = detail.Count(); int zongye = zongshu / count; zongye = zongshu % count == 0 ? zongye : zongye + 1; if (current < zongye) { ViewBag.currentc = current + 1; } else { ViewBag.currentc = zongye; } ViewBag.zongye = zongye; ViewBag.current = current; return(View(list)); } else { List <detail> detail = a.Where(x => x.MonryResult.Contains(info.MonryResult) && x.detail_Condition == info.detail_Condition).ToList(); var list = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList(); int zongshu = detail.Count(); int zongye = zongshu / count; zongye = zongshu % count == 0 ? zongye : zongye + 1; if (current < zongye) { ViewBag.currentc = current + 1; } else { ViewBag.currentc = zongye; } ViewBag.zongye = zongye; ViewBag.current = current; return(View(list)); } } }
public IntroduceService() { _imgPath = ResourcePath.Introduce; _detail = new DetailManager(ModularType.Introduce); }
public TouristInformationService() { _imgPath = ResourcePath.TouristInformation; _detail = new DetailManager(ModularType.TouristInformation); }
public WisdomGuideService() { _resourcePath = ResourcePath.WisdomGuide; _voicePath = ResourcePath.Voice; _detail = new DetailManager(ModularType.WisdomGuide); }
// Start is called before the first frame update void Start() { manager = Builder.FindGameObject <DetailManager>("ItemDetail"); }
public TouristRouteService() { _imgPath = ResourcePath.TouristRoute; _detail = new DetailManager(ModularType.TouristRoute); }