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 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 }));
        }