Exemplo n.º 1
0
        public static SiteConfig GetSiteConfig()
        {
            LogHelpers.LogHandler.Info("Start");
            var result = SiteSettingsDAL.GetSiteConfig();

            if (result.Code < 0)
            {
                LogHelpers.LogHandler.Error(result.ErrorMessage);
                return(new SiteConfig());
            }

            return(result.Data);
        }
Exemplo n.º 2
0
        public ActionResult Setup()
        {
            if (!Utilities.IsLoggedUser())
            {
                return(RedirectToAction("Login", "Home"));
            }

            var result = SiteSettingsDAL.GetSiteConfig();

            if (result.Code < 0)
            {
                LogHelpers.LogHandler.Error(result.ErrorMessage);
            }

            return(View("Setup", result.Data));
        }
Exemplo n.º 3
0
        public ActionResult Index(SiteConfig config)
        {
            if (!Utilities.IsLoggedUser())
            {
                return(RedirectToAction("Login", "Home"));
            }

            LogHelpers.LogHandler.Info("Start.");
            if (config == null)
            {
                return(View(new SiteConfig()));
            }

            var result = SiteSettingsDAL.SaveSiteConfig(config);

            if (result.Code < 0)
            {
                LogHelpers.LogHandler.Error(result.ErrorMessage);
                ModelState.AddModelError("", result.ErrorMessage);
            }

            return(View(config));
        }