Beispiel #1
0
        public ActionResult HelpPost()
        {
            try
            {
                string content = Request.Form["editorValue"];
                Help   model   = new Help
                {
                    ID         = Guid.NewGuid(),
                    msgcontent = content,
                    Statues    = 1
                };

                Guid id = ihelp.Create(model);
                AddCrossActionMsg("OK", "保存成功");

                return(RedirectToAction("Help"));
            }
            catch (Exception ex)
            {
                AddCrossActionMsg("fail", ex.Message);
                string errormsg = "message:" + ex.Message + " Source:" + ex.Source + " StackTrace:" + ex.StackTrace;
                WriteLog(errormsg);
                return(RedirectToAction("Help"));
            }
        }
Beispiel #2
0
        public ActionResult Add(AddEditHelpDataViewModel vModel)
        {
            ApplicationUser authedUser = UserManager.FindById(User.Identity.GetUserId());

            IHelp  newObj = vModel.DataObject;
            string message;

            if (newObj.Create(authedUser.GameAccount, authedUser.GetStaffRank(User)) == null)
            {
                message = "Error; Creation failed.";
            }
            else
            {
                LoggingUtility.LogAdminCommandUsage("*WEB* - AddHelpFile[" + newObj.Id.ToString() + "]", authedUser.GameAccount.GlobalIdentityHandle);
                message = "Creation Successful.";
            }

            return(RedirectToAction("Index", new { Message = message }));
        }