Esempio n. 1
0
        public ActionResult AddHelpCategory(HelpCategoryModel model)
        {
            if (ModelState.IsValid)
            {
                HelpInfo helpInfo = new HelpInfo()
                {
                    Pid = 0,
                    Title = model.HelpCategoryTitle,
                    Url = "",
                    Description = "",
                    DisplayOrder = model.DisplayOrder
                };

                AdminHelps.CreateHelp(helpInfo);
                AddMallAdminLog("添加帮助分类", "添加帮助分类,帮助分类为:" + model.HelpCategoryTitle);
                return PromptView("帮助分类添加成功");
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
Esempio n. 2
0
        public ActionResult EditHelpCategory(HelpCategoryModel model, int id = -1)
        {
            HelpInfo helpInfo = AdminHelps.GetHelpById(id);
            if (helpInfo == null)
                return PromptView("帮助分类不存在");

            if (ModelState.IsValid)
            {
                helpInfo.Pid = 0;
                helpInfo.Title = model.HelpCategoryTitle;
                helpInfo.Url = "";
                helpInfo.Description = "";
                helpInfo.DisplayOrder = model.DisplayOrder;

                AdminHelps.UpdateHelp(helpInfo);
                AddMallAdminLog("修改帮助分类", "修改帮助分类,帮助分类ID为:" + id);
                return PromptView("帮助分类修改成功");
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
Esempio n. 3
0
 public ActionResult AddHelpCategory()
 {
     HelpCategoryModel model = new HelpCategoryModel();
     ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
     return View(model);
 }
Esempio n. 4
0
        public ActionResult EditHelpCategory(int id = -1)
        {
            HelpInfo helpInfo = AdminHelps.GetHelpById(id);
            if (helpInfo == null)
                return PromptView("帮助分类不存在");

            HelpCategoryModel model = new HelpCategoryModel();
            model.HelpCategoryTitle = helpInfo.Title;
            model.DisplayOrder = helpInfo.DisplayOrder;
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();

            return View(model);
        }