Exemplo n.º 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));
        }
Exemplo n.º 2
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));
        }