public ActionResult List(FiltersListViewModel filtersListViewModel)
        {
            questStatus status = null;

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

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

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get list of items.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            FiltersListViewModel filtersListViewModelNEW = null;
            FiltersListModeler   filtersListModeler      = new FiltersListModeler(this.Request, this.UserSession);

            status = filtersListModeler.List(out filtersListViewModelNEW);
            if (!questStatusDef.IsSuccess(status))
            {
                filtersListViewModel.questStatus = status;
                return(Json(filtersListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return result view model or as Excel
            *---------------------------------------------------------------------------------------------------------------------------------*/
            if (filtersListViewModel.bExportToExcel)
            {
                string filename = "FiltersLog_" + DateTime.Now.ToString();
                Response.ClearContent();
                Response.AddHeader("content-disposition", "atachment;filename=" + filename + ".xls");
                Response.AddHeader("Content-Type", "application/vnd.ms-excel");
                writeTsv(filtersListViewModelNEW, Response.Output);
                Response.Flush();
                Response.End();
                return(new EmptyResult());
            }
            else
            {
                status = new questStatus(Severity.Success);
                filtersListViewModelNEW.questStatus = status;
                return(Json(filtersListViewModelNEW, JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult Next(FiltersListViewModel filtersListViewModel)
        {
            questStatus status = null;


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

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

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get list of items.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            // TODO.
            FiltersListViewModel filtersListViewModelNEW = null;
            FiltersListModeler   usersListModeler        = new FiltersListModeler(this.Request, this.UserSession);

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

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            filtersListViewModelNEW.questStatus = status;
            return(Json(filtersListViewModelNEW, JsonRequestBehavior.AllowGet));
        }
        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.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            FiltersListModeler filtersListModeler = new FiltersListModeler(this.Request, this.UserSession);

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

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