Esempio n. 1
0
        public ActionResult AddProductConsultType()
        {
            ProductConsultTypeModel model = new ProductConsultTypeModel();

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Esempio n. 2
0
        public ActionResult EditProductConsultType(int consultTypeId = -1)
        {
            ProductConsultTypeInfo productConsultTypeInfo = AdminProductConsults.GetProductConsultTypeById(consultTypeId);

            if (productConsultTypeInfo == null)
            {
                return(PromptView("商品咨询类型不存在"));
            }

            ProductConsultTypeModel model = new ProductConsultTypeModel();

            model.Title         = productConsultTypeInfo.Title;
            model.DisplayOrder  = productConsultTypeInfo.DisplayOrder;
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Esempio n. 3
0
        public ActionResult AddProductConsultType(ProductConsultTypeModel model)
        {
            if (ModelState.IsValid)
            {
                ProductConsultTypeInfo productConsultTypeInfo = new ProductConsultTypeInfo()
                {
                    Title        = model.Title,
                    DisplayOrder = model.DisplayOrder
                };

                AdminProductConsults.CreateProductConsultType(productConsultTypeInfo);
                AddMallAdminLog("添加商品咨询类型", "添加商品咨询类型,商品咨询类型为:" + model.Title.Trim());
                return(PromptView("商品咨询类型添加成功"));
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Esempio n. 4
0
        public ActionResult EditProductConsultType(ProductConsultTypeModel model, int consultTypeId = -1)
        {
            ProductConsultTypeInfo productConsultTypeInfo = AdminProductConsults.GetProductConsultTypeById(consultTypeId);

            if (productConsultTypeInfo == null)
            {
                return(PromptView("商品咨询类型不存在"));
            }

            if (ModelState.IsValid)
            {
                productConsultTypeInfo.Title        = model.Title;
                productConsultTypeInfo.DisplayOrder = model.DisplayOrder;

                AdminProductConsults.UpdateProductConsultType(productConsultTypeInfo);
                AddMallAdminLog("修改商品咨询类型", "修改商品咨询类型,商品咨询类型ID为:" + consultTypeId);
                return(PromptView("商品咨询类型修改成功"));
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }