Exemplo n.º 1
0
        public ActionResult Index()
        {
            //var controller = ViewContext.RouteData.Values["Controller"];
            //var action = ViewContext.RouteData.Values["Action"];

            try
            {
                _log.LogInformation("Cubic ASP.Net Core Framework Config checked @ : {0}", DateTime.Now);
                _activityRepo.CreateActivityLog("In Framework setting checking if application portal has being configured", this.ControllerContext.ActionDescriptor.ControllerName, this.ControllerContext.ActionDescriptor.ActionName, 0, null);
                if (_applicationQuery.Count() >= 1)
                {
                    if (_applicationQuery.GetAll().FirstOrDefault().HasAdminUserConfigured)
                    {
                        return(RedirectToAction("Login", "Account"));
                    }
                    else
                    {
                        return(RedirectToAction("Start", "FrameworkSetup", new { area = "Portal" }));
                    }
                }
                else
                {
                    return(RedirectToAction("Start", "FrameworkSetup", new { area = "Portal" }));
                }
            }
            catch (Exception ex)
            {
                _log.LogError(ex.Message);
                return(View(new ErrorViewModel {
                    RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier
                }));
            }
        }
Exemplo n.º 2
0
 public ActionResult Index()
 {
     try
     {
         _log.InfoFormat("SleekSoft MVC Framework Config checked @ : {0}", DateTime.Now);
         _activityRepo.CreateActivityLog("In Framework setting checking if application portal has being configured", this.GetContollerName(), this.GetContollerName(), 0, null);
         if (_applicationQuery.Count() >= 1)
         {
             if (_applicationQuery.GetAll().FirstOrDefault().HasAdminUserConfigured)
             {
                 return(RedirectToAction("Login", "Account"));
             }
             else
             {
                 return(RedirectToAction("Start", "FrameworkSetup", new { area = "Portal" }));
             }
         }
         else
         {
             return(RedirectToAction("Start", "FrameworkSetup", new { area = "Portal" }));
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex);
         return(View("Error"));
     }
 }