public ActionResult BannerPictureDelete(PromoBannerPictureModel bannerPictureModel) { if ((bannerPictureModel == null) || (bannerPictureModel.Id == 0)) { ModelState.AddModelError(string.Empty, _localizationService.GetResource("Plugins.Widgets.QixolPromo.BannerPicture.ValidationMsg.Delete")); return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() }); } var bannerPicture = _promoBannerService.RetrieveBannerPictureById(bannerPictureModel.Id); if (bannerPicture == null) { ModelState.AddModelError(string.Empty, _localizationService.GetResource("Plugins.Widgets.QixolPromo.BannerPicture.ValidationMsg.Delete")); return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() }); } _promoBannerService.DeleteBannerPicture(bannerPicture); return new NullJsonResult(); }
public ActionResult BannerPictureEdit(PromoBannerPictureModel bannerPictureModel) { if ((bannerPictureModel == null) || (bannerPictureModel.Id == 0)) { ModelState.AddModelError(string.Empty, _localizationService.GetResource("Plugins.Widgets.QixolPromo.BannerPicture.ValidationMsg.Edit")); return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() }); } var bannerPicture = _promoBannerService.RetrieveBannerPictureById(bannerPictureModel.Id); if (bannerPicture == null) { ModelState.AddModelError(string.Empty, _localizationService.GetResource("Plugins.Widgets.QixolPromo.BannerPicture.ValidationMsg.Edit")); return Json(new DataSourceResult { Errors = ModelState.SerializeErrors() }); } bannerPicture.PromoReference = bannerPictureModel.PromoReference; bannerPicture.Url = bannerPictureModel.Url; bannerPicture.DisplaySequence = bannerPictureModel.DisplaySequence; bannerPicture.Comment = bannerPictureModel.Comment; _promoBannerService.UpdateBannerPicture(bannerPicture); return new NullJsonResult(); }