public JsonResult GetVShopBanner(long?id) { Entities.BannerInfo banner = new Entities.BannerInfo(); if (id.HasValue) { banner = _iNavigationService.GetSellerNavigation(id.Value); } return(Json(new { success = true, item = banner })); }
public JsonResult Edit(Entities.BannerInfo info) { if (!string.IsNullOrWhiteSpace(info.Name) && !string.IsNullOrWhiteSpace(info.Url)) { _iNavigationService.UpdatePlatformNavigation(info); return(Json(new Result() { success = true, msg = "编辑导航成功!" })); } else { return(Json(new Result() { success = false, msg = "导航名称和跳转地址不能为空!" })); } }
public JsonResult Edit(Entities.BannerInfo info) { if (!string.IsNullOrWhiteSpace(info.Name) && !string.IsNullOrWhiteSpace(info.Url)) { info.ShopId = CurrentSellerManager.ShopId; _iNavigationService.UpdateSellerNavigation(info); ClearCache(); return(Json(new Result() { success = true, msg = "编辑导航成功!" })); } else { return(Json(new Result() { success = false, msg = "导航名称和跳转地址不能为空!" })); } }
public JsonResult SaveVShopBanner(long?id, string bannerName, string url, int urlType) { var vshop = _iVShopService.GetVShopByShopId(CurrentSellerManager.ShopId); switch (urlType) { case 1: url = "/m-" + PlatformType.WeiXin.ToString() + "/vshop/Search?vshopid=" + vshop.Id; break; case 2: url = "/m-" + PlatformType.WeiXin.ToString() + "/vshop/Category?vshopid=" + vshop.Id; break; case 3: url = "/m-" + PlatformType.WeiXin.ToString() + "/vshop/introduce/" + vshop.Id; break; default: break; } Entities.BannerInfo banner = new Entities.BannerInfo(); banner.Name = bannerName; banner.Platform = PlatformType.WeiXin; banner.ShopId = CurrentSellerManager.ShopId; banner.Url = url; banner.Position = 0; banner.UrlType = (Entities.BannerInfo.BannerUrltypes)urlType; if (id.HasValue) { banner.Id = id.Value; _iNavigationService.UpdateSellerNavigation(banner); } else { _iNavigationService.AddSellerNavigation(banner); } return(Json(new { success = true, item = banner })); }