예제 #1
0
        public ActionResult Next(Quest.MasterPricing.Database.Models.StoredProceduresListViewModel storedProceduresListViewModel)
        {
            questStatus status = null;


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

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(storedProceduresListViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                status = new questStatus(Severity.Success);
                storedProceduresListViewModel.questStatus = status;
                return(Json(storedProceduresListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get list of items.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            DatabaseId databaseId = new DatabaseId(storedProceduresListViewModel.DatabaseId);

            Quest.MasterPricing.Database.Models.StoredProceduresListViewModel viewsetsListViewModelNEW = null;
            StoredProceduresListModeler viewsListModeler = new StoredProceduresListModeler(this.Request, this.UserSession);

            status = viewsListModeler.List(databaseId, out viewsetsListViewModelNEW);
            if (!questStatusDef.IsSuccess(status))
            {
                status = new questStatus(Severity.Success);
                storedProceduresListViewModel.questStatus = status;
                return(Json(storedProceduresListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            viewsetsListViewModelNEW.questStatus = status;
            return(Json(viewsetsListViewModelNEW, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ActionResult List(Quest.MasterPricing.Database.Models.StoredProceduresListViewModel storedProceduresListViewModel)
        {
            // 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(storedProceduresListViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get database views.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            DatabaseId databaseId = new DatabaseId(storedProceduresListViewModel.DatabaseId);

            Quest.MasterPricing.Database.Models.StoredProceduresListViewModel storedProceduresListViewModelNEW = null;
            StoredProceduresListModeler viewsListModeler = new StoredProceduresListModeler(this.Request, this.UserSession);

            status = viewsListModeler.List(databaseId, out storedProceduresListViewModelNEW);
            if (!questStatusDef.IsSuccess(status))
            {
                userMessageModeler = new UserMessageModeler(status);
                return(Json(userMessageModeler, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return data.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            storedProceduresListViewModelNEW.questStatus = status;
            return(Json(storedProceduresListViewModelNEW, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        public ActionResult Index(DatabaseEditorViewModel databaseEditorViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                databaseEditorViewModel.questStatus = status;
                return(View("Index", databaseEditorViewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(databaseEditorViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                databaseEditorViewModel.questStatus = status;
                return(View("Index", databaseEditorViewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Read the database info.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            DatabaseId            databaseId            = new DatabaseId(databaseEditorViewModel.Id);
            DatabaseBaseViewModel databaseBaseViewModel = null;
            DatabaseBaseModeler   databaseBaseModeler   = new DatabaseBaseModeler(this.Request, this.UserSession);

            status = databaseBaseModeler.GetDatabase(databaseId, out databaseBaseViewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                databaseEditorViewModel.questStatus = status;
                return(View("Index", databaseEditorViewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            Quest.MasterPricing.Database.Models.StoredProceduresListViewModel storedProceduresListViewModel = new Quest.MasterPricing.Database.Models.StoredProceduresListViewModel(this.UserSession, databaseEditorViewModel);
            storedProceduresListViewModel.DatabaseId = databaseBaseViewModel.Id;
            storedProceduresListViewModel.Database   = databaseBaseViewModel;
            return(View(storedProceduresListViewModel));
        }