예제 #1
0
        public ActionResult EditSystemConfig()
        {
            User u = (User)Session[KeysUtils.SessionAdmin()];

            if (u == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                return(View(SystemConf.GetSystemConf()));
            }
        }
예제 #2
0
        public ActionResult EditSystemConfig(SystemConf conf)
        {
            User u = (User)Session[KeysUtils.SessionAdmin()];

            if (u == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    conf.save();
                    ViewBag.Status  = true;
                    ViewBag.Message = "Successfuly edited configuration";
                }
                else
                {
                    ViewBag.Message = "Invalid Request";
                    conf            = SystemConf.GetSystemConf();
                }
                return(View(conf));
            }
        }