示例#1
0
        public ActionResult List(StoredProceduresListViewModel storedProceduresListViewModel)
        {
            questStatus status = null;

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

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

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get list of items.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            StoredProceduresListViewModel storedProceduresListViewModelNEW = null;
            StoredProceduresListModeler   storedProceduresListModeler      = new StoredProceduresListModeler(this.Request, this.UserSession);

            status = storedProceduresListModeler.List(out storedProceduresListViewModelNEW);
            if (!questStatusDef.IsSuccess(status))
            {
                storedProceduresListViewModel.questStatus = status;
                return(Json(storedProceduresListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return result view model or as Excel
            *---------------------------------------------------------------------------------------------------------------------------------*/
            if (storedProceduresListViewModel.bExportToExcel)
            {
                string filename = "StoredProceduresLog_" + DateTime.Now.ToString();
                Response.ClearContent();
                Response.AddHeader("content-disposition", "atachment;filename=" + filename + ".xls");
                Response.AddHeader("Content-Type", "application/vnd.ms-excel");
                writeTsv(storedProceduresListViewModelNEW, Response.Output);
                Response.Flush();
                Response.End();
                return(new EmptyResult());
            }
            else
            {
                status = new questStatus(Severity.Success);
                storedProceduresListViewModelNEW.questStatus = status;
                return(Json(storedProceduresListViewModelNEW, JsonRequestBehavior.AllowGet));
            }
        }
示例#2
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));
        }
示例#3
0
        public ActionResult Next(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.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            // TODO.
            StoredProceduresListViewModel tablesetsListViewModelNEW = null;
            StoredProceduresListModeler   usersListModeler          = new StoredProceduresListModeler(this.Request, this.UserSession);

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

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            tablesetsListViewModelNEW.questStatus = status;
            return(Json(tablesetsListViewModelNEW, JsonRequestBehavior.AllowGet));
        }
示例#4
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));
        }
示例#5
0
        public ActionResult Delete(DeleteLogItemsViewModel viewModel)
        {
            questStatus status = null;

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

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

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Perform operation.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            StoredProceduresListModeler storedProceduresListModeler = new StoredProceduresListModeler(this.Request, this.UserSession);

            status = storedProceduresListModeler.Delete(viewModel);
            if (!questStatusDef.IsSuccess(status))
            {
                viewModel.questStatus = status;
                return(Json(viewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return result.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success, "Selected Stored Procedure log entries successfully deleted");
            viewModel.questStatus = status;
            return(Json(viewModel, JsonRequestBehavior.AllowGet));
        }