コード例 #1
0
ファイル: BackendController.cs プロジェクト: jirihelmich/CMS
        //
        // GET+POST: /Backend/Settings
        public ActionResult Settings()
        {
            Form_Settings form = new Form_Settings(this._app.ListLength, this._app.UnregistredComments);

            if (Request.HttpMethod.ToLower() == form.getMethod().ToString())
            {
                if (form.isValid(Request.Form))
                {
                    if (this._app.saveSettings(form))
                    {
                        _messages.addMessage("Settings have been successfully saved");
                        return Redirect("/backend");
                    }
                    else
                    {
                        _messages.addError("There was an error while saving settings");
                    }
                }
            }

            ViewData["form"] = form.render();
            return View();
        }