public JsonResult EditSlideImage(SlideAdInfo slideAdInfo) { slideAdInfo.TypeId = SlideAdInfo.SlideAdType.VShopHome; slideAdInfo.ShopId = CurrentSellerManager.ShopId; if (slideAdInfo.Id > 0) { _iSlideAdsService.UpdateSlidAd(slideAdInfo); } else { _iSlideAdsService.AddSlidAd(slideAdInfo); } return(Json(new { success = true })); }
public JsonResult AddSlideAd(string pic, string url) { var slide = new Entities.SlideAdInfo() { ImageUrl = pic, Url = url, ShopId = 0, DisplaySequence = 0, TypeId = Entities.SlideAdInfo.SlideAdType.PlatformHome }; if (!string.IsNullOrWhiteSpace(pic)) { if (pic.Contains("/temp/")) { string source = pic.Substring(pic.LastIndexOf("/temp")); string dest = @"/Storage/Plat/ImageAd/"; pic = Path.Combine(dest, Path.GetFileName(source)); Core.MallIO.CopyFile(source, pic, true); } else if (pic.Contains("/Storage/")) { pic = pic.Substring(pic.LastIndexOf("/Storage/")); } slide.ImageUrl = pic; } _iSlideAdsService.AddSlidAd(slide); return(Json(new Result { success = true })); }
public JsonResult AddSlideAd(string pic, string url) { var slide = new SlideAdInfo() { ImageUrl = pic, Url = url, ShopId = 0, DisplaySequence = 0, TypeId = SlideAdInfo.SlideAdType.PlatformLimitTime }; if (!string.IsNullOrWhiteSpace(pic)) { if (pic.Contains("/temp/")) { string source = pic.Substring(pic.LastIndexOf("/temp/")); string dest = @"/Storage/Plat/ImageAd/"; pic = dest + Path.GetFileName(pic); Core.HimallIO.CopyFile(source, pic, true); } else if (pic.Contains("/Storage/")) { pic = pic.Substring(pic.LastIndexOf("/Storage/")); } slide.ImageUrl = pic; } _iSlideAdsService.AddSlidAd(slide); return(Json(new { successful = true }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 添加轮播图 /// </summary> /// <param name="id"></param> /// <param name="description"></param> /// <param name="imageUrl"></param> /// <param name="url"></param> /// <returns></returns> public JsonResult AddSlideImage(string id, string description, string imageUrl, string url) { if (imageUrl.Contains("/temp/")) { string source = imageUrl.Substring(imageUrl.LastIndexOf("/temp/")); string dest = @"/Storage/Plat/APP/SlidAd/"; imageUrl = dest + Path.GetFileName(imageUrl); Core.HimallIO.CopyFile(source, imageUrl, true); } else if (imageUrl.Contains("/Storage/")) { imageUrl = imageUrl.Substring(imageUrl.LastIndexOf("/Storage/")); } Result result = new Result(); var slideAdInfo = new SlideAdInfo(); slideAdInfo.Id = Convert.ToInt64(id); slideAdInfo.ImageUrl = imageUrl; slideAdInfo.TypeId = SlideAdInfo.SlideAdType.DistributionHome; slideAdInfo.Url = url.ToLower().Replace("/m-wap", "/m-ios").Replace("/m-weixin", "/m-ios"); slideAdInfo.Description = description; slideAdInfo.ShopId = 0; if (slideAdInfo.Id > 0) { _iSlideAdsService.UpdateSlidAd(slideAdInfo); } else { _iSlideAdsService.AddSlidAd(slideAdInfo); } result.success = true; return(Json(result)); }
public JsonResult AddSlideImage(string id, string description, string imageUrl, string url, int slideTypeId) { Result result = new Result(); var slideAdInfo = new Entities.SlideAdInfo(); slideAdInfo.Id = Convert.ToInt64(id); slideAdInfo.ImageUrl = imageUrl; slideAdInfo.TypeId = (Entities.SlideAdInfo.SlideAdType)slideTypeId; slideAdInfo.Url = url.ToLower(); slideAdInfo.Description = description; slideAdInfo.ShopId = 0; if (slideAdInfo.Id > 0) { _iSlideAdsService.UpdateSlidAd(slideAdInfo); } else { _iSlideAdsService.AddSlidAd(slideAdInfo); } result.success = true; return(Json(result)); }
public JsonResult SaveSlideImage(long?id, string imageUrl, string url) { Entities.SlideAdInfo slideImageIfo = new Entities.SlideAdInfo(); slideImageIfo.ImageUrl = imageUrl; slideImageIfo.Url = url; slideImageIfo.ShopId = CurrentSellerManager.ShopId; slideImageIfo.TypeId = Entities.SlideAdInfo.SlideAdType.VShopHome; if (id.HasValue) { slideImageIfo.Id = id.Value; _iSlideAdsService.UpdateSlidAd(slideImageIfo); } else { _iSlideAdsService.AddSlidAd(slideImageIfo); } return(Json(new { success = true })); }
public JsonResult SaveSlideAd(long?id, string pic, string url) { var slide = new Entities.SlideAdInfo() { ImageUrl = pic, Url = url, ShopId = CurrentSellerManager.ShopId, DisplaySequence = 0, Id = id.GetValueOrDefault(), TypeId = Entities.SlideAdInfo.SlideAdType.ShopHome }; if (!string.IsNullOrWhiteSpace(pic) && pic.Contains("/temp/")) { string dest = string.Format(@"/Storage/Shop/{0}/ImageAd/", CurrentSellerManager.ShopId); var destimg = slide.ImageUrl = Path.Combine(dest, Path.GetFileName(pic)); var source = pic.Substring(pic.LastIndexOf("/temp/")); Core.HimallIO.CopyFile(source, destimg, true); slide.ImageUrl = destimg; } else if (pic.Contains("/Storage/")) { slide.ImageUrl = pic.Substring(pic.LastIndexOf("/Storage/")); } else { slide.ImageUrl = ""; } if (id.HasValue) { _iSlideAdsService.UpdateSlidAd(slide); } else { _iSlideAdsService.AddSlidAd(slide); } ClearCache(); return(Json(new { success = true, imageUrl = slide.ImageUrl })); }
public JsonResult AppAddSlideImage(string id, string description, string imageUrl, string url) { Result result = new Result(); var slideAdInfo = new SlideAdInfo(); slideAdInfo.Id = Convert.ToInt64(id); slideAdInfo.TypeId = SlideAdInfo.SlideAdType.AppGifts; slideAdInfo.Url = url.ToLower().Replace("/m-wap", "/m-app").Replace("/m-weixin", "/m-app"); slideAdInfo.Description = description; slideAdInfo.ShopId = 0; slideAdInfo.ImageUrl = imageUrl; if (slideAdInfo.Id > 0) { _iSlideAdsService.UpdateSlidAd(slideAdInfo); } else { _iSlideAdsService.AddSlidAd(slideAdInfo); } result.success = true; return(Json(result)); }
/// <summary> /// 添加一个自动轮播广告图片 /// </summary> /// <param name="model"></param> public static void AddSlidAd(SlideAdInfo model) { _iSlideAdsService.AddSlidAd(model); }