예제 #1
0
        public ActionResult Add(long id)
        {
            ProductDescriptionTemplateInfo productDescriptionTemplateInfo = new ProductDescriptionTemplateInfo();

            if (id > 0)
            {
                productDescriptionTemplateInfo = ServiceHelper.Create <IProductDescriptionTemplateService>().GetTemplate(id, base.CurrentSellerManager.ShopId);
            }
            ProductDescriptionTemplateModel productDescriptionTemplateModel = new ProductDescriptionTemplateModel()
            {
                Id          = productDescriptionTemplateInfo.Id,
                Position    = (int)productDescriptionTemplateInfo.Position,
                Name        = productDescriptionTemplateInfo.Name,
                HtmlContent = productDescriptionTemplateInfo.Content
            };

            return(View(productDescriptionTemplateModel));
        }
        public ActionResult Add(long id)
        {
            ProductDescriptionTemplateInfo template = new ProductDescriptionTemplateInfo();

            if (id > 0)
            {
                template = _iProductDescriptionTemplateService.GetTemplate(id, CurrentSellerManager.ShopId);
            }

            var model = new ProductDescriptionTemplateModel()
            {
                Id                = template.Id,
                Position          = (int)template.Position,
                Name              = template.Name,
                HtmlContent       = template.Content,
                MobileHtmlContent = template.MobileContent
            };

            return(View(model));
        }
예제 #3
0
        public JsonResult Add(ProductDescriptionTemplateModel model)
        {
            ProductDescriptionTemplateInfo productDescriptionTemplateInfo = new ProductDescriptionTemplateInfo()
            {
                Id       = model.Id,
                Content  = model.HtmlContent,
                Name     = model.Name,
                Position = (ProductDescriptionTemplateInfo.TemplatePosition)model.Position,
                ShopId   = base.CurrentSellerManager.ShopId
            };
            ProductDescriptionTemplateInfo     productDescriptionTemplateInfo1   = productDescriptionTemplateInfo;
            IProductDescriptionTemplateService productDescriptionTemplateService = ServiceHelper.Create <IProductDescriptionTemplateService>();

            if (model.Id <= 0)
            {
                productDescriptionTemplateService.AddTemplate(productDescriptionTemplateInfo1);
            }
            else
            {
                productDescriptionTemplateService.UpdateTemplate(productDescriptionTemplateInfo1);
            }
            return(Json(new { success = true }));
        }
        public JsonResult Add(ProductDescriptionTemplateModel model)
        {
            var template = new ProductDescriptionTemplateInfo()
            {
                Id            = model.Id,
                Content       = model.HtmlContent,
                MobileContent = model.MobileHtmlContent,
                Name          = model.Name,
                Position      = (ProductDescriptionTemplateInfo.TemplatePosition)model.Position,
                ShopId        = CurrentSellerManager.ShopId
            };
            var service = _iProductDescriptionTemplateService;

            if (model.Id > 0)
            {
                service.UpdateTemplate(template);
            }
            else
            {
                service.AddTemplate(template);
            }
            return(Json(new { success = true }));
        }