Beispiel #1
0
        public ActionResult List(BaseUserSessionViewModel baseUserSessionViewModel)
        {
            // Initialize
            questStatus        status             = null;
            UserMessageModeler userMessageModeler = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(baseUserSessionViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get user's tablesets.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            UserId userId = new UserId(this.UserSession.UserId);
            TablesetListViewModel tablesetListViewModel = null;
            TablesetModeler       tablesetModeler       = new TablesetModeler(this.Request, this.UserSession);

            status = tablesetModeler.List(userId, out tablesetListViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return data.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            tablesetListViewModel.questStatus = status;
            return(Json(tablesetListViewModel, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Tables(FilterEditorViewModel filterEditorViewModel)
        {
            // Initialize
            questStatus        status             = null;
            UserMessageModeler userMessageModeler = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(filterEditorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get tableset tables.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            TablesetId tablesetId = new TablesetId(filterEditorViewModel.TablesetId);
            FilterTableTreeviewViewModel filterTableTreeviewViewModel = null;
            TablesetModeler tablesetModeler = new TablesetModeler(this.Request, this.UserSession, filterEditorViewModel);

            status = tablesetModeler.List(tablesetId, out filterTableTreeviewViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return data.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            filterTableTreeviewViewModel.questStatus = status;
            return(Json(filterTableTreeviewViewModel, JsonRequestBehavior.AllowGet));
        }