예제 #1
0
        public ActionResult Edit(StoreIndustryModel model, int storeIid = -1)
        {
            StoreIndustryInfo storeIndustryInfo = AdminStoreIndustries.GetStoreIndustryById(storeIid);

            if (storeIndustryInfo == null)
            {
                return(PromptView("店铺行业不存在"));
            }

            int storeIid2 = AdminStoreIndustries.GetStoreIidByTitle(model.IndustryTitle);

            if (storeIid2 > 0 && storeIid2 != storeIid)
            {
                ModelState.AddModelError("IndustryTitle", "行业标题已经存在");
            }

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

                AdminStoreIndustries.UpdateStoreIndustry(storeIndustryInfo);
                AddMallAdminLog("修改店铺行业", "修改店铺行业,店铺行业ID为:" + storeIid);
                return(PromptView("店铺行业修改成功"));
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
예제 #2
0
        public ActionResult Add()
        {
            StoreIndustryModel model = new StoreIndustryModel();

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
예제 #3
0
        public ActionResult Edit(int storeIid = -1)
        {
            StoreIndustryInfo storeIndustryInfo = AdminStoreIndustries.GetStoreIndustryById(storeIid);

            if (storeIndustryInfo == null)
            {
                return(PromptView("店铺行业不存在"));
            }

            StoreIndustryModel model = new StoreIndustryModel();

            model.IndustryTitle = storeIndustryInfo.Title;
            model.DisplayOrder  = storeIndustryInfo.DisplayOrder;

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
예제 #4
0
        public ActionResult Add(StoreIndustryModel model)
        {
            if (AdminStoreIndustries.GetStoreIidByTitle(model.IndustryTitle) > 0)
            {
                ModelState.AddModelError("IndustryTitle", "行业标题已经存在");
            }

            if (ModelState.IsValid)
            {
                StoreIndustryInfo storeIndustryInfo = new StoreIndustryInfo()
                {
                    Title        = model.IndustryTitle,
                    DisplayOrder = model.DisplayOrder
                };

                AdminStoreIndustries.CreateStoreIndustry(storeIndustryInfo);
                AddMallAdminLog("添加店铺行业", "添加店铺行业,店铺行业为:" + model.IndustryTitle);
                return(PromptView("店铺行业添加成功"));
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }