Esempio n. 1
0
        public ActionResult AddHelp(HelpModel model)
        {
            if (ModelState.IsValid)
            {
                HelpInfo helpInfo = new HelpInfo()
                {
                    Pid = model.Pid,
                    Title = model.HelpTitle,
                    Url = model.Url == null ? "" : model.Url,
                    Description = model.Description ?? "",
                    DisplayOrder = model.DisplayOrder
                };

                AdminHelps.CreateHelp(helpInfo);
                AddAdminOperateLog("添加帮助", "添加帮助,帮助为:" + model.HelpTitle);
                return PromptView("帮助添加成功");
            }
            Load();
            return View(model);
        }
Esempio n. 2
0
        public ActionResult EditHelp(HelpModel model, int id = -1)
        {
            HelpInfo helpInfo = AdminHelps.GetHelpById(id);
            if (helpInfo == null)
                return PromptView("帮助不存在");

            if (ModelState.IsValid)
            {
                helpInfo.Pid = model.Pid;
                helpInfo.Title = model.HelpTitle;
                helpInfo.Url = model.Url == null ? "" : model.Url;
                helpInfo.Description = model.Description ?? "";
                helpInfo.DisplayOrder = model.DisplayOrder;

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

            Load();
            return View(model);
        }
Esempio n. 3
0
 public ActionResult AddHelp()
 {
     HelpModel model = new HelpModel();
     Load();
     return View(model);
 }
Esempio n. 4
0
        public ActionResult EditHelp(int id = -1)
        {
            HelpInfo helpInfo = AdminHelps.GetHelpById(id);
            if (helpInfo == null)
                return PromptView("帮助不存在");

            HelpModel model = new HelpModel();
            model.Pid = helpInfo.Pid;
            model.HelpTitle = helpInfo.Title;
            model.Url = helpInfo.Url;
            model.Description = helpInfo.Description;
            model.DisplayOrder = helpInfo.DisplayOrder;
            Load();

            return View(model);
        }