public ActionResult Index(BaseUserSessionViewModel baseUserSessionViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                baseUserSessionViewModel.questStatus = status;
                return(View("~/Views/Shared/ErrorUserSession.cshtml", baseUserSessionViewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(baseUserSessionViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                baseUserSessionViewModel.questStatus = status;
                return(View("~/Views/Shared/ErrorUserSession.cshtml", baseUserSessionViewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            DataMgrOverviewViewModel dataMgrOverviewViewModel = new DataMgrOverviewViewModel(this.UserSession, baseUserSessionViewModel);

            return(View(dataMgrOverviewViewModel));
        }
Ejemplo n.º 2
0
        public ActionResult Index(BaseUserSessionViewModel baseUserSessionViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("LogOperation failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(baseUserSessionViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                // TODO
                throw new Exception("Authorize failed");
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            DataMgrOverviewViewModel dataMgrOverviewViewModel = new DataMgrOverviewViewModel(this.UserSession, baseUserSessionViewModel);

            return(View(dataMgrOverviewViewModel));
        }