コード例 #1
0
        public ActionResult search()
        {
            try
            {
                dynamic accessGranted = null, chrt_array = XVar.Array(), cname = null, id = null, layoutVersion = null, pageMode = null, pageObject = null, rname = null, templatefile = null, var_params = XVar.Array();
                XTempl  xt;
                CommonFunctions.add_nocache_headers();
                VISTOBUENO_JEFEDEPARTAMENTO_Variables.Apply();
                Security.processLogoutRequest();
                if (XVar.Pack(!(XVar)(CommonFunctions.isLogged())))
                {
                    Security.saveRedirectURL();
                    CommonFunctions.redirectToLogin();
                }
                cname         = XVar.Clone(MVCFunctions.postvalue(new XVar("cname")));
                rname         = XVar.Clone(MVCFunctions.postvalue(new XVar("rname")));
                accessGranted = XVar.Clone(CommonFunctions.CheckTablePermissions((XVar)(GlobalVars.strTableName), new XVar("S")));
                if (XVar.Pack(!(XVar)(accessGranted)))
                {
                    MVCFunctions.HeaderRedirect(new XVar("menu"));
                }
                {
                    TLayout t_layout = null;

                    t_layout                          = new TLayout(new XVar("search_bootstrap"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version                  = 3;
                    t_layout.bootstrapTheme           = "default";
                    t_layout.customCssPageName        = "VISTOBUENO_JEFEDEPARTAMENTO_search";
                    t_layout.blocks["top"]            = XVar.Array();
                    t_layout.containers["searchpage"] = XVar.Array();
                    t_layout.containers["searchpage"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "header"));
                    t_layout.containers["header"] = XVar.Array();
                    t_layout.containers["header"].Add(new XVar("name", "bssearchheader", "block", "searchheader", "substyle", 1));

                    t_layout.skins["header"] = "";


                    t_layout.skins["searchpage"] = "";

                    t_layout.blocks["top"].Add("searchpage");
                    t_layout.containers["fields"] = XVar.Array();
                    t_layout.containers["fields"].Add(new XVar("name", "bssearchfields", "block", "", "substyle", 1));

                    t_layout.skins["fields"] = "";

                    t_layout.blocks["top"].Add("fields");
                    t_layout.containers["bottombuttons"] = XVar.Array();
                    t_layout.containers["bottombuttons"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "bbuttons"));
                    t_layout.containers["bbuttons"] = XVar.Array();
                    t_layout.containers["bbuttons"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "leftbuttons"));
                    t_layout.containers["leftbuttons"] = XVar.Array();
                    t_layout.containers["leftbuttons"].Add(new XVar("name", "srchbuttons", "block", "searchbuttons", "substyle", 1));

                    t_layout.skins["leftbuttons"] = "";


                    t_layout.skins["bbuttons"] = "";


                    t_layout.skins["bottombuttons"] = "";

                    t_layout.blocks["top"].Add("bottombuttons");
                    GlobalVars.page_layouts["VISTOBUENO_JEFEDEPARTAMENTO_search"] = t_layout;
                }

                xt       = XVar.UnPackXTempl(new XTempl());
                pageMode = XVar.Clone(SearchPage.readSearchModeFromRequest());
                if (pageMode == Constants.SEARCH_LOAD_CONTROL)
                {
                    layoutVersion = XVar.Clone(MVCFunctions.postvalue(new XVar("layoutVersion")));
                }
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(CommonFunctions.postvalue_number(new XVar("id")), "id");
                var_params.InitAndSetArrayItem(pageMode, "mode");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("page")), "pageName");
                var_params.InitAndSetArrayItem(Constants.PAGE_SEARCH, "pageType");
                var_params.InitAndSetArrayItem(cname, "chartName");
                var_params.InitAndSetArrayItem(rname, "reportName");
                var_params.InitAndSetArrayItem(templatefile, "templatefile");
                var_params.InitAndSetArrayItem("VISTOBUENO_JEFEDEPARTAMENTO", "shortTableName");
                var_params.InitAndSetArrayItem(layoutVersion, "layoutVersion");
                var_params.InitAndSetArrayItem((XVar.Pack(MVCFunctions.postvalue(new XVar("searchControllerId"))) ? XVar.Pack(MVCFunctions.postvalue(new XVar("searchControllerId"))) : XVar.Pack(id)), "searchControllerId");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("ctrlField")), "ctrlField");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("isNeedSettings")), "needSettings");
                if (pageMode == Constants.SEARCH_DASHBOARD)
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("table")), "dashTName");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashelement")), "dashElementName");
                }
                var_params.InitAndSetArrayItem(SearchPage.getExtraPageParams(), "extraPageParams");
                GlobalVars.pageObject = XVar.Clone(new SearchPage((XVar)(var_params)));
                if (pageMode == Constants.SEARCH_LOAD_CONTROL)
                {
                    GlobalVars.pageObject.displaySearchControl();
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                if (pageMode == Constants.SEARCH_DASHBOARD)
                {
                    MVCFunctions.Echo(new XVar(""));
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #2
0
ファイル: ViewControl.cs プロジェクト: kurtrad/ABCVote
        protected virtual XVar haveTheSameSpChReference(dynamic _param_pattern, dynamic _param_value)
        {
            #region pass-by-value parameters
            dynamic pattern = XVar.Clone(_param_pattern);
            dynamic value   = XVar.Clone(_param_value);
            #endregion

            dynamic scContainedPattern = XVar.Array(), scFromValue = null;
            scContainedPattern = XVar.Clone(getSpecialCharsContainingPattern((XVar)(pattern)));
            scFromValue        = XVar.Clone(getSpecialCharsFromString((XVar)(value)));
            foreach (KeyValuePair <XVar, dynamic> sc in scContainedPattern.GetEnumerator())
            {
                if (!XVar.Equals(XVar.Pack(MVCFunctions.array_search((XVar)(sc.Value), (XVar)(scFromValue))), XVar.Pack(false)))
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #3
0
ファイル: ViewControl.cs プロジェクト: kurtrad/ABCVote
        protected virtual XVar highlightTruncatedBeforeMore(dynamic _param_value, dynamic _param_truncatedValue, dynamic _param_cNumberOfChars, dynamic _param_contenLength)
        {
            #region pass-by-value parameters
            dynamic value          = XVar.Clone(_param_value);
            dynamic truncatedValue = XVar.Clone(_param_truncatedValue);
            dynamic cNumberOfChars = XVar.Clone(_param_cNumberOfChars);
            dynamic contenLength   = XVar.Clone(_param_contenLength);
            #endregion

            dynamic firstPos = null, highlightData = XVar.Array(), highlighting = null, lastPos = null, lookupParams = null, pattern = null, regExpModifier = null, searchOpt = null, searchWord = null, searchWordEncoded = null, searchWordEncodedLen = null, truncLen = null;
            lookupParams  = XVar.Clone(getLookupParams());
            highlightData = XVar.Clone(this.searchClauseObj.getSearchHighlightingData((XVar)(this.field), (XVar)(value), new XVar(false), (XVar)(lookupParams)));
            if (XVar.Pack(!(XVar)(highlightData)))
            {
                return(truncatedValue);
            }
            searchWord        = XVar.Clone(getFirstSearchWordInLargeText((XVar)(highlightData["searchWords"]), (XVar)(value)));
            searchWordEncoded = XVar.Clone(MVCFunctions.runner_htmlspecialchars((XVar)(searchWord)));
            highlighting      = XVar.Clone(addHighlightingSpan((XVar)(searchWordEncoded)));
            searchOpt         = XVar.Clone(highlightData["searchOpt"]);
            switch (((XVar)searchOpt).ToString())
            {
            case "Equals":
                return(addHighlightingSpan((XVar)(truncatedValue)));

            case "Starts with":
                if (MVCFunctions.strlen((XVar)(truncatedValue)) < MVCFunctions.strlen((XVar)(searchWordEncoded)))
                {
                    return(addHighlightingSpan((XVar)(truncatedValue)));
                }
                return(MVCFunctions.preg_replace((XVar)(MVCFunctions.Concat("/^", MVCFunctions.preg_quote((XVar)(searchWordEncoded), new XVar("/")), "/i")), (XVar)(highlighting), (XVar)(truncatedValue)));

            case "Contains":
                regExpModifier       = XVar.Clone((XVar.Pack(this.useUTF8) ? XVar.Pack("u") : XVar.Pack("")));
                firstPos             = XVar.Clone(getFistOccurencePosition((XVar)(value), (XVar)(searchWord), (XVar)(searchWordEncoded)));
                lastPos              = XVar.Clone(getLastOccurencePosition((XVar)(value), (XVar)(searchWord), (XVar)(searchWordEncoded)));
                searchWordEncodedLen = XVar.Clone(MVCFunctions.runner_strlen((XVar)(searchWordEncoded)));
                truncLen             = XVar.Clone(MVCFunctions.runner_strlen((XVar)(truncatedValue)));
                pattern              = XVar.Clone(MVCFunctions.Concat("/(", getSearchWordPattern((XVar)(highlightData["searchWords"]), new XVar(true)), ")/i"));
                if ((XVar)(lastPos + searchWordEncodedLen <= truncLen) || (XVar)(firstPos + searchWordEncodedLen <= truncLen))
                {
                    if (XVar.Pack(!(XVar)(haveTheSameSpChReference((XVar)(pattern), (XVar)(truncatedValue)))))
                    {
                        return(MVCFunctions.preg_replace((XVar)(MVCFunctions.Concat(pattern, regExpModifier)), (XVar)(addHighlightingSpan(new XVar("$1"))), (XVar)(truncatedValue)));
                    }
                    return(highlightValueWithSpecialChars((XVar)(truncatedValue), (XVar)(MVCFunctions.Concat(pattern, regExpModifier))));
                }
                if (truncLen < firstPos)
                {
                    dynamic firstPosDecoded = null, newNumberOfChars = null, qNumberOfChars = null, truncSubsr = null, valueSubstr = null;
                    newNumberOfChars = XVar.Clone((XVar)Math.Ceiling((double)(cNumberOfChars / 2)));
                    qNumberOfChars   = XVar.Clone((XVar)Math.Ceiling((double)(cNumberOfChars / 4)));
                    firstPosDecoded  = XVar.Clone(MVCFunctions.runner_strpos((XVar)(value), (XVar)(searchWord)));
                    truncSubsr       = XVar.Clone(MVCFunctions.runner_substr((XVar)(value), new XVar(0), (XVar)(cNumberOfChars)));
                    valueSubstr      = XVar.Clone(MVCFunctions.runner_substr((XVar)(value), (XVar)(firstPosDecoded - qNumberOfChars), (XVar)(qNumberOfChars + MVCFunctions.runner_strlen((XVar)(searchWord)))));
                    truncSubsr       = XVar.Clone(MVCFunctions.runner_substr((XVar)(truncSubsr), new XVar(0), (XVar)(newNumberOfChars)));
                    valueSubstr      = XVar.Clone(MVCFunctions.runner_htmlspecialchars((XVar)(valueSubstr)));
                    pattern          = XVar.Clone(MVCFunctions.Concat("/(", MVCFunctions.preg_quote((XVar)(searchWordEncoded), new XVar("/")), ")/i"));
                    if (XVar.Pack(!(XVar)(haveTheSameSpChReference((XVar)(pattern), (XVar)(valueSubstr)))))
                    {
                        valueSubstr = XVar.Clone(MVCFunctions.preg_replace((XVar)(MVCFunctions.Concat(pattern, regExpModifier)), (XVar)(highlighting), (XVar)(valueSubstr)));
                    }
                    else
                    {
                        valueSubstr = XVar.Clone(highlightValueWithSpecialChars((XVar)(valueSubstr), (XVar)(MVCFunctions.Concat(pattern, regExpModifier))));
                    }
                    return(MVCFunctions.Concat(MVCFunctions.runner_htmlspecialchars((XVar)(truncSubsr)), "&nbsp;&lt;...&gt;&nbsp;", valueSubstr));
                }
                return(MVCFunctions.Concat(MVCFunctions.runner_substr((XVar)(truncatedValue), new XVar(0), (XVar)(firstPos)), highlighting));

            default:
                return(truncatedValue);
            }
            return(null);
        }
コード例 #4
0
ファイル: layout.cs プロジェクト: kurtrad/ABCVote
        public virtual XVar getCSSFiles(dynamic _param_rtl = null, dynamic _param_mobile = null, dynamic _param_pdf = null)
        {
            #region default values
            if (_param_rtl as Object == null)
            {
                _param_rtl = new XVar(false);
            }
            if (_param_mobile as Object == null)
            {
                _param_mobile = new XVar(false);
            }
            if (_param_pdf as Object == null)
            {
                _param_pdf = new XVar(false);
            }
            #endregion

            #region pass-by-value parameters
            dynamic rtl    = XVar.Clone(_param_rtl);
            dynamic mobile = XVar.Clone(_param_mobile);
            dynamic pdf    = XVar.Clone(_param_pdf);
            #endregion

            dynamic files = XVar.Array(), suffix = null;
            files  = XVar.Clone(XVar.Array());
            suffix = new XVar("");
            if (XVar.Pack(rtl))
            {
                suffix = new XVar("RTL");
            }
            if (this.version == Constants.BOOTSTRAP_LAYOUT)
            {
                files.InitAndSetArrayItem("include/bootstrap/css/bootstrap.min.css", null);
                if (XVar.Pack(MVCFunctions.strlen((XVar)(this.bootstrapTheme))))
                {
                    files.InitAndSetArrayItem(MVCFunctions.Concat("styles/bootstrap/", this.bootstrapTheme, "/css/bootstrap-theme.min.css"), null);
                }
                else
                {
                    files.InitAndSetArrayItem("include/bootstrap/css/bootstrap-theme.min.css", null);
                }
                if (XVar.Pack(pdf))
                {
                    files.InitAndSetArrayItem("styles/pdf.css", null);
                }
                files.InitAndSetArrayItem(MVCFunctions.Concat("styles/bs", suffix, ".css"), null);
                if (XVar.Pack(MVCFunctions.strlen((XVar)(this.bootstrapTheme))))
                {
                    if (XVar.Pack(MVCFunctions.file_exists((XVar)(MVCFunctions.getabspath((XVar)(MVCFunctions.Concat("styles/bootstrap/", this.bootstrapTheme, "/css/tweaks", suffix, ".css")))))))
                    {
                        files.InitAndSetArrayItem(MVCFunctions.Concat("styles/bootstrap/", this.bootstrapTheme, "/css/tweaks", suffix, ".css"), null);
                    }
                }
                if (XVar.Pack(MVCFunctions.file_exists((XVar)(MVCFunctions.getabspath(new XVar("styles/custom/custom.css"))))))
                {
                    files.InitAndSetArrayItem(MVCFunctions.Concat("styles/custom/custom", suffix, ".css"), null);
                }
                if ((XVar)(MVCFunctions.strlen((XVar)(this.customCssPageName))) && (XVar)(MVCFunctions.file_exists((XVar)(MVCFunctions.getabspath((XVar)(MVCFunctions.Concat("styles/custom/", this.customCssPageName, ".css")))))))
                {
                    files.InitAndSetArrayItem(MVCFunctions.Concat("styles/custom/", this.customCssPageName, suffix, ".css"), null);
                }
            }
            else
            {
                dynamic pageStyle = null;
                files.InitAndSetArrayItem("styles/general.css", null);
                if (this.version == 1)
                {
                    files.InitAndSetArrayItem("styles/defaultOld.css", null);
                }
                pageStyle = XVar.Clone(this.style);
                if (XVar.Pack(pdf))
                {
                    pageStyle = XVar.Clone(pdfStyle());
                }
                files.InitAndSetArrayItem(MVCFunctions.Concat("styles/", pageStyle, "/style", (XVar.Pack(rtl) ? XVar.Pack("RTL") : XVar.Pack("")), ".css"), null);
                if (this.version == 1)
                {
                    files.InitAndSetArrayItem(MVCFunctions.Concat("styles/", pageStyle, "/style", (XVar.Pack(rtl) ? XVar.Pack("RTL") : XVar.Pack("")), "Old.css"), null);
                }
                if (XVar.Pack(mobile))
                {
                    files.InitAndSetArrayItem(MVCFunctions.Concat("pagestyles/mobile/", this.name, (XVar.Pack(rtl) ? XVar.Pack("RTL") : XVar.Pack("")), ".css"), null);
                }
                else
                {
                    files.InitAndSetArrayItem(MVCFunctions.Concat("pagestyles/", this.name, (XVar.Pack(rtl) ? XVar.Pack("RTL") : XVar.Pack("")), ".css"), null);
                }
            }
            return(files);
        }
コード例 #5
0
ファイル: ViewControl.cs プロジェクト: kurtrad/ABCVote
        public virtual XVar processText(dynamic _param_value, dynamic _param_keylink)
        {
            #region pass-by-value parameters
            dynamic value   = XVar.Clone(_param_value);
            dynamic keylink = XVar.Clone(_param_keylink);
            #endregion

            dynamic cNumberOfChars = null, inlineOrFlyMode = null, isDetailPreview = null, isMobileLookup = null, isPagePrint = null, mode = null, needShortening = null, pageType = null;
            isMobileLookup  = new XVar(false);
            inlineOrFlyMode = new XVar(false);
            pageType        = XVar.Clone(this.container.pageType);
            if (XVar.Pack(!(XVar)(this.pageObject == null)))
            {
                mode            = XVar.Clone(this.pageObject.mode);
                isMobileLookup  = XVar.Clone((XVar)(mode == Constants.LIST_LOOKUP) && (XVar)(this.pageObject.mobileTemplateMode()));
                inlineOrFlyMode = XVar.Clone((XVar)((XVar)(pageType == Constants.PAGE_EDIT) && (XVar)((XVar)(mode == Constants.EDIT_INLINE) || (XVar)(mode == Constants.EDIT_POPUP))) || (XVar)((XVar)(pageType == Constants.PAGE_ADD) && (XVar)((XVar)(mode == Constants.ADD_INLINE) || (XVar)(mode == Constants.ADD_POPUP))));
            }
            isDetailPreview = XVar.Clone(this.container.isDetailsPreview);
            if ((XVar)(pageType == Constants.PAGE_ADD) || (XVar)(pageType == Constants.PAGE_EDIT))
            {
                pageType = new XVar(Constants.PAGE_VIEW);
            }
            isPagePrint = XVar.Clone((XVar)((XVar)((XVar)(pageType == Constants.PAGE_RPRINT) && (XVar)(this.container.forExport)) || (XVar)(pageType == Constants.PAGE_PRINT)) || (XVar)(pageType == Constants.PAGE_RPRINT));
            if (this.editFormat == Constants.EDIT_FORMAT_LOOKUP_WIZARD)
            {
                this.isFieldLookup             = new XVar(true);
                this.needLookupValueProcessing = XVar.Clone(checkIfLookupValueIsToProcess());
                value = XVar.Clone(processMultiselectLWValue((XVar)(value)));
            }
            cNumberOfChars = XVar.Clone(this.container.pSet.getNumberOfChars());
            needShortening = XVar.Clone(textNeedsTruncating((XVar)(value), (XVar)(cNumberOfChars)));
            if ((XVar)((XVar)((XVar)((XVar)(needShortening) && (XVar)((XVar)((XVar)(pageType == Constants.PAGE_LIST) || (XVar)(pageType == Constants.PAGE_REPORT)) || (XVar)(inlineOrFlyMode))) && (XVar)(!(XVar)(isMobileLookup))) && (XVar)(!(XVar)(isDetailPreview))) && (XVar)(keylink != XVar.Pack("")))
            {
                return(getShorteningTextAndMoreLink((XVar)(value), (XVar)(cNumberOfChars), (XVar)(keylink), (XVar)(mode)));
            }
            if ((XVar)(needShortening) && (XVar)((XVar)((XVar)(isPagePrint) || (XVar)(isMobileLookup)) || (XVar)(isDetailPreview)))
            {
                return(getShorteningText((XVar)(value), (XVar)(cNumberOfChars)));
            }
            return(getText((XVar)(value)));
        }
コード例 #6
0
        public ActionResult view()
        {
            try
            {
                dynamic keys = XVar.Array(), pageMode = null, pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                admin_users_Variables.Apply();
                CommonFunctions.add_nocache_headers();
                if (XVar.Pack(!(XVar)(ViewPage.processEditPageSecurity((XVar)(GlobalVars.strTableName)))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                {
                    TLayout t_layout = null;

                    t_layout                        = new TLayout(new XVar("view_bootstrap_2col"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version                = 3;
                    t_layout.bootstrapTheme         = "default";
                    t_layout.customCssPageName      = "admin_users_view";
                    t_layout.blocks["top"]          = XVar.Array();
                    t_layout.containers["viewpage"] = XVar.Array();
                    t_layout.containers["viewpage"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "header"));
                    t_layout.containers["header"] = XVar.Array();
                    t_layout.containers["header"].Add(new XVar("name", "viewheader", "block", "viewheader", "substyle", 1));

                    t_layout.skins["header"] = "";


                    t_layout.skins["viewpage"] = "";

                    t_layout.blocks["top"].Add("viewpage");
                    t_layout.containers["fields"] = XVar.Array();
                    t_layout.containers["fields"].Add(new XVar("name", "viewfields", "block", "", "substyle", 1));

                    t_layout.skins["fields"] = "";

                    t_layout.blocks["top"].Add("fields");
                    t_layout.containers["bottombuttons"] = XVar.Array();
                    t_layout.containers["bottombuttons"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "buttons"));
                    t_layout.containers["buttons"] = XVar.Array();
                    t_layout.containers["buttons"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "leftbuttons"));
                    t_layout.containers["leftbuttons"] = XVar.Array();
                    t_layout.containers["leftbuttons"].Add(new XVar("name", "viewbuttons", "block", "viewbuttons", "substyle", 1));

                    t_layout.skins["leftbuttons"] = "";


                    t_layout.containers["buttons"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "leftbuttons_1"));
                    t_layout.containers["leftbuttons_1"] = XVar.Array();
                    t_layout.containers["leftbuttons_1"].Add(new XVar("name", "rightviewbuttons", "block", "rightviewbuttons", "substyle", 1));

                    t_layout.skins["leftbuttons_1"] = "";


                    t_layout.skins["buttons"] = "";


                    t_layout.skins["bottombuttons"] = "";

                    t_layout.blocks["top"].Add("bottombuttons");
                    GlobalVars.page_layouts["admin_users_view"] = t_layout;
                }

                pageMode = XVar.Clone(ViewPage.readViewModeFromRequest());
                xt       = XVar.UnPackXTempl(new XTempl());
                keys     = XVar.Clone(XVar.Array());
                keys.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("editid1")), "ONI");
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(CommonFunctions.postvalue_number(new XVar("id")), "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(keys, "keys");
                var_params.InitAndSetArrayItem(pageMode, "mode");
                var_params.InitAndSetArrayItem(Constants.PAGE_VIEW, "pageType");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("page")), "pageName");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(!XVar.Equals(XVar.Pack(MVCFunctions.postvalue(new XVar("mvcPDF"))), XVar.Pack("")), "pdfMode");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("mastertable")), "masterTable");
                if (pageMode == Constants.VIEW_DASHBOARD)
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashelement")), "dashElementName");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("table")), "dashTName");
                    if (XVar.Pack(MVCFunctions.postvalue(new XVar("mapRefresh"))))
                    {
                        var_params.InitAndSetArrayItem(true, "mapRefresh");
                        var_params.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("vpCoordinates")))), "vpCoordinates");
                    }
                }
                if (pageMode == Constants.VIEW_POPUP)
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashelement")), "dashElementName");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashTName")), "dashTName");
                }
                if (XVar.Pack(var_params["masterTable"]))
                {
                    var_params.InitAndSetArrayItem(ViewPage.processMasterKeys(), "masterKeysReq");
                }
                GlobalVars.pageObject = XVar.Clone(new ViewPage((XVar)(var_params)));
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #7
0
ファイル: print.cs プロジェクト: kurtrad/ABCVote
        public ActionResult print()
        {
            try
            {
                dynamic id = null, pageObject = null, strtablename = null, var_params = XVar.Array();
                XTempl  xt;
                dbo_vwABCReportsVoteCount_Variables.Apply();
                CommonFunctions.add_nocache_headers();
                if (XVar.Pack(!(XVar)(Security.processPageSecurity((XVar)(strtablename), new XVar("P")))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                {
                    TLayout t_layout = null;

                    t_layout                          = new TLayout(new XVar("print"), new XVar("AvenueAvenue"), new XVar("MobileAvenue"));
                    t_layout.version                  = 2;
                    t_layout.blocks["center"]         = XVar.Array();
                    t_layout.containers["pageheader"] = XVar.Array();
                    t_layout.containers["pageheader"].Add(new XVar("name", "printheader", "block", "printheader", "substyle", 1));

                    t_layout.containers["pageheader"].Add(new XVar("name", "page_of_print", "block", "page_number", "substyle", 1));

                    t_layout.skins["pageheader"] = "empty";

                    t_layout.blocks["center"].Add("pageheader");
                    t_layout.containers["grid"] = XVar.Array();
                    t_layout.containers["grid"].Add(new XVar("name", "printgridnext", "block", "grid_block", "substyle", 1));

                    t_layout.skins["grid"] = "grid";

                    t_layout.blocks["center"].Add("grid");
                    t_layout.blocks["top"]     = XVar.Array();
                    t_layout.containers["pdf"] = XVar.Array();
                    t_layout.containers["pdf"].Add(new XVar("name", "printbuttons", "block", "printbuttons", "substyle", 1));

                    t_layout.skins["pdf"] = "empty";

                    t_layout.blocks["top"].Add("pdf");
                    t_layout.skins["master"] = "empty";

                    t_layout.blocks["top"].Add("master");
                    GlobalVars.page_layouts["dbo_vwABCReportsVoteCount_print"] = t_layout;

                    t_layout.skinsparams                        = XVar.Array();
                    t_layout.skinsparams["empty"]               = XVar.Array();
                    t_layout.skinsparams["empty"]["button"]     = "button2";
                    t_layout.skinsparams["menu"]                = XVar.Array();
                    t_layout.skinsparams["menu"]["button"]      = "button1";
                    t_layout.skinsparams["hmenu"]               = XVar.Array();
                    t_layout.skinsparams["hmenu"]["button"]     = "button1";
                    t_layout.skinsparams["undermenu"]           = XVar.Array();
                    t_layout.skinsparams["undermenu"]["button"] = "button1";
                    t_layout.skinsparams["fields"]              = XVar.Array();
                    t_layout.skinsparams["fields"]["button"]    = "button1";
                    t_layout.skinsparams["form"]                = XVar.Array();
                    t_layout.skinsparams["form"]["button"]      = "button1";
                    t_layout.skinsparams["1"]                   = XVar.Array();
                    t_layout.skinsparams["1"]["button"]         = "button1";
                    t_layout.skinsparams["2"]                   = XVar.Array();
                    t_layout.skinsparams["2"]["button"]         = "button1";
                    t_layout.skinsparams["3"]                   = XVar.Array();
                    t_layout.skinsparams["3"]["button"]         = "button1";
                }

                {
                    TLayout t_layout = null;

                    t_layout                          = new TLayout(new XVar("print"), new XVar("AvenueAvenue"), new XVar("MobileAvenue"));
                    t_layout.version                  = 2;
                    t_layout.blocks["center"]         = XVar.Array();
                    t_layout.containers["pageheader"] = XVar.Array();
                    t_layout.containers["pageheader"].Add(new XVar("name", "printheader", "block", "printheader", "substyle", 1));

                    t_layout.containers["pageheader"].Add(new XVar("name", "page_of_print", "block", "page_number", "substyle", 1));

                    t_layout.skins["pageheader"] = "empty";

                    t_layout.blocks["center"].Add("pageheader");
                    t_layout.containers["grid"] = XVar.Array();
                    t_layout.containers["grid"].Add(new XVar("name", "printgridnext", "block", "grid_block", "substyle", 1));

                    t_layout.skins["grid"] = "grid";

                    t_layout.blocks["center"].Add("grid");
                    t_layout.blocks["top"]     = XVar.Array();
                    t_layout.containers["pdf"] = XVar.Array();
                    t_layout.containers["pdf"].Add(new XVar("name", "printbuttons", "block", "printbuttons", "substyle", 1));

                    t_layout.skins["pdf"] = "empty";

                    t_layout.blocks["top"].Add("pdf");
                    t_layout.containers["master"] = XVar.Array();
                    t_layout.containers["master"].Add(new XVar("name", "masterinfoprint", "block", "mastertable_block", "substyle", 1));

                    t_layout.skins["master"] = "empty";

                    t_layout.blocks["top"].Add("master");
                    GlobalVars.page_layouts["dbo__ABCVotes_print"] = t_layout;

                    t_layout.skinsparams                        = XVar.Array();
                    t_layout.skinsparams["empty"]               = XVar.Array();
                    t_layout.skinsparams["empty"]["button"]     = "button2";
                    t_layout.skinsparams["menu"]                = XVar.Array();
                    t_layout.skinsparams["menu"]["button"]      = "button1";
                    t_layout.skinsparams["hmenu"]               = XVar.Array();
                    t_layout.skinsparams["hmenu"]["button"]     = "button1";
                    t_layout.skinsparams["undermenu"]           = XVar.Array();
                    t_layout.skinsparams["undermenu"]["button"] = "button1";
                    t_layout.skinsparams["fields"]              = XVar.Array();
                    t_layout.skinsparams["fields"]["button"]    = "button1";
                    t_layout.skinsparams["form"]                = XVar.Array();
                    t_layout.skinsparams["form"]["button"]      = "button1";
                    t_layout.skinsparams["1"]                   = XVar.Array();
                    t_layout.skinsparams["1"]["button"]         = "button1";
                    t_layout.skinsparams["2"]                   = XVar.Array();
                    t_layout.skinsparams["2"]["button"]         = "button1";
                    t_layout.skinsparams["3"]                   = XVar.Array();
                    t_layout.skinsparams["3"]["button"]         = "button1";
                }

                xt         = XVar.UnPackXTempl(new XTempl());
                id         = XVar.Clone(MVCFunctions.postvalue(new XVar("id")));
                id         = XVar.Clone((XVar.Pack(id != XVar.Pack("")) ? XVar.Pack(id) : XVar.Pack(1)));
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(id, "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(Constants.PAGE_PRINT, "pageType");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("selection")), "selection");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("all")), "allPagesMode");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("pdf")), "pdfMode");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("htmlPdfContent")), "pdfContent");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("width")), "pdfWidth");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("details")), "detailTables");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("records")), "splitByRecords");
                GlobalVars.pageObject = XVar.Clone(new PrintPage((XVar)(var_params)));
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #8
0
ファイル: editselectedpage.cs プロジェクト: kurtrad/ABCVote
        public override XVar getCurrentRecordInternal()
        {
            dynamic diffValues = XVar.Array(), fetchedArray = XVar.Array(), fields = XVar.Array(), rs = null, strSQLbak = null, strWhereClause = null, strWhereClauseBak = null;

            if (XVar.Pack(!(XVar)(this.cachedRecord == null)))
            {
                return(this.cachedRecord);
            }
            this.nSelected    = new XVar(0);
            strWhereClause    = XVar.Clone(getSelectedWhereClause());
            GlobalVars.strSQL = XVar.Clone(this.gQuery.gSQLWhere((XVar)(strWhereClause)));
            strSQLbak         = XVar.Clone(GlobalVars.strSQL);
            strWhereClauseBak = XVar.Clone(strWhereClause);
            if (XVar.Pack(this.eventsObject.exists(new XVar("BeforeQueryEdit"))))
            {
                this.eventsObject.BeforeQueryEdit((XVar)(GlobalVars.strSQL), ref strWhereClause, this);
            }
            if ((XVar)(strSQLbak == GlobalVars.strSQL) && (XVar)(strWhereClauseBak != strWhereClause))
            {
                dynamic keysSet = null;
                GlobalVars.strSQL = XVar.Clone(this.gQuery.gSQLWhere((XVar)(strWhereClause)));
                if (XVar.Pack(!(XVar)(keysSet)))
                {
                    dynamic orderClause = null;
                    GlobalVars.strSQL = XVar.Clone(CommonFunctions.applyDBrecordLimit((XVar)(MVCFunctions.Concat(GlobalVars.strSQL, orderClause)), new XVar(1), (XVar)(this.connection.dbType)));
                }
            }
            CommonFunctions.LogInfo((XVar)(GlobalVars.strSQL));
            fields     = XVar.Clone(getPageFields());
            rs         = XVar.Clone(this.connection.query((XVar)(GlobalVars.strSQL)));
            diffValues = XVar.Clone(XVar.Array());
            while (XVar.Pack(fetchedArray = XVar.Clone(rs.fetchAssoc())))
            {
                fetchedArray = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(fetchedArray)));
                if (XVar.Pack(!(XVar)(this.cachedRecord)))
                {
                    this.cachedRecord = XVar.Clone(fetchedArray);
                }
                else
                {
                    foreach (KeyValuePair <XVar, dynamic> f in fields.GetEnumerator())
                    {
                        dynamic editFormat = null;
                        if (this.cachedRecord[f.Value] != fetchedArray[f.Value])
                        {
                            diffValues.InitAndSetArrayItem(true, f.Value);
                        }
                    }
                }
                ++(this.nSelected);
            }
            foreach (KeyValuePair <XVar, dynamic> v in diffValues.GetEnumerator())
            {
                this.cachedRecord.Remove(v.Key);
            }
            if (this.action != "edited")
            {
                foreach (KeyValuePair <XVar, dynamic> fName in getPageFields().GetEnumerator())
                {
                    dynamic aValue = null;
                    aValue = XVar.Clone(this.pSet.getAutoUpdateValue((XVar)(fName.Value)));
                    if (!XVar.Equals(XVar.Pack(aValue), XVar.Pack("")))
                    {
                        this.cachedRecord.InitAndSetArrayItem(this.pSet.getAutoUpdateValue((XVar)(fName.Value)), fName.Value);
                    }
                }
            }
            this.cachedRecord.InitAndSetArrayItem("", "...");
            return(this.cachedRecord);
        }
コード例 #9
0
ファイル: editselectedpage.cs プロジェクト: kurtrad/ABCVote
        public override XVar processDataInput()
        {
            dynamic newRecordData = null;

            buildNewRecordData();
            if (XVar.Pack(!(XVar)(recheckUserPermissions())))
            {
                this.oldRecordData      = XVar.Clone(this.newRecordData);
                this.cachedRecord       = XVar.Clone(this.newRecordData);
                this.recordValuesToEdit = new XVar(null);
                return(false);
            }
            if (XVar.Pack(!(XVar)(checkCaptcha())))
            {
                setMessage((XVar)(this.message));
                return(false);
            }
            foreach (KeyValuePair <XVar, dynamic> value in this.newRecordData.GetEnumerator())
            {
                if (XVar.Pack(!(XVar)(this.pSet.allowDuplicateValues((XVar)(value.Key)))))
                {
                    this.errorFields.InitAndSetArrayItem(value.Key, null);
                    setMessage((XVar)(MVCFunctions.Concat(this.pSet.label((XVar)(value.Key)), " ", CommonFunctions.mlang_message(new XVar("INLINE_DENY_DUPLICATES")))));
                    return(false);
                }
            }
            newRecordData = XVar.Clone(getNewRecordCopy((XVar)(this.newRecordData)));
            foreach (KeyValuePair <XVar, dynamic> s in this.parsedSelection.GetEnumerator())
            {
                dynamic fetchedArray = null, newRecordDataTemp = null;
                newRecordDataTemp     = XVar.Clone(newRecordData);
                this.newRecordData    = XVar.Clone(getNewRecordCopy((XVar)(newRecordDataTemp)));
                this.currentWhereExpr = XVar.Clone(getSingleRecordWhereClause((XVar)(s.Value)));
                GlobalVars.strSQL     = XVar.Clone(this.gQuery.gSQLWhere((XVar)(this.currentWhereExpr)));
                CommonFunctions.LogInfo((XVar)(GlobalVars.strSQL));
                fetchedArray = XVar.Clone(this.connection.query((XVar)(GlobalVars.strSQL)).fetchAssoc());
                if (XVar.Pack(!(XVar)(fetchedArray)))
                {
                    continue;
                }
                fetchedArray = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(fetchedArray)));
                if (XVar.Pack(!(XVar)(isRecordEditable((XVar)(fetchedArray)))))
                {
                    continue;
                }
                setUpdatedLatLng((XVar)(getNewRecordData()), (XVar)(fetchedArray));
                this.oldKeys            = XVar.Clone(s.Value);
                this.recordBeingUpdated = XVar.Clone(fetchedArray);
                if (XVar.Pack(!(XVar)(callBeforeEditEvent())))
                {
                    continue;
                }
                if (XVar.Pack(callCustomEditEvent()))
                {
                    if (XVar.Pack(!(XVar)(MVCFunctions.DoUpdateRecord(this))))
                    {
                        continue;
                    }
                }
                ++(this.nUpdated);
                mergeNewRecordData();
                auditLogEdit((XVar)(s.Value));
                callAfterEditEvent();
                if (XVar.Pack(isPopupMode()))
                {
                    this.inlineReportData.InitAndSetArrayItem(getRowSaveStatusJSON((XVar)(s.Value)), this.rowIds[s.Key]);
                }
            }
            this.updatedSuccessfully = XVar.Clone(0 < this.nUpdated);
            if (XVar.Pack(!(XVar)(this.updatedSuccessfully)))
            {
                return(false);
            }
            this.messageType = new XVar(Constants.MESSAGE_INFO);
            setSuccessfulEditMessage();
            callAfterSuccessfulSave();
            return(true);
        }
コード例 #10
0
        public ActionResult export()
        {
            try
            {
                dynamic pageObject = null, strtablename = null, var_params = XVar.Array();
                XTempl  xt;
                MVCFunctions.Header("Expires", "Thu, 01 Jan 1970 00:00:01 GMT");
                Licencias_sin_goce_sueldo_Variables.Apply();
                if (XVar.Pack(!(XVar)(Security.processPageSecurity((XVar)(strtablename), new XVar("P")))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                {
                    TLayout t_layout = null;

                    t_layout                    = new TLayout(new XVar("export_bootstrap"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version            = 3;
                    t_layout.bootstrapTheme     = "default";
                    t_layout.customCssPageName  = "Licencias_sin_goce_sueldo_export";
                    t_layout.blocks["top"]      = XVar.Array();
                    t_layout.containers["page"] = XVar.Array();
                    t_layout.containers["page"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "page_1"));
                    t_layout.containers["page_1"] = XVar.Array();
                    t_layout.containers["page_1"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "panel"));
                    t_layout.containers["panel"] = XVar.Array();
                    t_layout.containers["panel"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "header"));
                    t_layout.containers["header"] = XVar.Array();
                    t_layout.containers["header"].Add(new XVar("name", "exportheader", "block", "exportheader", "substyle", 1));

                    t_layout.skins["header"] = "";


                    t_layout.containers["panel"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "body"));
                    t_layout.containers["body"] = XVar.Array();
                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "range"));
                    t_layout.containers["range"] = XVar.Array();
                    t_layout.containers["range"].Add(new XVar("name", "bsexprange", "block", "range_block", "substyle", 1));

                    t_layout.skins["range"] = "";


                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "fields"));
                    t_layout.containers["fields"] = XVar.Array();
                    t_layout.containers["fields"].Add(new XVar("name", "bsexportchoosefields", "block", "choosefields", "substyle", 1));

                    t_layout.skins["fields"] = "";


                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "fields_1"));
                    t_layout.containers["fields_1"] = XVar.Array();
                    t_layout.containers["fields_1"].Add(new XVar("name", "bsexportformat", "block", "exportformat", "substyle", 1));

                    t_layout.skins["fields_1"] = "";


                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "fields_2"));
                    t_layout.containers["fields_2"] = XVar.Array();
                    t_layout.containers["fields_2"].Add(new XVar("name", "bsexpoutput", "block", "", "substyle", 1));

                    t_layout.skins["fields_2"] = "";


                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "buttons"));
                    t_layout.containers["buttons"] = XVar.Array();
                    t_layout.containers["buttons"].Add(new XVar("name", "bsexpbuttons", "block", "exportbuttons", "substyle", 2));

                    t_layout.skins["buttons"] = "";


                    t_layout.skins["body"] = "";


                    t_layout.skins["panel"] = "";


                    t_layout.skins["page_1"] = "";


                    t_layout.skins["page"] = "";

                    t_layout.blocks["top"].Add("page");
                    GlobalVars.page_layouts["Licencias_sin_goce_sueldo_export"] = t_layout;
                }

                xt         = XVar.UnPackXTempl(new XTempl());
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(CommonFunctions.postvalue_number(new XVar("id")), "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(Constants.PAGE_EXPORT, "pageType");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("page")), "pageName");
                if ((XVar)(!(XVar)(GlobalVars.eventObj.exists(new XVar("ListGetRowCount")))) && (XVar)(!(XVar)(GlobalVars.eventObj.exists(new XVar("ListQuery")))))
                {
                    var_params.InitAndSetArrayItem(false, "needSearchClauseObj");
                }
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("exportFields")), "selectedFields");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("type")), "exportType");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("a")), "action");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("records")), "records");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("selection")), "selection");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("delimiter")), "csvDelimiter");
                if (MVCFunctions.postvalue(new XVar("txtformatting")) == "raw")
                {
                    var_params.InitAndSetArrayItem(true, "useRawValues");
                }
                var_params.InitAndSetArrayItem(ExportPage.readModeFromRequest(), "mode");
                GlobalVars.pageObject = XVar.Clone(new ExportPage((XVar)(var_params)));
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #11
0
ファイル: editselectedpage.cs プロジェクト: kurtrad/ABCVote
        protected virtual XVar getRowSaveStatusJSON(dynamic _param_keys)
        {
            #region pass-by-value parameters
            dynamic keys = XVar.Clone(_param_keys);
            #endregion

            dynamic data = XVar.Array(), dmapIconsData = null, fields = XVar.Array(), fieldsIconsData = null, i = null, keyParams = XVar.Array(), keylink = null, rawValues = XVar.Array(), returnJSON = XVar.Array(), values = XVar.Array();
            returnJSON = XVar.Clone(XVar.Array());
            if ((XVar)(this.action != "edited") || (XVar)(isSimpleMode()))
            {
                return(returnJSON);
            }
            returnJSON.InitAndSetArrayItem(MVCFunctions.array_keys((XVar)(this.newRecordData)), "fNamesSelected");
            returnJSON.InitAndSetArrayItem(getMessages(), "message");
            returnJSON.InitAndSetArrayItem(this.lockingMessageText, "lockMessage");
            if (XVar.Pack(!(XVar)(this.isCaptchaOk)))
            {
                returnJSON.InitAndSetArrayItem(getCaptchaFieldName(), "wrongCaptchaFieldName");
            }
            data = XVar.Clone(getRecordByKeys((XVar)(keys)));
            if (XVar.Pack(!(XVar)(data)))
            {
                data = XVar.Clone(this.newRecordData);
            }
            returnJSON.InitAndSetArrayItem(XVar.Array(), "detKeys");
            foreach (KeyValuePair <XVar, dynamic> dt in this.pSet.getDetailTablesArr().GetEnumerator())
            {
                dynamic dkeys = XVar.Array();
                dkeys = XVar.Clone(XVar.Array());
                foreach (KeyValuePair <XVar, dynamic> mk in dt.Value["masterKeys"].GetEnumerator())
                {
                    dkeys.InitAndSetArrayItem(data[mk.Value], MVCFunctions.Concat("masterkey", mk.Key + 1));
                }
                returnJSON.InitAndSetArrayItem(dkeys, "detKeys", dt.Value["dDataSourceTable"]);
            }
            keyParams = XVar.Clone(XVar.Array());
            foreach (KeyValuePair <XVar, dynamic> k in this.pSet.getTableKeys().GetEnumerator())
            {
                keyParams.InitAndSetArrayItem(MVCFunctions.Concat("key", k.Key + 1, "=", MVCFunctions.RawUrlDecode((XVar)(keys[k.Value]))), null);
            }
            keylink   = XVar.Clone(MVCFunctions.Concat("&", MVCFunctions.implode(new XVar("&"), (XVar)(keyParams))));
            values    = XVar.Clone(XVar.Array());
            rawValues = XVar.Clone(XVar.Array());
            fields    = XVar.Clone(this.pSet.getFieldsList());
            foreach (KeyValuePair <XVar, dynamic> f in fields.GetEnumerator())
            {
                dynamic value = null;
                value = XVar.Clone(showDBValue((XVar)(f.Value), (XVar)(data), (XVar)(keylink)));
                values.InitAndSetArrayItem(value, f.Value);
                if (XVar.Pack(CommonFunctions.IsBinaryType((XVar)(this.pSet.getFieldType((XVar)(f.Value))))))
                {
                    rawValues.InitAndSetArrayItem("", f.Value);
                }
                else
                {
                    rawValues.InitAndSetArrayItem(MVCFunctions.runner_substr((XVar)(data[f.Value]), new XVar(0), new XVar(100)), f.Value);
                }
            }
            returnJSON.InitAndSetArrayItem(this.jsKeys, "keys");
            returnJSON.InitAndSetArrayItem(getMarkerMasterKeys((XVar)(data)), "masterKeys");
            returnJSON.InitAndSetArrayItem(this.pSet.getTableKeys(), "keyFields");
            returnJSON.InitAndSetArrayItem(XVar.Array(), "oldKeys");
            i = new XVar(0);
            foreach (KeyValuePair <XVar, dynamic> value in this.oldKeys.GetEnumerator())
            {
                returnJSON.InitAndSetArrayItem(value.Value, "oldKeys", i++);
            }
            returnJSON.InitAndSetArrayItem(values, "vals");
            returnJSON.InitAndSetArrayItem(fields, "fields");
            returnJSON.InitAndSetArrayItem(rawValues, "rawVals");
            returnJSON.InitAndSetArrayItem(buildDetailGridLinks((XVar)(returnJSON["detKeys"])), "hrefs");
            if (XVar.Pack(!(XVar)(isRecordEditable(new XVar(false)))))
            {
                returnJSON.InitAndSetArrayItem(true, "nonEditable");
            }
            dmapIconsData = XVar.Clone(getDashMapsIconsData((XVar)(data)));
            if (XVar.Pack(MVCFunctions.count(dmapIconsData)))
            {
                returnJSON.InitAndSetArrayItem(dmapIconsData, "mapIconsData");
            }
            fieldsIconsData = XVar.Clone(getFieldMapIconsData((XVar)(data)));
            if (XVar.Pack(MVCFunctions.count(fieldsIconsData)))
            {
                returnJSON.InitAndSetArrayItem(fieldsIconsData, "fieldsMapIconsData");
            }
            return(returnJSON);
        }
コード例 #12
0
 public XVar lookupsuggest()
 {
     try
     {
         dynamic LookupSQL = null, LookupSQLTable = null, LookupType = null, contextParams = XVar.Array(), data = XVar.Array(), displayFieldIndex = null, displayFieldName = null, field = null, isExistParent = null, likeConditionField = null, likeField = null, likeWheres = XVar.Array(), linkAndDisplaySame = null, linkFieldIndex = null, linkFieldName = null, lookupCipherer = null, lookupConnection = null, lookupField = null, lookupIndices = XVar.Array(), lookupOrderBy = null, lookupPSet = null, lookupQueryObj = null, lookupTable = null, lwDisplayField = null, masterTable = null, pageType = null, parentCtrlsData = XVar.Array(), qResult = null, respObj = null, searchByLinkField = null, strLookupWhere = null, strUniqueOrderBy = null, table = null, value = null, values = XVar.Array(), var_response = XVar.Array();
         MVCFunctions.Header("Expires", "Thu, 01 Jan 1970 00:00:01 GMT");
         table = XVar.Clone(MVCFunctions.postvalue(new XVar("table")));
         if (XVar.Pack(!(XVar)(CommonFunctions.checkTableName((XVar)(table)))))
         {
             MVCFunctions.Echo(new XVar(0));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         Assembly.GetExecutingAssembly().GetType(MVCFunctions.Concat("runnerDotNet.", MVCFunctions.Concat("", table, ""),
                                                                     "_Variables")).InvokeMember("Apply", BindingFlags.InvokeMethod, null, null, null);
         pageType = XVar.Clone(MVCFunctions.postvalue(new XVar("pageType")));
         GlobalVars.strTableName = XVar.Clone(CommonFunctions.GetTableByShort((XVar)(table)));
         GlobalVars.cipherer     = XVar.Clone(new RunnerCipherer((XVar)(GlobalVars.strTableName)));
         GlobalVars.gSettings    = XVar.Clone(new ProjectSettings((XVar)(GlobalVars.strTableName), (XVar)(pageType)));
         field = XVar.Clone(MVCFunctions.postvalue(new XVar("searchField")));
         if (GlobalVars.gSettings.getEntityType() == Constants.titDASHBOARD)
         {
             dynamic dashFields = XVar.Array();
             dashFields = XVar.Clone(GlobalVars.gSettings.getDashboardSearchFields());
             table      = XVar.Clone(MVCFunctions.GoodFieldName((XVar)(dashFields[field][0]["table"])));
             GlobalVars.strTableName = XVar.Clone(CommonFunctions.GetTableByShort((XVar)(table)));
             field = XVar.Clone(MVCFunctions.GoodFieldName((XVar)(dashFields[field][0]["field"])));
             if (XVar.Pack(!(XVar)(CommonFunctions.checkTableName((XVar)(table)))))
             {
                 MVCFunctions.Echo(new XVar(0));
                 return(MVCFunctions.GetBuferContentAndClearBufer());
             }
             Assembly.GetExecutingAssembly().GetType(MVCFunctions.Concat("runnerDotNet.", MVCFunctions.Concat("", table, ""),
                                                                         "_Variables")).InvokeMember("Apply", BindingFlags.InvokeMethod, null, null, null);
             GlobalVars.cipherer  = XVar.Clone(new RunnerCipherer((XVar)(GlobalVars.strTableName)));
             GlobalVars.gSettings = XVar.Clone(new ProjectSettings((XVar)(GlobalVars.strTableName), (XVar)(pageType)));
         }
         masterTable = XVar.Clone(MVCFunctions.postvalue(new XVar("masterTable")));
         if ((XVar)(masterTable != XVar.Pack("")) && (XVar)(XSession.Session.KeyExists(MVCFunctions.Concat(masterTable, "_masterRecordData"))))
         {
             contextParams.InitAndSetArrayItem(XSession.Session[MVCFunctions.Concat(masterTable, "_masterRecordData")], "masterData");
         }
         contextParams.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("data")))), "data");
         RunnerContext.push((XVar)(new RunnerContextItem((XVar)(pageType), (XVar)(contextParams))));
         if (GlobalVars.strTableName != "dbo._ABCSecurity")
         {
             if (XVar.Pack(!(XVar)(CommonFunctions.isLogged())))
             {
                 return(MVCFunctions.GetBuferContentAndClearBufer());
             }
             if ((XVar)((XVar)(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Edit")))) && (XVar)(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Add"))))) && (XVar)(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Search")))))
             {
                 return(MVCFunctions.GetBuferContentAndClearBufer());
             }
         }
         else
         {
             dynamic checkResult = null;
             checkResult = new XVar(true);
             if (field == "username")
             {
                 checkResult = new XVar(false);
             }
             if (field == "password")
             {
                 checkResult = new XVar(false);
             }
             if (XVar.Pack(checkResult))
             {
                 if (XVar.Pack(!(XVar)(CommonFunctions.isLogged())))
                 {
                     return(MVCFunctions.GetBuferContentAndClearBufer());
                 }
                 if ((XVar)((XVar)(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Edit")))) && (XVar)(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Add"))))) && (XVar)(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Search")))))
                 {
                     return(MVCFunctions.GetBuferContentAndClearBufer());
                 }
             }
         }
         isExistParent     = XVar.Clone(MVCFunctions.postvalue(new XVar("isExistParent")));
         searchByLinkField = XVar.Clone(MVCFunctions.postvalue(new XVar("searchByLinkField")));
         parentCtrlsData   = XVar.Clone(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("parentCtrlsData")))));
         value             = XVar.Clone(MVCFunctions.postvalue(new XVar("searchFor")));
         values            = XVar.Clone((XVar.Pack(MVCFunctions.postvalue(new XVar("multiselection"))) ? XVar.Pack(CommonFunctions.splitvalues((XVar)(value))) : XVar.Pack(new XVar(0, value))));
         lookupField       = new XVar("");
         foreach (KeyValuePair <XVar, dynamic> f in GlobalVars.gSettings.getFieldsList().GetEnumerator())
         {
             if ((XVar)(MVCFunctions.GoodFieldName((XVar)(f.Value)) == field) && (XVar)(GlobalVars.gSettings.getEditFormat((XVar)(f.Value)) == Constants.EDIT_FORMAT_LOOKUP_WIZARD))
             {
                 LookupType = XVar.Clone(GlobalVars.gSettings.getLookupType((XVar)(f.Value)));
                 if ((XVar)(LookupType == Constants.LT_LOOKUPTABLE) || (XVar)(LookupType == Constants.LT_QUERY))
                 {
                     lookupField = XVar.Clone(f.Value);
                     break;
                 }
             }
         }
         if (XVar.Pack(!(XVar)(lookupField)))
         {
             respObj = XVar.Clone(new XVar("success", false, "data", XVar.Array()));
             MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(respObj)));
             MVCFunctions.Echo(new XVar(""));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         lookupTable        = XVar.Clone(GlobalVars.gSettings.getLookupTable((XVar)(lookupField)));
         linkFieldName      = XVar.Clone(GlobalVars.gSettings.getLinkField((XVar)(lookupField)));
         displayFieldName   = XVar.Clone(GlobalVars.gSettings.getDisplayField((XVar)(lookupField)));
         linkAndDisplaySame = XVar.Clone(displayFieldName == linkFieldName);
         if (LookupType == Constants.LT_QUERY)
         {
             lookupConnection = XVar.Clone(GlobalVars.cman.byTable((XVar)(lookupTable)));
         }
         else
         {
             dynamic connId = null;
             connId           = XVar.Clone(GlobalVars.gSettings.getNotProjectLookupTableConnId((XVar)(lookupField)));
             lookupConnection = XVar.Clone((XVar.Pack(MVCFunctions.strlen((XVar)(connId))) ? XVar.Pack(GlobalVars.cman.byId((XVar)(connId))) : XVar.Pack(GlobalVars.cman.getDefault())));
         }
         lookupOrderBy = XVar.Clone(GlobalVars.gSettings.getLookupOrderBy((XVar)(lookupField)));
         if (lookupConnection.dbType == Constants.nDATABASE_MSSQLServer)
         {
             strUniqueOrderBy = XVar.Clone(lookupOrderBy);
         }
         if (LookupType == Constants.LT_QUERY)
         {
             lookupPSet     = XVar.Clone(new ProjectSettings((XVar)(lookupTable), (XVar)(pageType)));
             lookupCipherer = XVar.Clone(new RunnerCipherer((XVar)(lookupTable)));
             lookupQueryObj = XVar.Clone(lookupPSet.getSQLQuery());
             if (XVar.Pack(GlobalVars.gSettings.getCustomDisplay((XVar)(lookupField))))
             {
                 lookupQueryObj.AddCustomExpression((XVar)(displayFieldName), (XVar)(lookupPSet), (XVar)(GlobalVars.strTableName), (XVar)(lookupField));
             }
             lookupQueryObj.ReplaceFieldsWithDummies((XVar)(lookupPSet.getBinaryFieldsIndices()));
         }
         else
         {
             dynamic lwLinkField = null;
             LookupSQLTable = new XVar("SELECT ");
             lwLinkField    = XVar.Clone(lookupConnection.addFieldWrappers((XVar)(GlobalVars.gSettings.getLinkField((XVar)(lookupField)))));
             if (XVar.Pack(GlobalVars.gSettings.isLookupUnique((XVar)(lookupField))))
             {
                 LookupSQLTable = MVCFunctions.Concat(LookupSQLTable, "DISTINCT ");
             }
             LookupSQLTable = MVCFunctions.Concat(LookupSQLTable, GlobalVars.cipherer.GetLookupFieldName((XVar)(lwLinkField), (XVar)(lookupField), new XVar(null), new XVar(true)));
             if (lookupConnection.dbType == Constants.nDATABASE_MSSQLServer)
             {
                 if ((XVar)(strUniqueOrderBy) && (XVar)(GlobalVars.gSettings.isLookupUnique((XVar)(lookupField))))
                 {
                     LookupSQLTable = MVCFunctions.Concat(LookupSQLTable, ",", lookupConnection.addFieldWrappers((XVar)(strUniqueOrderBy)));
                 }
             }
             lwDisplayField = XVar.Clone(RunnerPage.sqlFormattedDisplayField((XVar)(lookupField), (XVar)(lookupConnection), (XVar)(GlobalVars.gSettings)));
             if (XVar.Pack(!(XVar)(linkAndDisplaySame)))
             {
                 LookupSQLTable = MVCFunctions.Concat(LookupSQLTable, ",", (XVar.Pack(lwDisplayField == lwLinkField) ? XVar.Pack(GlobalVars.cipherer.GetFieldName((XVar)(lwDisplayField), (XVar)(lookupField), new XVar(true))) : XVar.Pack(lwDisplayField)));
             }
             LookupSQLTable = MVCFunctions.Concat(LookupSQLTable, " FROM ", lookupConnection.addTableWrappers((XVar)(lookupTable)), " ");
         }
         strLookupWhere = XVar.Clone(CommonFunctions.prepareLookupWhere((XVar)(lookupField), (XVar)(GlobalVars.gSettings)));
         if (LookupType == Constants.LT_QUERY)
         {
             dynamic secOpt = null;
             secOpt = XVar.Clone(lookupPSet.getAdvancedSecurityType());
             if (secOpt == Constants.ADVSECURITY_VIEW_OWN)
             {
                 strLookupWhere = XVar.Clone(CommonFunctions.whereAdd((XVar)(strLookupWhere), (XVar)(CommonFunctions.SecuritySQL(new XVar("Search"), (XVar)(lookupTable)))));
             }
         }
         if (XVar.Pack(strLookupWhere))
         {
             strLookupWhere = XVar.Clone(MVCFunctions.Concat(" (", strLookupWhere, ")  AND "));
         }
         if (LookupType == Constants.LT_QUERY)
         {
             if (XVar.Pack(GlobalVars.gSettings.getCustomDisplay((XVar)(lookupField))))
             {
                 likeField = XVar.Clone((XVar.Pack(searchByLinkField) ? XVar.Pack(linkFieldName) : XVar.Pack(displayFieldName)));
             }
             else
             {
                 likeField = XVar.Clone(RunnerPage._getFieldSQLDecrypt((XVar)((XVar.Pack(searchByLinkField) ? XVar.Pack(linkFieldName) : XVar.Pack(displayFieldName))), (XVar)(lookupConnection), (XVar)(lookupPSet), (XVar)(GlobalVars.cipherer)));
             }
         }
         else
         {
             likeField = XVar.Clone(GlobalVars.cipherer.GetFieldName((XVar)(lwDisplayField), (XVar)(lookupField)));
         }
         if (XVar.Pack(searchByLinkField))
         {
             likeConditionField = XVar.Clone((XVar.Pack(LookupType == Constants.LT_QUERY) ? XVar.Pack(linkFieldName) : XVar.Pack(lookupField)));
         }
         else
         {
             likeConditionField = XVar.Clone((XVar.Pack(LookupType == Constants.LT_QUERY) ? XVar.Pack(displayFieldName) : XVar.Pack(lookupField)));
         }
         likeWheres = XVar.Clone(XVar.Array());
         foreach (KeyValuePair <XVar, dynamic> fieldValue in values.GetEnumerator())
         {
             if (LookupType == Constants.LT_QUERY)
             {
                 likeWheres.InitAndSetArrayItem(MVCFunctions.Concat(likeField, lookupCipherer.GetLikeClause((XVar)(likeConditionField), (XVar)(fieldValue.Value))), null);
             }
             else
             {
                 likeWheres.InitAndSetArrayItem(MVCFunctions.Concat(likeField, GlobalVars.cipherer.GetLikeClause((XVar)(likeConditionField), (XVar)(fieldValue.Value))), null);
             }
         }
         strLookupWhere = MVCFunctions.Concat(strLookupWhere, MVCFunctions.implode(new XVar(" OR "), (XVar)(likeWheres)));
         if ((XVar)(isExistParent) && (XVar)(GlobalVars.gSettings.useCategory((XVar)(lookupField))))
         {
             dynamic parentWhereParts = XVar.Array();
             parentWhereParts = XVar.Clone(XVar.Array());
             foreach (KeyValuePair <XVar, dynamic> cData in GlobalVars.gSettings.getParentFieldsData((XVar)(lookupField)).GetEnumerator())
             {
                 dynamic arLookupWhere = XVar.Array(), category = null, lookupCategory = XVar.Array();
                 arLookupWhere  = XVar.Clone(XVar.Array());
                 category       = XVar.Clone(parentCtrlsData[cData.Value["main"]]);
                 lookupCategory = XVar.Clone((XVar.Pack(category == XVar.Pack("")) ? XVar.Pack(XVar.Array()) : XVar.Pack(CommonFunctions.splitvalues((XVar)(category)))));
                 foreach (KeyValuePair <XVar, dynamic> arLookupCategory in lookupCategory.GetEnumerator())
                 {
                     dynamic catField = null, cvalue = null;
                     cvalue = XVar.Clone(CommonFunctions.make_db_value((XVar)(cData.Value["main"]), (XVar)(arLookupCategory.Value)));
                     if (XVar.Pack(lookupPSet))
                     {
                         catField = XVar.Clone(RunnerPage._getFieldSQLDecrypt((XVar)(cData.Value["lookup"]), (XVar)(lookupConnection), (XVar)(lookupPSet), (XVar)(GlobalVars.cipherer)));
                     }
                     else
                     {
                         catField = XVar.Clone(lookupConnection.addFieldWrappers((XVar)(cData.Value["lookup"])));
                     }
                     arLookupWhere.InitAndSetArrayItem(MVCFunctions.Concat(catField, "=", cvalue), null);
                 }
                 if (XVar.Pack(MVCFunctions.count(arLookupWhere)))
                 {
                     parentWhereParts.InitAndSetArrayItem(MVCFunctions.Concat("(", MVCFunctions.implode(new XVar(" OR "), (XVar)(arLookupWhere)), ")"), null);
                 }
             }
             if (MVCFunctions.count(parentWhereParts) == MVCFunctions.count(GlobalVars.gSettings.getParentFieldsData((XVar)(lookupField))))
             {
                 strLookupWhere = XVar.Clone(CommonFunctions.whereAdd((XVar)(strLookupWhere), (XVar)(MVCFunctions.Concat("(", MVCFunctions.implode(new XVar(" AND "), (XVar)(parentWhereParts)), ")"))));
             }
             else
             {
                 respObj = XVar.Clone(new XVar("success", false, "data", XVar.Array()));
                 MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(respObj)));
                 MVCFunctions.Echo(new XVar(""));
                 return(MVCFunctions.GetBuferContentAndClearBufer());
             }
         }
         if (XVar.Pack(MVCFunctions.strlen((XVar)(lookupOrderBy))))
         {
             lookupOrderBy = XVar.Clone(lookupConnection.addFieldWrappers((XVar)(lookupOrderBy)));
             if (XVar.Pack(GlobalVars.gSettings.isLookupDesc((XVar)(lookupField))))
             {
                 lookupOrderBy = MVCFunctions.Concat(lookupOrderBy, " DESC");
             }
         }
         if (LookupType == Constants.LT_QUERY)
         {
             LookupSQL = XVar.Clone(lookupQueryObj.buildSQL_default((XVar)(strLookupWhere)));
             if (XVar.Pack(MVCFunctions.strlen((XVar)(lookupOrderBy))))
             {
                 LookupSQL = MVCFunctions.Concat(LookupSQL, " ORDER BY ", lookupOrderBy);
             }
         }
         else
         {
             LookupSQL = XVar.Clone(MVCFunctions.Concat(LookupSQLTable, " where ", strLookupWhere));
             if ((XVar)(!(XVar)(GlobalVars.gSettings.isLookupUnique((XVar)(lookupField)))) || (XVar)(Constants.nDATABASE_Access != lookupConnection.dbType))
             {
                 if (XVar.Pack(lookupOrderBy))
                 {
                     LookupSQL = MVCFunctions.Concat(LookupSQL, " ORDER BY ", lookupOrderBy);
                 }
             }
         }
         lookupIndices     = XVar.Clone(CommonFunctions.GetLookupFieldsIndexes((XVar)(GlobalVars.gSettings), (XVar)(lookupField)));
         linkFieldIndex    = XVar.Clone(lookupIndices["linkFieldIndex"]);
         displayFieldIndex = XVar.Clone(lookupIndices["displayFieldIndex"]);
         var_response      = XVar.Clone(XVar.Array());
         qResult           = XVar.Clone(lookupConnection.query((XVar)(LookupSQL)));
         while (XVar.Pack(data = XVar.Clone(qResult.fetchNumeric())))
         {
             if ((XVar)(LookupType == Constants.LT_QUERY) && (XVar)(GlobalVars.gSettings.isLookupUnique((XVar)(lookupField))))
             {
                 dynamic uniqueArray = XVar.Array();
                 if (XVar.Pack(!(XVar)(uniqueArray as object != null)))
                 {
                     uniqueArray = XVar.Clone(XVar.Array());
                 }
                 if (XVar.Pack(MVCFunctions.in_array((XVar)(data[displayFieldIndex]), (XVar)(uniqueArray))))
                 {
                     continue;
                 }
                 uniqueArray.InitAndSetArrayItem(data[displayFieldIndex], null);
             }
             data.InitAndSetArrayItem(GlobalVars.cipherer.DecryptField((XVar)(lookupField), (XVar)(data[linkFieldIndex])), linkFieldIndex);
             if (LookupType == Constants.LT_QUERY)
             {
                 data.InitAndSetArrayItem(GlobalVars.cipherer.DecryptField((XVar)(displayFieldName), (XVar)(data[displayFieldIndex])), displayFieldIndex);
             }
             var_response.InitAndSetArrayItem(data[linkFieldIndex], null);
             var_response.InitAndSetArrayItem(data[displayFieldIndex], null);
         }
         respObj = XVar.Clone(new XVar("success", true, "data", MVCFunctions.array_slice((XVar)(var_response), new XVar(0), new XVar(40))));
         MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(respObj)));
         MVCFunctions.Echo(new XVar(""));
         return(MVCFunctions.GetBuferContentAndClearBufer());
     }
     catch (RunnerRedirectException ex)
     { return(Redirect(ex.Message)); }
 }
コード例 #13
0
        public virtual XVar getSearchPerm(dynamic _param_tName = null)
        {
            #region default values
            if (_param_tName as Object == null)
            {
                _param_tName = new XVar("");
            }
            #endregion

            #region pass-by-value parameters
            dynamic tName = XVar.Clone(_param_tName);
            #endregion

            dynamic strPerm = null;
            tName = XVar.Clone((XVar.Pack(tName) ? XVar.Pack(tName) : XVar.Pack(this.tName)));
            if (XVar.Pack(!(XVar)(GlobalVars.isGroupSecurity)))
            {
                return(true);
            }
            strPerm = XVar.Clone(CommonFunctions.GetUserPermissions((XVar)(tName)));
            return(!XVar.Equals(XVar.Pack(MVCFunctions.strpos((XVar)(strPerm), new XVar("S"))), XVar.Pack(false)));
        }
コード例 #14
0
        public ActionResult edit()
        {
            try
            {
                dynamic id = null, keys = XVar.Array(), pageMode = null, pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                VISTOBUENO_JEFEINMEDIATO_Variables.Apply();
                CommonFunctions.add_nocache_headers();
                if (XVar.Pack(!(XVar)(EditPage.processEditPageSecurity((XVar)(GlobalVars.strTableName)))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                EditPage.handleBrokenRequest();
                {
                    TLayout t_layout = null;

                    t_layout                        = new TLayout(new XVar("edit_bootstrap"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version                = 3;
                    t_layout.bootstrapTheme         = "default";
                    t_layout.customCssPageName      = "VISTOBUENO_JEFEINMEDIATO_edit";
                    t_layout.blocks["top"]          = XVar.Array();
                    t_layout.containers["editpage"] = XVar.Array();
                    t_layout.containers["editpage"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "header"));
                    t_layout.containers["header"] = XVar.Array();
                    t_layout.containers["header"].Add(new XVar("name", "editheader", "block", "editheader", "substyle", 1));

                    t_layout.skins["header"] = "";


                    t_layout.containers["editpage"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "message"));
                    t_layout.containers["message"] = XVar.Array();
                    t_layout.containers["message"].Add(new XVar("name", "message", "block", "message_block", "substyle", 1));

                    t_layout.skins["message"] = "";


                    t_layout.containers["editpage"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "steps"));
                    t_layout.containers["steps"] = XVar.Array();
                    t_layout.containers["steps"].Add(new XVar("name", "multistep_nav_edit", "block", "", "substyle", 1));

                    t_layout.skins["steps"] = "";


                    t_layout.skins["editpage"] = "";

                    t_layout.blocks["top"].Add("editpage");
                    t_layout.containers["fields"] = XVar.Array();
                    t_layout.containers["fields"].Add(new XVar("name", "editfields", "block", "", "substyle", 1));

                    t_layout.skins["fields"] = "";

                    t_layout.blocks["top"].Add("fields");
                    t_layout.containers["bottombuttons"] = XVar.Array();
                    t_layout.containers["bottombuttons"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "buttons"));
                    t_layout.containers["buttons"] = XVar.Array();
                    t_layout.containers["buttons"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "leftbuttons"));
                    t_layout.containers["leftbuttons"] = XVar.Array();
                    t_layout.containers["leftbuttons"].Add(new XVar("name", "editbuttons", "block", "editbuttons", "substyle", 1));

                    t_layout.skins["leftbuttons"] = "";


                    t_layout.containers["buttons"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "leftbuttons_1"));
                    t_layout.containers["leftbuttons_1"] = XVar.Array();
                    t_layout.containers["leftbuttons_1"].Add(new XVar("name", "righteditbuttons", "block", "righteditbuttons", "substyle", 1));

                    t_layout.skins["leftbuttons_1"] = "";


                    t_layout.skins["buttons"] = "";


                    t_layout.skins["bottombuttons"] = "";

                    t_layout.blocks["top"].Add("bottombuttons");
                    GlobalVars.page_layouts["VISTOBUENO_JEFEINMEDIATO_edit"] = t_layout;
                }

                {
                    TLayout t_layout = null;

                    t_layout                            = new TLayout(new XVar("list_bootstrap1"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version                    = 3;
                    t_layout.bootstrapTheme             = "default";
                    t_layout.customCssPageName          = "VISTOBUENO_JEFEINMEDIATO_list";
                    t_layout.blocks["center"]           = XVar.Array();
                    t_layout.containers["gridcontrols"] = XVar.Array();
                    t_layout.containers["gridcontrols"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "add_delete"));
                    t_layout.containers["add_delete"] = XVar.Array();
                    t_layout.containers["add_delete"].Add(new XVar("name", "add", "block", "newrecord_controls_block", "substyle", 1));

                    t_layout.containers["add_delete"].Add(new XVar("name", "recordcontrol", "block", "record_controls_block", "substyle", 1));

                    t_layout.skins["add_delete"] = "";


                    t_layout.containers["gridcontrols"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "gridinfo"));
                    t_layout.containers["gridinfo"] = XVar.Array();
                    t_layout.containers["gridinfo"].Add(new XVar("name", "details_found", "block", "details_found", "substyle", 1));

                    t_layout.containers["gridinfo"].Add(new XVar("name", "printpanel", "block", "print_friendly", "substyle", 1));

                    t_layout.containers["gridinfo"].Add(new XVar("name", "bsfieldhidepanel", "block", "field_hide_panel", "substyle", 1));

                    t_layout.skins["gridinfo"] = "";


                    t_layout.containers["gridcontrols"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "gridinfo_sort"));
                    t_layout.containers["gridinfo_sort"] = XVar.Array();
                    t_layout.containers["gridinfo_sort"].Add(new XVar("name", "reorder_records", "block", "reorder_records", "substyle", 1));

                    t_layout.skins["gridinfo_sort"] = "";


                    t_layout.skins["gridcontrols"] = "";

                    t_layout.blocks["center"].Add("gridcontrols");
                    t_layout.containers["tabs"] = XVar.Array();
                    t_layout.containers["tabs"].Add(new XVar("name", "bsgrid_tabs", "block", "grid_tabs", "substyle", 1));

                    t_layout.skins["tabs"] = "";

                    t_layout.blocks["center"].Add("tabs");
                    t_layout.containers["messagerow"] = XVar.Array();
                    t_layout.containers["messagerow"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "message"));
                    t_layout.containers["message"] = XVar.Array();
                    t_layout.containers["message"].Add(new XVar("name", "message", "block", "message_block", "substyle", 1));

                    t_layout.skins["message"] = "";


                    t_layout.skins["messagerow"] = "";

                    t_layout.blocks["center"].Add("messagerow");
                    t_layout.containers["center"] = XVar.Array();
                    t_layout.containers["center"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "grid"));
                    t_layout.containers["grid"] = XVar.Array();
                    t_layout.containers["grid"].Add(new XVar("name", "grid", "block", "grid_block", "substyle", 1));

                    t_layout.skins["grid"] = "";


                    t_layout.skins["center"] = "";

                    t_layout.blocks["center"].Add("center");
                    t_layout.containers["pagination"] = XVar.Array();
                    t_layout.containers["pagination"].Add(new XVar("name", "pagination", "block", "pagination_block", "substyle", 1));

                    t_layout.skins["pagination"] = "";

                    t_layout.blocks["center"].Add("pagination");
                    t_layout.blocks["left"]     = XVar.Array();
                    t_layout.containers["left"] = XVar.Array();
                    t_layout.containers["left"].Add(new XVar("name", "searchpanel", "block", "searchPanel", "substyle", 1));

                    t_layout.containers["left"].Add(new XVar("name", "filterpanel", "block", "filterPanel", "substyle", 1));

                    t_layout.skins["left"] = "";

                    t_layout.blocks["left"].Add("left");
                    t_layout.blocks["top"]      = XVar.Array();
                    t_layout.containers["menu"] = XVar.Array();
                    t_layout.containers["menu"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "hdr"));
                    t_layout.containers["hdr"] = XVar.Array();
                    t_layout.containers["hdr"].Add(new XVar("name", "logo", "block", "logo_block", "substyle", 1));

                    t_layout.containers["hdr"].Add(new XVar("name", "bsnavbarcollapse", "block", "collapse_block", "substyle", 1));

                    t_layout.skins["hdr"] = "";


                    t_layout.containers["menu"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "menu_1"));
                    t_layout.containers["menu_1"] = XVar.Array();
                    t_layout.containers["menu_1"].Add(new XVar("name", "hmenu", "block", "menu_block", "substyle", 1));

                    t_layout.containers["menu_1"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "more"));
                    t_layout.containers["more"] = XVar.Array();
                    t_layout.containers["more"].Add(new XVar("name", "morebutton", "block", "more_list", "substyle", 1));

                    t_layout.containers["more"].Add(new XVar("name", "loggedas", "block", "security_block", "substyle", 1));

                    t_layout.skins["more"] = "";


                    t_layout.containers["menu_1"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "more_1"));
                    t_layout.containers["more_1"] = XVar.Array();
                    t_layout.containers["more_1"].Add(new XVar("name", "search", "block", "searchform_block", "substyle", 1));

                    t_layout.skins["more_1"] = "";


                    t_layout.skins["menu_1"] = "";


                    t_layout.skins["menu"] = "";

                    t_layout.blocks["top"].Add("menu");
                    t_layout.blocks["topmiddle"]       = XVar.Array();
                    t_layout.containers["breadcrumbs"] = XVar.Array();
                    t_layout.containers["breadcrumbs"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "bc"));
                    t_layout.containers["bc"] = XVar.Array();
                    t_layout.containers["bc"].Add(new XVar("name", "breadcrumbs", "block", "breadcrumbs", "substyle", 1));

                    t_layout.skins["bc"] = "";


                    t_layout.skins["breadcrumbs"] = "";

                    t_layout.blocks["topmiddle"].Add("breadcrumbs");
                    t_layout.containers["masterinfo"] = XVar.Array();
                    t_layout.containers["masterinfo"].Add(new XVar("name", "masterinfo", "block", "mastertable_block", "substyle", 1));

                    t_layout.skins["masterinfo"] = "";

                    t_layout.blocks["topmiddle"].Add("masterinfo");
                    GlobalVars.page_layouts["VISTOBUENO_JEFEINMEDIATO_list"] = t_layout;
                }

                pageMode = XVar.Clone(EditPage.readEditModeFromRequest());
                xt       = XVar.UnPackXTempl(new XTempl());
                id       = XVar.Clone(CommonFunctions.postvalue_number(new XVar("id")));
                id       = XVar.Clone((XVar.Pack(MVCFunctions.intval((XVar)(id)) == 0) ? XVar.Pack(1) : XVar.Pack(id)));
                keys     = XVar.Clone(XVar.Array());
                keys.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("editid1")), "id_permisos");
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(id, "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(keys, "keys");
                var_params.InitAndSetArrayItem(pageMode, "mode");
                var_params.InitAndSetArrayItem(Constants.PAGE_EDIT, "pageType");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("page")), "pageName");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("a")), "action");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("fields")), "selectedFields");


                var_params.InitAndSetArrayItem("captcha_1209xre", "captchaName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue((XVar)(MVCFunctions.Concat("value_captcha_1209xre_", id))), "captchaValue");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("selection")), "selection");
                var_params.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("rowIds")))), "rowIds");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("mastertable")), "masterTable");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("action")), "lockingAction");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("sid")), "lockingSid");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("keys")), "lockingKeys");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("startEdit")), "lockingStart");
                if (pageMode == Constants.EDIT_INLINE)
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("screenWidth")), "screenWidth");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("screenHeight")), "screenHeight");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("orientation")), "orientation");
                }
                if (pageMode == Constants.EDIT_DASHBOARD)
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashelement")), "dashElementName");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("table")), "dashTName");
                    if (XVar.Pack(MVCFunctions.postvalue(new XVar("mapRefresh"))))
                    {
                        var_params.InitAndSetArrayItem(true, "mapRefresh");
                        var_params.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("vpCoordinates")))), "vpCoordinates");
                    }
                }
                if ((XVar)((XVar)(pageMode == Constants.EDIT_POPUP) || (XVar)(pageMode == Constants.EDIT_INLINE)) && (XVar)(MVCFunctions.postvalue(new XVar("dashTName"))))
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashTName")), "dashTName");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashelement")), "dashElementName");
                }
                if (XVar.Pack(var_params["masterTable"]))
                {
                    var_params.InitAndSetArrayItem(EditPage.processMasterKeys(), "masterKeysReq");
                }
                GlobalVars.pageObject = XVar.Clone(EditPage.EditPageFactory((XVar)(var_params)));
                if (XVar.Pack(GlobalVars.pageObject.isLockingRequest()))
                {
                    GlobalVars.pageObject.doLockingAction();
                    MVCFunctions.Echo(new XVar(""));
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #15
0
ファイル: exportpage.cs プロジェクト: kurtrad/ABCVote
        protected virtual XVar WriteTableData(dynamic _param_rs, dynamic _param_nPageSize)
        {
            #region pass-by-value parameters
            dynamic rs        = XVar.Clone(_param_rs);
            dynamic nPageSize = XVar.Clone(_param_nPageSize);
            #endregion

            dynamic eventRes = null, fType = null, iNumberOfRows = null, row = null, totalFieldsData = XVar.Array(), totals = XVar.Array(), totalsFields = XVar.Array(), values = XVar.Array();
            totalFieldsData = XVar.Clone(this.pSet.getTotalsFields());
            if (XVar.Pack(this.eventsObject.exists(new XVar("ListFetchArray"))))
            {
                row = XVar.Clone(this.eventsObject.ListFetchArray((XVar)(rs), this));
            }
            else
            {
                row = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(this.connection.fetch_array((XVar)(rs)))));
            }
            MVCFunctions.Echo("<tr>");
            if (this.exportType == "excel")
            {
                foreach (KeyValuePair <XVar, dynamic> field in this.selectedFields.GetEnumerator())
                {
                    MVCFunctions.Echo(MVCFunctions.Concat("<td style=\"width: 100\" x:str>", CommonFunctions.PrepareForExcel((XVar)(this.pSet.label((XVar)(field.Value)))), "</td>"));
                }
            }
            else
            {
                foreach (KeyValuePair <XVar, dynamic> field in this.selectedFields.GetEnumerator())
                {
                    MVCFunctions.Echo(MVCFunctions.Concat("<td>", this.pSet.label((XVar)(field.Value)), "</td>"));
                }
            }
            MVCFunctions.Echo("</tr>");
            totals       = XVar.Clone(XVar.Array());
            totalsFields = XVar.Clone(XVar.Array());
            foreach (KeyValuePair <XVar, dynamic> data in totalFieldsData.GetEnumerator())
            {
                if (XVar.Pack(!(XVar)(MVCFunctions.in_array((XVar)(data.Value["fName"]), (XVar)(this.selectedFields)))))
                {
                    continue;
                }
                totals.InitAndSetArrayItem(new XVar("value", 0, "numRows", 0), data.Value["fName"]);
                totalsFields.InitAndSetArrayItem(new XVar("fName", data.Value["fName"], "totalsType", data.Value["totalsType"], "viewFormat", this.pSet.getViewFormat((XVar)(data.Value["fName"]))), null);
            }
            iNumberOfRows = new XVar(0);
            this.viewControls.setForExportVar(new XVar("export"));
            while ((XVar)((XVar)(!(XVar)(nPageSize)) || (XVar)(iNumberOfRows < nPageSize)) && (XVar)(row))
            {
                CommonFunctions.countTotals((XVar)(totals), (XVar)(totalsFields), (XVar)(row));
                values = XVar.Clone(XVar.Array());
                foreach (KeyValuePair <XVar, dynamic> field in this.selectedFields.GetEnumerator())
                {
                    fType = XVar.Clone(this.pSet.getFieldType((XVar)(field.Value)));
                    if (XVar.Pack(CommonFunctions.IsBinaryType((XVar)(fType))))
                    {
                        values.InitAndSetArrayItem("LONG BINARY DATA - CANNOT BE DISPLAYED", field.Value);
                    }
                    else
                    {
                        values.InitAndSetArrayItem(getFormattedFieldValue((XVar)(field.Value), (XVar)(row)), field.Value);
                    }
                }
                eventRes = new XVar(true);
                if (XVar.Pack(this.eventsObject.exists(new XVar("BeforeOut"))))
                {
                    eventRes = XVar.Clone(this.eventsObject.BeforeOut((XVar)(row), (XVar)(values), this));
                }
                if (XVar.Pack(eventRes))
                {
                    iNumberOfRows++;
                    MVCFunctions.Echo("<tr>");
                    foreach (KeyValuePair <XVar, dynamic> field in this.selectedFields.GetEnumerator())
                    {
                        dynamic editFormat = null;
                        fType = XVar.Clone(this.pSet.getFieldType((XVar)(field.Value)));
                        if (XVar.Pack(CommonFunctions.IsCharType((XVar)(fType))))
                        {
                            if (this.exportType == "excel")
                            {
                                MVCFunctions.Echo("<td x:str>");
                            }
                            else
                            {
                                MVCFunctions.Echo("<td>");
                            }
                        }
                        else
                        {
                            MVCFunctions.Echo("<td>");
                        }
                        editFormat = XVar.Clone(this.pSet.getEditFormat((XVar)(field.Value)));
                        if (editFormat == Constants.EDIT_FORMAT_LOOKUP_WIZARD)
                        {
                            if (XVar.Pack(this.pSet.NeedEncode((XVar)(field.Value))))
                            {
                                if (this.exportType == "excel")
                                {
                                    MVCFunctions.Echo(CommonFunctions.PrepareForExcel((XVar)(values[field.Value])));
                                }
                                else
                                {
                                    MVCFunctions.Echo(values[field.Value]);
                                }
                            }
                            else
                            {
                                MVCFunctions.Echo(values[field.Value]);
                            }
                        }
                        else
                        {
                            if (XVar.Pack(CommonFunctions.IsBinaryType((XVar)(fType))))
                            {
                                MVCFunctions.Echo(values[field.Value]);
                            }
                            else
                            {
                                if ((XVar)(editFormat == Constants.FORMAT_CUSTOM) || (XVar)(this.pSet.isUseRTE((XVar)(field.Value))))
                                {
                                    MVCFunctions.Echo(values[field.Value]);
                                }
                                else
                                {
                                    if (XVar.Pack(CommonFunctions.NeedQuotes((XVar)(field.Value))))
                                    {
                                        if (this.exportType == "excel")
                                        {
                                            MVCFunctions.Echo(CommonFunctions.PrepareForExcel((XVar)(values[field.Value])));
                                        }
                                        else
                                        {
                                            MVCFunctions.Echo(values[field.Value]);
                                        }
                                    }
                                    else
                                    {
                                        MVCFunctions.Echo(values[field.Value]);
                                    }
                                }
                            }
                        }
                        MVCFunctions.Echo("</td>");
                    }
                    MVCFunctions.Echo("</tr>");
                }
                if (XVar.Pack(this.eventsObject.exists(new XVar("ListFetchArray"))))
                {
                    row = XVar.Clone(this.eventsObject.ListFetchArray((XVar)(rs), this));
                }
                else
                {
                    row = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(this.connection.fetch_array((XVar)(rs)))));
                }
            }
            if (XVar.Pack(MVCFunctions.count(totalFieldsData)))
            {
                MVCFunctions.Echo("<tr>");
                foreach (KeyValuePair <XVar, dynamic> data in totalFieldsData.GetEnumerator())
                {
                    if (XVar.Pack(!(XVar)(MVCFunctions.in_array((XVar)(data.Value["fName"]), (XVar)(this.selectedFields)))))
                    {
                        continue;
                    }
                    MVCFunctions.Echo("<td>");
                    if (XVar.Pack(MVCFunctions.strlen((XVar)(data.Value["totalsType"]))))
                    {
                        if (data.Value["totalsType"] == "COUNT")
                        {
                            MVCFunctions.Echo(MVCFunctions.Concat("Count", ": "));
                        }
                        else
                        {
                            if (data.Value["totalsType"] == "TOTAL")
                            {
                                MVCFunctions.Echo(MVCFunctions.Concat("Total", ": "));
                            }
                            else
                            {
                                if (data.Value["totalsType"] == "AVERAGE")
                                {
                                    MVCFunctions.Echo(MVCFunctions.Concat("Average", ": "));
                                }
                            }
                        }
                        MVCFunctions.Echo(MVCFunctions.runner_htmlspecialchars((XVar)(CommonFunctions.GetTotals((XVar)(data.Value["fName"]), (XVar)(totals[data.Value["fName"]]["value"]), (XVar)(data.Value["totalsType"]), (XVar)(totals[data.Value["fName"]]["numRows"]), (XVar)(this.pSet.getViewFormat((XVar)(data.Value["fName"]))), new XVar(Constants.PAGE_EXPORT), (XVar)(this.pSet)))));
                    }
                    MVCFunctions.Echo("</td>");
                }
                MVCFunctions.Echo("</tr>");
            }
            return(null);
        }
コード例 #16
0
        public ActionResult import()
        {
            try
            {
                dynamic id = null, pageObject = null, strtablename = null, var_params = XVar.Array();
                XTempl  xt;
                MVCFunctions.Header("Expires", "Thu, 01 Jan 1970 00:00:01 GMT");
                Server.ScriptTimeout = 600;
                dbo_ESTADO_PERSONALES_Variables.Apply();
                if (XVar.Pack(!(XVar)(Security.processPageSecurity((XVar)(strtablename), new XVar("I")))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                {
                    TLayout t_layout = null;

                    t_layout                    = new TLayout(new XVar("import_bootstrap"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version            = 3;
                    t_layout.bootstrapTheme     = "default";
                    t_layout.customCssPageName  = "dbo_ESTADO_PERSONALES_import";
                    t_layout.blocks["top"]      = XVar.Array();
                    t_layout.containers["page"] = XVar.Array();
                    t_layout.containers["page"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "panel"));
                    t_layout.containers["panel"] = XVar.Array();
                    t_layout.containers["panel"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "header"));
                    t_layout.containers["header"] = XVar.Array();
                    t_layout.containers["header"].Add(new XVar("name", "importheader", "block", "", "substyle", 1));

                    t_layout.skins["header"] = "";


                    t_layout.containers["panel"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "body"));
                    t_layout.containers["body"] = XVar.Array();
                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "message"));
                    t_layout.containers["message"] = XVar.Array();
                    t_layout.containers["message"].Add(new XVar("name", "errormessage", "block", "", "substyle", 1));

                    t_layout.skins["message"] = "";


                    t_layout.containers["body"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "import"));
                    t_layout.containers["import"] = XVar.Array();
                    t_layout.containers["import"].Add(new XVar("name", "importheader_text", "block", "", "substyle", 1));

                    t_layout.containers["import"].Add(new XVar("name", "importfields", "block", "", "substyle", 1));

                    t_layout.containers["import"].Add(new XVar("name", "import_rawtext_control", "block", "", "substyle", 1));

                    t_layout.containers["import"].Add(new XVar("name", "import_preview", "block", "", "substyle", 1));

                    t_layout.containers["import"].Add(new XVar("name", "import_process", "block", "", "substyle", 1));

                    t_layout.containers["import"].Add(new XVar("name", "import_results", "block", "", "substyle", 1));

                    t_layout.containers["import"].Add(new XVar("name", "importbuttons", "block", "", "substyle", 1));

                    t_layout.skins["import"] = "";


                    t_layout.skins["body"] = "";


                    t_layout.skins["panel"] = "";


                    t_layout.skins["page"] = "";

                    t_layout.blocks["top"].Add("page");
                    GlobalVars.page_layouts["dbo_ESTADO_PERSONALES_import"] = t_layout;
                }

                xt         = XVar.UnPackXTempl(new XTempl());
                id         = XVar.Clone(CommonFunctions.postvalue_number(new XVar("id")));
                id         = XVar.Clone((XVar.Pack(id != XVar.Pack("")) ? XVar.Pack(id) : XVar.Pack(1)));
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(id, "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("a")), "action");
                var_params.InitAndSetArrayItem(Constants.PAGE_IMPORT, "pageType");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("page")), "pageName");
                var_params.InitAndSetArrayItem(false, "needSearchClauseObj");
                var_params.InitAndSetArrayItem(GlobalVars.strOriginalTableName, "strOriginalTableName");
                if (var_params["action"] == "importPreview")
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("importType")), "importType");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("importText")), "importText");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("useXHR")), "useXHR");
                }
                else
                {
                    if (var_params["action"] == "importData")
                    {
                        var_params.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("importData")))), "importData");
                    }
                }
                GlobalVars.pageObject = XVar.Clone(new ImportPage((XVar)(var_params)));
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #17
0
        public ActionResult print()
        {
            try
            {
                dynamic pageObject = null, strtablename = null, var_params = XVar.Array();
                XTempl  xt;
                CommonFunctions.add_nocache_headers();
                VER_COMPESADOS_Variables.Apply();
                if (XVar.Pack(!(XVar)(Security.processPageSecurity((XVar)(strtablename), new XVar("P")))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                {
                    TLayout t_layout = null;

                    t_layout                   = new TLayout(new XVar("print_bootstrap"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version           = 3;
                    t_layout.bootstrapTheme    = "default";
                    t_layout.customCssPageName = "VER_COMPESADOS_print";
                    t_layout.blocks["top"]     = XVar.Array();
                    t_layout.containers["pdf"] = XVar.Array();
                    t_layout.containers["pdf"].Add(new XVar("name", "printbuttons", "block", "printbuttons", "substyle", 1));

                    t_layout.skins["pdf"] = "";

                    t_layout.blocks["top"].Add("pdf");
                    t_layout.containers["master"] = XVar.Array();
                    t_layout.containers["master"].Add(new XVar("name", "masterinfo", "block", "mastertable_block", "substyle", 1));

                    t_layout.skins["master"] = "";

                    t_layout.blocks["top"].Add("master");
                    t_layout.containers["pageheader"] = XVar.Array();
                    t_layout.containers["pageheader"].Add(new XVar("name", "printheader", "block", "printheader", "substyle", 1));

                    t_layout.containers["pageheader"].Add(new XVar("name", "page_of_print", "block", "page_number", "substyle", 1));

                    t_layout.skins["pageheader"] = "";

                    t_layout.blocks["top"].Add("pageheader");
                    t_layout.containers["grid"] = XVar.Array();
                    t_layout.containers["grid"].Add(new XVar("name", "printgrid", "block", "grid_block", "substyle", 1));

                    t_layout.skins["grid"] = "";

                    t_layout.blocks["top"].Add("grid");
                    GlobalVars.page_layouts["VER_COMPESADOS_print"] = t_layout;
                }

                xt         = XVar.UnPackXTempl(new XTempl());
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(CommonFunctions.postvalue_number(new XVar("id")), "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(Constants.PAGE_PRINT, "pageType");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("page")), "pageName");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("selection")), "selection");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("all")), "allPagesMode");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("details")), "detailTables");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("records")), "splitByRecords");
                var_params.InitAndSetArrayItem((XVar.Pack(MVCFunctions.postvalue(new XVar("pdfjson"))) ? XVar.Pack(Constants.PRINT_PDFJSON) : XVar.Pack(Constants.PRINT_SIMPLE)), "mode");
                GlobalVars.pageObject = XVar.Clone(new PrintPage((XVar)(var_params)));
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #18
0
 public virtual XVar assignPDFFormatSettings()
 {
     if (XVar.Pack(this.exportPdf))
     {
         this.jsSettings.InitAndSetArrayItem(1, "tableSettings", this.tName, "exportPdf");
     }
     if (XVar.Pack(!(XVar)(this.pdfMode)))
     {
         return(null);
     }
     this.landscape    = XVar.Clone(this.pSet.isLandscapePrinterPagePDFOrientation());
     this.pdfFitToPage = XVar.Clone((XVar.Pack(this.crossTable) ? XVar.Pack(1) : XVar.Pack(this.pSet.isPrinterPagePDFFitToPage())));
     this.pageWidth    = new XVar(Constants.PDF_PAGE_WIDTH);
     this.pageHeight   = new XVar(Constants.PDF_PAGE_HEIGHT);
     if (XVar.Pack(!(XVar)(this.pdfFitToPage)))
     {
         dynamic PrinterPagePDFScale = null;
         PrinterPagePDFScale = XVar.Clone(this.pSet.getPrinterPagePDFScale());
         this.pageWidth      = XVar.Clone((this.pageWidth * 100) / PrinterPagePDFScale);
         this.pageHeight     = XVar.Clone((this.pageHeight * 100) / PrinterPagePDFScale);
     }
     this.jsSettings.InitAndSetArrayItem(this.pSet.isLandscapePrinterPagePDFOrientation(), "tableSettings", this.tName, "pdfPrinterPageOrientation");
     this.jsSettings.InitAndSetArrayItem(this.landscape, "tableSettings", this.tName, "printerPageOrientation");
     this.jsSettings.InitAndSetArrayItem(1, "tableSettings", this.tName, "createPdf");
     this.jsSettings.InitAndSetArrayItem(this.pdfFitToPage, "tableSettings", this.tName, "pdfFitToPage");
     if (XVar.Pack(this.landscape))
     {
         dynamic temp = null;
         temp            = XVar.Clone(this.pageWidth);
         this.pageWidth  = XVar.Clone(this.pageHeight);
         this.pageHeight = XVar.Clone(temp);
     }
     this.jsSettings.InitAndSetArrayItem(this.pageWidth, "tableSettings", this.tName, "pageWidth");
     this.jsSettings.InitAndSetArrayItem(this.pageHeight, "tableSettings", this.tName, "pageHeight");
     return(null);
 }
コード例 #19
0
ファイル: search.cs プロジェクト: kurtrad/ABCVote
        public ActionResult search()
        {
            try
            {
                dynamic accessGranted = null, chrt_array = XVar.Array(), cname = null, id = null, layoutVersion = null, mode = null, pageObject = null, rname = null, templatefile = null, var_params = XVar.Array();
                XTempl  xt;
                ABC_Voting_Recirculated1_Variables.Apply();
                CommonFunctions.add_nocache_headers();
                Security.processLogoutRequest();
                if (XVar.Pack(!(XVar)(CommonFunctions.isLogged())))
                {
                    Security.saveRedirectURL();
                    CommonFunctions.redirectToLogin();
                }
                cname         = XVar.Clone(MVCFunctions.postvalue(new XVar("cname")));
                rname         = XVar.Clone(MVCFunctions.postvalue(new XVar("rname")));
                accessGranted = XVar.Clone(CommonFunctions.CheckTablePermissions((XVar)(GlobalVars.strTableName), new XVar("S")));
                if (XVar.Pack(!(XVar)(accessGranted)))
                {
                    MVCFunctions.HeaderRedirect(new XVar("menu"));
                }
                {
                    TLayout t_layout = null;

                    t_layout                      = new TLayout(new XVar("search2"), new XVar("AvenueAvenue"), new XVar("MobileAvenue"));
                    t_layout.version              = 2;
                    t_layout.blocks["top"]        = XVar.Array();
                    t_layout.containers["search"] = XVar.Array();
                    t_layout.containers["search"].Add(new XVar("name", "srchheader", "block", "searchheader", "substyle", 2));

                    t_layout.containers["search"].Add(new XVar("name", "srchconditions", "block", "conditions_block", "substyle", 1));

                    t_layout.containers["search"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "fields"));
                    t_layout.containers["fields"] = XVar.Array();
                    t_layout.containers["fields"].Add(new XVar("name", "srchfields", "block", "", "substyle", 1));

                    t_layout.containers["fields"].Add(new XVar("name", "srchbuttons", "block", "searchbuttons", "substyle", 2));

                    t_layout.skins["fields"] = "fields";


                    t_layout.skins["search"] = "1";

                    t_layout.blocks["top"].Add("search");
                    GlobalVars.page_layouts["ABC_Voting_Recirculated1_search"] = t_layout;

                    t_layout.skinsparams                        = XVar.Array();
                    t_layout.skinsparams["empty"]               = XVar.Array();
                    t_layout.skinsparams["empty"]["button"]     = "button2";
                    t_layout.skinsparams["menu"]                = XVar.Array();
                    t_layout.skinsparams["menu"]["button"]      = "button1";
                    t_layout.skinsparams["hmenu"]               = XVar.Array();
                    t_layout.skinsparams["hmenu"]["button"]     = "button1";
                    t_layout.skinsparams["undermenu"]           = XVar.Array();
                    t_layout.skinsparams["undermenu"]["button"] = "button1";
                    t_layout.skinsparams["fields"]              = XVar.Array();
                    t_layout.skinsparams["fields"]["button"]    = "button1";
                    t_layout.skinsparams["form"]                = XVar.Array();
                    t_layout.skinsparams["form"]["button"]      = "button1";
                    t_layout.skinsparams["1"]                   = XVar.Array();
                    t_layout.skinsparams["1"]["button"]         = "button1";
                    t_layout.skinsparams["2"]                   = XVar.Array();
                    t_layout.skinsparams["2"]["button"]         = "button1";
                    t_layout.skinsparams["3"]                   = XVar.Array();
                    t_layout.skinsparams["3"]["button"]         = "button1";
                }

                xt   = XVar.UnPackXTempl(new XTempl());
                id   = XVar.Clone(MVCFunctions.postvalue(new XVar("id")));
                id   = XVar.Clone((XVar.Pack(id) ? XVar.Pack(id) : XVar.Pack(1)));
                mode = new XVar(Constants.SEARCH_SIMPLE);
                if (MVCFunctions.postvalue(new XVar("mode")) == "dashsearch")
                {
                    mode = new XVar(Constants.SEARCH_DASHBOARD);
                }
                else
                {
                    if (MVCFunctions.postvalue(new XVar("mode")) == "inlineLoadCtrl")
                    {
                        mode          = new XVar(Constants.SEARCH_LOAD_CONTROL);
                        layoutVersion = XVar.Clone(MVCFunctions.postvalue(new XVar("layoutVersion")));
                    }
                }
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(id, "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(mode, "mode");
                var_params.InitAndSetArrayItem(cname, "chartName");
                var_params.InitAndSetArrayItem(rname, "reportName");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(Constants.PAGE_SEARCH, "pageType");
                var_params.InitAndSetArrayItem(templatefile, "templatefile");
                var_params.InitAndSetArrayItem("ABC_Voting_Recirculated1", "shortTableName");
                var_params.InitAndSetArrayItem(layoutVersion, "layoutVersion");
                var_params.InitAndSetArrayItem((XVar.Pack(MVCFunctions.postvalue(new XVar("searchControllerId"))) ? XVar.Pack(MVCFunctions.postvalue(new XVar("searchControllerId"))) : XVar.Pack(id)), "searchControllerId");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("ctrlField")), "ctrlField");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("isNeedSettings")), "needSettings");
                if (mode == Constants.SEARCH_DASHBOARD)
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("table")), "dashTName");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashelement")), "dashElementName");
                }
                var_params.InitAndSetArrayItem(SearchPage.getExtraPageParams(), "extraPageParams");
                GlobalVars.pageObject = XVar.Clone(new SearchPage((XVar)(var_params)));
                if (mode == Constants.SEARCH_LOAD_CONTROL)
                {
                    GlobalVars.pageObject.displaySearchControl();
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                if (mode == Constants.SEARCH_DASHBOARD)
                {
                    MVCFunctions.Echo(new XVar(""));
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #20
0
 public ReportPrintPage(dynamic var_params)
     : base((XVar)var_params)
 {
     if (skipReportPrintPageCtor)
     {
         skipReportPrintPageCtor = false;
         return;
     }
     this.jsSettings.InitAndSetArrayItem((XVar.Pack(this.crossTable) ? XVar.Pack(1) : XVar.Pack(0)), "tableSettings", this.tName, "reportType");
     if (XVar.Pack(this.pdfMode))
     {
         if (this.pSet.getReportPrintPDFGroupsPerPage() != 0)
         {
             this.splitAtServer = new XVar(true);
             this.splitByGroups = XVar.Clone(this.pSet.getReportPrintPDFGroupsPerPage());
         }
     }
     else
     {
         if ((XVar)(this.format == "excel") || (XVar)(this.format == "word"))
         {
             this.splitAtServer = new XVar(false);
             this.splitByGroups = new XVar(0);
         }
         else
         {
             if (XVar.Pack(!(XVar)(pdfJsonMode())))
             {
                 if (this.pSet.getReportPrintPartitionType() != 0)
                 {
                     this.splitAtServer = new XVar(true);
                     if (XVar.Pack(!(XVar)(this.splitByGroups)))
                     {
                         this.splitByGroups = XVar.Clone(this.pSet.getReportPrintGroupsPerPage());
                     }
                 }
                 this.pageData.InitAndSetArrayItem(this.splitByGroups, "printRecords");
             }
             else
             {
                 if (XVar.Pack(pdfJsonMode()))
                 {
                     this.splitAtServer = new XVar(true);
                     if (XVar.Pack(!(XVar)(this.splitByGroups)))
                     {
                         this.splitByGroups = new XVar(100000);
                     }
                 }
             }
         }
     }
     if (XVar.Pack(this.isDetail))
     {
         this.splitAtServer = new XVar(false);
         this.splitByGroups = new XVar(0);
     }
     if (XVar.Pack(this.eventsObject.exists(new XVar("BeforeProcessReportPrint"))))
     {
         this.eventsObject.BeforeProcessReportPrint(this);
     }
     if (XVar.Pack(CommonFunctions.isRTL()))
     {
         this.jsSettings.InitAndSetArrayItem(true, "tableSettings", this.tName, "isRTL");
     }
     this.jsSettings.InitAndSetArrayItem(this.pSet.getReportPrintPartitionType(), "tableSettings", this.tName, "reportPrintPartitionType");
     this.jsSettings.InitAndSetArrayItem(this.pSet.getReportPrintGroupsPerPage(), "tableSettings", this.tName, "reportPrintGroupsPerPage");
     this.jsSettings.InitAndSetArrayItem(this.pSet.getReportPrintLayout(), "tableSettings", this.tName, "reportPrintLayout");
     this.jsSettings.InitAndSetArrayItem(this.pSet.getLowGroup(), "tableSettings", this.tName, "lowGroup");
     this.jsSettings.InitAndSetArrayItem(this.pSet.isPrinterPagePDF(), "tableSettings", this.tName, "printerPagePDF");
     this.jsSettings.InitAndSetArrayItem(this.pSet.getPrinterPageOrientation(), "tableSettings", this.tName, "printerPageOrientation");
     this.jsSettings.InitAndSetArrayItem(this.pSet.getPrinterPageScale(), "tableSettings", this.tName, "printerPageScale");
     this.jsSettings.InitAndSetArrayItem(this.pSet.isPrinterPageFitToPage(), "tableSettings", this.tName, "isPrinterPageFitToPage");
     if (this.pSet.getReportPrintPartitionType() == 0)
     {
         this.jsSettings.InitAndSetArrayItem(0, "tableSettings", this.tName, "printerSplitRecords");
     }
     else
     {
         this.jsSettings.InitAndSetArrayItem(this.pSet.getReportPrintGroupsPerPage(), "tableSettings", this.tName, "printerSplitRecords");
     }
     this.jsSettings.InitAndSetArrayItem(this.pSet.getReportPrintPDFGroupsPerPage(), "tableSettings", this.tName, "printerPDFSplitRecords");
     if (XVar.Pack(this.crossTable))
     {
         this.pageData.InitAndSetArrayItem(getCurrentCrossParams(), "crossParams");
     }
 }
コード例 #21
0
        public override XVar showDBValue(dynamic data, dynamic _param_keylink)
        {
            #region pass-by-value parameters
            dynamic keylink = XVar.Clone(_param_keylink);
            #endregion

            dynamic containsMailTo = null, link = null, result = null, title = null;
            result = XVar.Clone(data[this.field]);
            if (XVar.Pack(!(XVar)(MVCFunctions.strlen((XVar)(result)))))
            {
                return("");
            }
            containsMailTo = XVar.Clone(MVCFunctions.substr((XVar)(result), new XVar(0), new XVar(7)) == "mailto:");
            title          = XVar.Clone(MVCFunctions.runner_htmlspecialchars((XVar)((XVar.Pack(containsMailTo) ? XVar.Pack(MVCFunctions.substr((XVar)(result), new XVar(8))) : XVar.Pack(result)))));
            link           = XVar.Clone(MVCFunctions.runner_htmlspecialchars((XVar)((XVar.Pack(containsMailTo) ? XVar.Pack(result) : XVar.Pack(MVCFunctions.Concat("mailto:", result))))));
            if (XVar.Pack(this.searchHighlight))
            {
                title = XVar.Clone(highlightSearchWord((XVar)(title), new XVar(false), new XVar("")));
            }
            return(MVCFunctions.Concat("<a href=\"", link, "\">", title, "</a>"));
        }
コード例 #22
0
        public ActionResult list()
        {
            try
            {
                dynamic i = null, mode = null, options = XVar.Array(), pageObject = null;
                XTempl  xt;
                GlobalVars.requestTable = new XVar("dbo.GRUPOS");
                GlobalVars.requestPage  = new XVar("list");
                CommonFunctions.add_nocache_headers();
                dbo_GRUPOS_Variables.Apply();
                CommonFunctions.InitLookupLinks();
                if (XVar.Pack(!(XVar)(ListPage.processListPageSecurity((XVar)(GlobalVars.strTableName)))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                if (XVar.Pack(ListPage.processSaveParams((XVar)(GlobalVars.strTableName))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                {
                    TLayout t_layout = null;

                    t_layout                            = new TLayout(new XVar("list_bootstrap1"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version                    = 3;
                    t_layout.bootstrapTheme             = "default";
                    t_layout.customCssPageName          = "dbo_GRUPOS_list";
                    t_layout.blocks["center"]           = XVar.Array();
                    t_layout.containers["gridcontrols"] = XVar.Array();
                    t_layout.containers["gridcontrols"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "add_delete"));
                    t_layout.containers["add_delete"] = XVar.Array();
                    t_layout.containers["add_delete"].Add(new XVar("name", "add", "block", "newrecord_controls_block", "substyle", 1));

                    t_layout.containers["add_delete"].Add(new XVar("name", "recordcontrol", "block", "record_controls_block", "substyle", 1));

                    t_layout.skins["add_delete"] = "";


                    t_layout.containers["gridcontrols"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "gridinfo"));
                    t_layout.containers["gridinfo"] = XVar.Array();
                    t_layout.containers["gridinfo"].Add(new XVar("name", "details_found", "block", "details_found", "substyle", 1));

                    t_layout.containers["gridinfo"].Add(new XVar("name", "printpanel", "block", "print_friendly", "substyle", 1));

                    t_layout.containers["gridinfo"].Add(new XVar("name", "bsfieldhidepanel", "block", "field_hide_panel", "substyle", 1));

                    t_layout.skins["gridinfo"] = "";


                    t_layout.containers["gridcontrols"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "gridinfo_sort"));
                    t_layout.containers["gridinfo_sort"] = XVar.Array();
                    t_layout.containers["gridinfo_sort"].Add(new XVar("name", "reorder_records", "block", "reorder_records", "substyle", 1));

                    t_layout.skins["gridinfo_sort"] = "";


                    t_layout.skins["gridcontrols"] = "";

                    t_layout.blocks["center"].Add("gridcontrols");
                    t_layout.containers["tabs"] = XVar.Array();
                    t_layout.containers["tabs"].Add(new XVar("name", "bsgrid_tabs", "block", "grid_tabs", "substyle", 1));

                    t_layout.skins["tabs"] = "";

                    t_layout.blocks["center"].Add("tabs");
                    t_layout.containers["messagerow"] = XVar.Array();
                    t_layout.containers["messagerow"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "message"));
                    t_layout.containers["message"] = XVar.Array();
                    t_layout.containers["message"].Add(new XVar("name", "message", "block", "message_block", "substyle", 1));

                    t_layout.skins["message"] = "";


                    t_layout.skins["messagerow"] = "";

                    t_layout.blocks["center"].Add("messagerow");
                    t_layout.containers["center"] = XVar.Array();
                    t_layout.containers["center"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "grid"));
                    t_layout.containers["grid"] = XVar.Array();
                    t_layout.containers["grid"].Add(new XVar("name", "grid", "block", "grid_block", "substyle", 1));

                    t_layout.skins["grid"] = "";


                    t_layout.skins["center"] = "";

                    t_layout.blocks["center"].Add("center");
                    t_layout.containers["pagination"] = XVar.Array();
                    t_layout.containers["pagination"].Add(new XVar("name", "pagination", "block", "pagination_block", "substyle", 1));

                    t_layout.skins["pagination"] = "";

                    t_layout.blocks["center"].Add("pagination");
                    t_layout.blocks["left"]     = XVar.Array();
                    t_layout.containers["left"] = XVar.Array();
                    t_layout.containers["left"].Add(new XVar("name", "searchpanel", "block", "searchPanel", "substyle", 1));

                    t_layout.containers["left"].Add(new XVar("name", "filterpanel", "block", "filterPanel", "substyle", 1));

                    t_layout.skins["left"] = "";

                    t_layout.blocks["left"].Add("left");
                    t_layout.blocks["top"]      = XVar.Array();
                    t_layout.containers["menu"] = XVar.Array();
                    t_layout.containers["menu"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "hdr"));
                    t_layout.containers["hdr"] = XVar.Array();
                    t_layout.containers["hdr"].Add(new XVar("name", "logo", "block", "logo_block", "substyle", 1));

                    t_layout.containers["hdr"].Add(new XVar("name", "bsnavbarcollapse", "block", "collapse_block", "substyle", 1));

                    t_layout.skins["hdr"] = "";


                    t_layout.containers["menu"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "menu_1"));
                    t_layout.containers["menu_1"] = XVar.Array();
                    t_layout.containers["menu_1"].Add(new XVar("name", "hmenu", "block", "menu_block", "substyle", 1));

                    t_layout.containers["menu_1"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "more"));
                    t_layout.containers["more"] = XVar.Array();
                    t_layout.containers["more"].Add(new XVar("name", "morebutton", "block", "more_list", "substyle", 1));

                    t_layout.containers["more"].Add(new XVar("name", "loggedas", "block", "security_block", "substyle", 1));

                    t_layout.skins["more"] = "";


                    t_layout.containers["menu_1"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "more_1"));
                    t_layout.containers["more_1"] = XVar.Array();
                    t_layout.containers["more_1"].Add(new XVar("name", "search", "block", "searchform_block", "substyle", 1));

                    t_layout.skins["more_1"] = "";


                    t_layout.skins["menu_1"] = "";


                    t_layout.skins["menu"] = "";

                    t_layout.blocks["top"].Add("menu");
                    t_layout.blocks["topmiddle"]       = XVar.Array();
                    t_layout.containers["breadcrumbs"] = XVar.Array();
                    t_layout.containers["breadcrumbs"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "bc"));
                    t_layout.containers["bc"] = XVar.Array();
                    t_layout.containers["bc"].Add(new XVar("name", "breadcrumbs", "block", "breadcrumbs", "substyle", 1));

                    t_layout.skins["bc"] = "";


                    t_layout.skins["breadcrumbs"] = "";

                    t_layout.blocks["topmiddle"].Add("breadcrumbs");
                    t_layout.containers["masterinfo"] = XVar.Array();
                    t_layout.containers["masterinfo"].Add(new XVar("name", "masterinfo", "block", "mastertable_block", "substyle", 1));

                    t_layout.skins["masterinfo"] = "";

                    t_layout.blocks["topmiddle"].Add("masterinfo");
                    GlobalVars.page_layouts["dbo_GRUPOS_list"] = t_layout;
                }

                options = XVar.Clone(XVar.Array());
                mode    = XVar.Clone(ListPage.readListModeFromRequest());
                if (mode == Constants.LIST_SIMPLE)
                {
                }
                else
                {
                    if (mode == Constants.LIST_AJAX)
                    {
                    }
                    else
                    {
                        if (mode == Constants.LIST_LOOKUP)
                        {
                            options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("table")), "mainTable");
                            options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("field")), "mainField");
                            options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("pageType")), "mainPageType");
                            options.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("data")))), "mainRecordData");
                            options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("mainRecordMasterTable")), "mainRecordMasterTable");
                            if (XVar.Pack(MVCFunctions.postvalue(new XVar("parentsExist"))))
                            {
                                options.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("parentCtrlsData")))), "parentCtrlsData");
                            }
                        }
                        else
                        {
                            if (mode == Constants.LIST_POPUPDETAILS)
                            {
                            }
                            else
                            {
                                if (mode == Constants.LIST_DETAILS)
                                {
                                }
                                else
                                {
                                    if (mode == Constants.LIST_DASHDETAILS)
                                    {
                                    }
                                    else
                                    {
                                        if (mode == Constants.LIST_DASHBOARD)
                                        {
                                        }
                                        else
                                        {
                                            if (mode == Constants.MAP_DASHBOARD)
                                            {
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                xt = XVar.UnPackXTempl(new XTempl((XVar)(mode != Constants.LIST_SIMPLE)));
                options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("page")), "pageName");
                options.InitAndSetArrayItem(Constants.PAGE_LIST, "pageType");
                options.InitAndSetArrayItem((XVar.Pack(CommonFunctions.postvalue_number(new XVar("id"))) ? XVar.Pack(CommonFunctions.postvalue_number(new XVar("id"))) : XVar.Pack(1)), "id");
                options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("recordId")) + 0, "flyId");
                options.InitAndSetArrayItem(mode, "mode");
                options.InitAndSetArrayItem(xt, "xt");
                options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("masterpagetype")), "masterPageType");
                options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("mastertable")), "masterTable");
                options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("masterpage")), "masterPage");
                options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("masterid")), "masterId");
                options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("firsttime")), "firstTime");
                options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("sortby")), "sortBy");
                if ((XVar)((XVar)(mode == Constants.LIST_DASHBOARD) && (XVar)(MVCFunctions.postvalue(new XVar("nodata")))) && (XVar)(MVCFunctions.strlen((XVar)(options["masterTable"]))))
                {
                    options.InitAndSetArrayItem(true, "showNoData");
                }
                if (mode != Constants.LIST_LOOKUP)
                {
                    options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("dashelement")), "dashElementName");
                    options.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("table")), "dashTName");
                }
                if (XVar.Pack(MVCFunctions.postvalue(new XVar("mapRefresh"))))
                {
                    options.InitAndSetArrayItem(true, "mapRefresh");
                    options.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("vpCoordinates")))), "vpCoordinates");
                }
                i = new XVar(1);
                while (XVar.Pack(MVCFunctions.REQUESTKeyExists(MVCFunctions.Concat("masterkey", i))))
                {
                    if (i == 1)
                    {
                        options.InitAndSetArrayItem(XVar.Array(), "masterKeysReq");
                    }
                    options.InitAndSetArrayItem(MVCFunctions.postvalue(MVCFunctions.Concat("masterkey", i)), "masterKeysReq", i);
                    i++;
                }
                GlobalVars.pageObject = XVar.Clone(ListPage.createListPage((XVar)(GlobalVars.strTableName), (XVar)(options)));
                if (XVar.Pack(GlobalVars.pageObject.processSaveSearch()))
                {
                    MVCFunctions.Echo(new XVar(""));
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                GlobalVars.gQuery.ReplaceFieldsWithDummies((XVar)(GlobalVars.pageObject.getNotListBlobFieldsIndices()));
                if ((XVar)((XVar)(mode != Constants.LIST_DETAILS) && (XVar)(mode != Constants.MAP_DASHBOARD)) && (XVar)(mode != Constants.LIST_DASHBOARD))
                {
                }
                XSession.Session.Remove("message_add");
                XSession.Session.Remove("message_edit");
                GlobalVars.pageObject.prepareForBuildPage();
                GlobalVars.pageObject.showPage();
                if (mode != Constants.LIST_SIMPLE)
                {
                    MVCFunctions.Echo(new XVar(""));
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
コード例 #23
0
        public virtual ViewControl getControl(dynamic _param_field, dynamic _param_format = null)
        {
            #region default values
            if (_param_format as Object == null)
            {
                _param_format = new XVar();
            }
            #endregion

            #region pass-by-value parameters
            dynamic field  = XVar.Clone(_param_field);
            dynamic format = XVar.Clone(_param_format);
            #endregion

            if (XVar.Pack(!(XVar)(this.viewControls.KeyExists(field))))
            {
                dynamic className = null, editFormat = null, userControl = null, vcTypes = null, viewFormat = null;
                vcTypes    = XVar.Clone(new ViewControlTypes());
                editFormat = XVar.Clone(this.pSet.getEditFormat((XVar)(field)));
                if (XVar.Pack(format == null))
                {
                    dynamic localPSet = null, lookupPageType = null;
                    localPSet      = XVar.Clone(this.pSet);
                    lookupPageType = new XVar("");
                    if (XVar.Pack(!(XVar)(this.isLocal)))
                    {
                        lookupPageType = XVar.Clone(this.pSet.getPageTypeByFieldEditFormat((XVar)(field), new XVar(Constants.EDIT_FORMAT_LOOKUP_WIZARD)));
                        if (lookupPageType != XVar.Pack(""))
                        {
                            localPSet = XVar.Clone(new ProjectSettings((XVar)(this.pSet._table), (XVar)(lookupPageType)));
                        }
                    }
                    if ((XVar)((XVar)((XVar)(!(XVar)(this.isLocal)) && (XVar)((XVar)(editFormat == Constants.EDIT_FORMAT_LOOKUP_WIZARD) || (XVar)(lookupPageType != XVar.Pack("")))) && (XVar)((XVar)(localPSet.getLookupType((XVar)(field)) == Constants.LT_LOOKUPTABLE) || (XVar)(localPSet.getLookupType((XVar)(field)) == Constants.LT_QUERY))) && (XVar)(localPSet.getLinkField((XVar)(field)) != localPSet.getDisplayField((XVar)(field))))
                    {
                        viewFormat = new XVar(Constants.FORMAT_LOOKUP_WIZARD);
                    }
                    else
                    {
                        viewFormat = XVar.Clone(this.pSet.getViewFormat((XVar)(field)));
                    }
                }
                else
                {
                    viewFormat = XVar.Clone(format);
                }
                className = XVar.Clone(vcTypes.viewTypes[viewFormat]);
                if ((XVar)(className == XVar.Pack("")) && (XVar)(viewFormat != XVar.Pack("")))
                {
                    className   = XVar.Clone(MVCFunctions.Concat("View", viewFormat));
                    userControl = new XVar(true);
                }
                if (className != XVar.Pack(""))
                {
                    this.viewControls.InitAndSetArrayItem(MVCFunctions.createViewControlClass((XVar)(className), (XVar)(field), this, (XVar)(this.pageObject)), field);
                }
                else
                {
                    this.viewControls.InitAndSetArrayItem(new ViewControl((XVar)(field), this, (XVar)(this.pageObject)), field);
                }
                if (XVar.Pack(userControl))
                {
                    this.viewControls[field].viewFormat = XVar.Clone(className);
                    this.viewControls[field].init();
                    this.viewControls[field].initUserControl();
                }
            }
            return(XVar.UnPackViewControl(this.viewControls[field] ?? new XVar()));
        }
コード例 #24
0
ファイル: exportpage.cs プロジェクト: kurtrad/ABCVote
        protected virtual XVar exportByType()
        {
            dynamic listarray = null, myPage = null, nPageSize = null, rs = null;

            myPage    = new XVar(1);
            nPageSize = new XVar(0);
            if (this.records == "page")
            {
                myPage = XVar.Clone((int)XSession.Session[MVCFunctions.Concat(this.tName, "_pagenumber")]);
                if (XVar.Pack(!(XVar)(myPage)))
                {
                    myPage = new XVar(1);
                }
                nPageSize = XVar.Clone((int)XSession.Session[MVCFunctions.Concat(this.tName, "_pagesize")]);
                if (XVar.Pack(!(XVar)(nPageSize)))
                {
                    nPageSize = XVar.Clone(this.pSet.getInitialPageSize());
                }
                if (nPageSize < XVar.Pack(0))
                {
                    nPageSize = new XVar(0);
                }
            }
            listarray = new XVar(null);
            if (XVar.Pack(this.eventsObject.exists(new XVar("ListQuery"))))
            {
                dynamic orderClause = null, orderFieldsData = XVar.Array();
                orderClause     = XVar.Clone(OrderClause.createFromPage(this));
                orderFieldsData = XVar.Clone(orderClause.getOrderFieldsData());
                listarray       = XVar.Clone(this.eventsObject.ListQuery((XVar)(this.searchClauseObj), (XVar)(orderFieldsData["fieldsForSort"]), (XVar)(orderFieldsData["howToSortData"]), (XVar)(this.masterTable), (XVar)(this.masterKeysReq), (XVar)(getSelectedRecords()), (XVar)(nPageSize), (XVar)(myPage), this));
            }
            if (listarray != null)
            {
                rs = XVar.Clone(listarray);
            }
            else
            {
                dynamic _rs = null;
                _rs = XVar.Clone(this.connection.queryPage((XVar)(this.querySQL), (XVar)(myPage), (XVar)(nPageSize), (XVar)(XVar.Pack(0) < nPageSize)));
                rs  = XVar.Clone(_rs.getQueryHandle());
            }
            MVCFunctions.runner_set_page_timeout(new XVar(300));
            if (XVar.Pack(this.pSet.getRecordsLimit()))
            {
                nPageSize = XVar.Clone(this.pSet.getRecordsLimit() - (myPage - 1) * nPageSize);
            }
            exportTo((XVar)(this.exportType), (XVar)(rs), (XVar)(nPageSize));
            this.connection.close();
            return(null);
        }
コード例 #25
0
ファイル: ViewControl.cs プロジェクト: kurtrad/ABCVote
        protected virtual XVar textNeedsTruncating(dynamic _param_value, dynamic _param_cNumberOfChars)
        {
            #region pass-by-value parameters
            dynamic value          = XVar.Clone(_param_value);
            dynamic cNumberOfChars = XVar.Clone(_param_cNumberOfChars);
            #endregion

            return((XVar)((XVar)((XVar)(!(XVar)(this.isUsedForFilter)) && (XVar)(!(XVar)(this.container.fullText))) && (XVar)(XVar.Pack(0) < cNumberOfChars)) && (XVar)(cNumberOfChars < MVCFunctions.runner_strlen((XVar)(value))));
        }
コード例 #26
0
ファイル: exportpage.cs プロジェクト: kurtrad/ABCVote
        public virtual XVar ExportToXML(dynamic _param_rs, dynamic _param_nPageSize)
        {
            #region pass-by-value parameters
            dynamic rs        = XVar.Clone(_param_rs);
            dynamic nPageSize = XVar.Clone(_param_nPageSize);
            #endregion

            dynamic eventRes = null, i = null, row = null, values = XVar.Array();
            MVCFunctions.Header("Content-Type", "text/xml");
            MVCFunctions.Header((XVar)(MVCFunctions.Concat("Content-Disposition: attachment;Filename=", CommonFunctions.GetTableURL((XVar)(this.tName)), ".xml")));
            if (XVar.Pack(this.eventsObject.exists(new XVar("ListFetchArray"))))
            {
                row = XVar.Clone(this.eventsObject.ListFetchArray((XVar)(rs), this));
            }
            else
            {
                row = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(this.connection.fetch_array((XVar)(rs)))));
            }
            MVCFunctions.Echo(MVCFunctions.Concat("<?xml version=\"1.0\" encoding=\"", GlobalVars.cCharset, "\" standalone=\"yes\"?>\r\n"));
            MVCFunctions.Echo("<table>\r\n");
            i = new XVar(0);
            this.viewControls.setForExportVar(new XVar("xml"));
            while ((XVar)((XVar)(!(XVar)(nPageSize)) || (XVar)(i < nPageSize)) && (XVar)(row))
            {
                values = XVar.Clone(XVar.Array());
                foreach (KeyValuePair <XVar, dynamic> field in this.selectedFields.GetEnumerator())
                {
                    dynamic fType = null;
                    fType = XVar.Clone(this.pSet.getFieldType((XVar)(field.Value)));
                    if (XVar.Pack(CommonFunctions.IsBinaryType((XVar)(fType))))
                    {
                        values.InitAndSetArrayItem("LONG BINARY DATA - CANNOT BE DISPLAYED", field.Value);
                    }
                    else
                    {
                        values.InitAndSetArrayItem(getFormattedFieldValue((XVar)(field.Value), (XVar)(row)), field.Value);
                    }
                }
                eventRes = new XVar(true);
                if (XVar.Pack(this.eventsObject.exists(new XVar("BeforeOut"))))
                {
                    eventRes = XVar.Clone(this.eventsObject.BeforeOut((XVar)(row), (XVar)(values), this));
                }
                if (XVar.Pack(eventRes))
                {
                    i++;
                    MVCFunctions.Echo("<row>\r\n");
                    foreach (KeyValuePair <XVar, dynamic> val in values.GetEnumerator())
                    {
                        dynamic field = null;
                        field = XVar.Clone(MVCFunctions.runner_htmlspecialchars((XVar)(CommonFunctions.XMLNameEncode((XVar)(val.Key)))));
                        MVCFunctions.Echo(MVCFunctions.Concat("<", field, ">"));
                        MVCFunctions.Echo(CommonFunctions.xmlencode((XVar)(values[val.Key])));
                        MVCFunctions.Echo(MVCFunctions.Concat("</", field, ">\r\n"));
                    }
                    MVCFunctions.Echo("</row>\r\n");
                }
                if (XVar.Pack(this.eventsObject.exists(new XVar("ListFetchArray"))))
                {
                    row = XVar.Clone(this.eventsObject.ListFetchArray((XVar)(rs), this));
                }
                else
                {
                    row = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(this.connection.fetch_array((XVar)(rs)))));
                }
            }
            MVCFunctions.Echo("</table>\r\n");
            return(null);
        }
コード例 #27
0
ファイル: ViewControl.cs プロジェクト: kurtrad/ABCVote
        protected virtual XVar getSpecialCharsFromString(dynamic _param_str)
        {
            #region pass-by-value parameters
            dynamic str = XVar.Clone(_param_str);
            #endregion

            dynamic chars = XVar.Array(), csArray = XVar.Array();
            chars   = XVar.Clone(new XVar(0, "&amp;", 1, "&quot;", 2, "&lt;", 3, "&gt;"));
            csArray = XVar.Clone(XVar.Array());
            foreach (KeyValuePair <XVar, dynamic> var_char in chars.GetEnumerator())
            {
                if (!XVar.Equals(XVar.Pack(MVCFunctions.strpos((XVar)(str), (XVar)(var_char.Value))), XVar.Pack(false)))
                {
                    csArray.InitAndSetArrayItem(var_char.Value, null);
                }
            }
            return(csArray);
        }
コード例 #28
0
ファイル: exportpage.cs プロジェクト: kurtrad/ABCVote
        public virtual XVar ExportToCSV(dynamic _param_rs, dynamic _param_nPageSize)
        {
            #region pass-by-value parameters
            dynamic rs        = XVar.Clone(_param_rs);
            dynamic nPageSize = XVar.Clone(_param_nPageSize);
            #endregion

            dynamic delimiter = null, eventRes = null, headerParts = XVar.Array(), iNumberOfRows = null, row = null, values = XVar.Array();
            if ((XVar)(this.pSet.chekcExportDelimiterSelection()) && (XVar)(MVCFunctions.strlen((XVar)(this.csvDelimiter))))
            {
                delimiter = XVar.Clone(this.csvDelimiter);
            }
            else
            {
                delimiter = XVar.Clone(this.pSet.getExportDelimiter());
            }
            MVCFunctions.Header("Content-Type", "application/csv");
            MVCFunctions.Header((XVar)(MVCFunctions.Concat("Content-Disposition: attachment;Filename=", CommonFunctions.GetTableURL((XVar)(this.tName)), ".csv")));
            MVCFunctions.printBOM();
            if (XVar.Pack(this.eventsObject.exists(new XVar("ListFetchArray"))))
            {
                row = XVar.Clone(this.eventsObject.ListFetchArray((XVar)(rs), this));
            }
            else
            {
                row = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(this.connection.fetch_array((XVar)(rs)))));
            }
            headerParts = XVar.Clone(XVar.Array());
            foreach (KeyValuePair <XVar, dynamic> field in this.selectedFields.GetEnumerator())
            {
                headerParts.InitAndSetArrayItem(MVCFunctions.Concat("\"", MVCFunctions.str_replace(new XVar("\""), new XVar("\"\""), (XVar)(field.Value)), "\""), null);
            }
            MVCFunctions.Echo(MVCFunctions.implode((XVar)(delimiter), (XVar)(headerParts)));
            MVCFunctions.Echo("\r\n");
            this.viewControls.setForExportVar(new XVar("csv"));
            iNumberOfRows = new XVar(0);
            while ((XVar)((XVar)(!(XVar)(nPageSize)) || (XVar)(iNumberOfRows < nPageSize)) && (XVar)(row))
            {
                values = XVar.Clone(XVar.Array());
                foreach (KeyValuePair <XVar, dynamic> field in this.selectedFields.GetEnumerator())
                {
                    dynamic fType = null;
                    fType = XVar.Clone(this.pSet.getFieldType((XVar)(field.Value)));
                    if (XVar.Pack(CommonFunctions.IsBinaryType((XVar)(fType))))
                    {
                        values.InitAndSetArrayItem("LONG BINARY DATA - CANNOT BE DISPLAYED", field.Value);
                    }
                    else
                    {
                        values.InitAndSetArrayItem(getFormattedFieldValue((XVar)(field.Value), (XVar)(row)), field.Value);
                    }
                }
                eventRes = new XVar(true);
                if (XVar.Pack(this.eventsObject.exists(new XVar("BeforeOut"))))
                {
                    eventRes = XVar.Clone(this.eventsObject.BeforeOut((XVar)(row), (XVar)(values), this));
                }
                if (XVar.Pack(eventRes))
                {
                    dynamic dataRowParts = XVar.Array();
                    dataRowParts = XVar.Clone(XVar.Array());
                    foreach (KeyValuePair <XVar, dynamic> field in this.selectedFields.GetEnumerator())
                    {
                        dataRowParts.InitAndSetArrayItem(MVCFunctions.Concat("\"", MVCFunctions.str_replace(new XVar("\""), new XVar("\"\""), (XVar)(values[field.Value])), "\""), null);
                    }
                    MVCFunctions.Echo(MVCFunctions.implode((XVar)(delimiter), (XVar)(dataRowParts)));
                }
                iNumberOfRows++;
                if (XVar.Pack(this.eventsObject.exists(new XVar("ListFetchArray"))))
                {
                    row = XVar.Clone(this.eventsObject.ListFetchArray((XVar)(rs), this));
                }
                else
                {
                    row = XVar.Clone(this.cipherer.DecryptFetchedArray((XVar)(this.connection.fetch_array((XVar)(rs)))));
                }
                if ((XVar)((XVar)((XVar)(!(XVar)(nPageSize)) || (XVar)(iNumberOfRows < nPageSize)) && (XVar)(row)) && (XVar)(eventRes))
                {
                    MVCFunctions.Echo("\r\n");
                }
            }
            return(null);
        }
コード例 #29
0
ファイル: ViewControl.cs プロジェクト: kurtrad/ABCVote
 public virtual XVar isUserControl()
 {
     return((XVar)(this.userControl) && (XVar)(XVar.Equals(XVar.Pack(this.userControl), XVar.Pack(true))));
 }
コード例 #30
0
ファイル: imager.cs プロジェクト: kurtrad/ABCVote
 public XVar imager()
 {
     try
     {
         dynamic file = null, pdf = null, table = null, var_params = XVar.Array();
         table = XVar.Clone((XVar.Pack(pdf as object != null) ? XVar.Pack(var_params["table"]) : XVar.Pack(MVCFunctions.postvalue(new XVar("table")))));
         if (XVar.Pack(!(XVar)(CommonFunctions.checkTableName((XVar)(table)))))
         {
             MVCFunctions.Echo(new XVar(0));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         Assembly.GetExecutingAssembly().GetType(MVCFunctions.Concat("runnerDotNet.", MVCFunctions.Concat("", table, ""),
                                                                     "_Variables")).InvokeMember("Apply", BindingFlags.InvokeMethod, null, null, null);
         if (XVar.Pack(!(XVar)(GlobalVars.gQuery as object != null)))
         {
             if (XVar.Pack(!(XVar)(GlobalVars.gSettings as object != null)))
             {
                 GlobalVars.gSettings = XVar.Clone(new ProjectSettings((XVar)(CommonFunctions.GetTableByShort((XVar)(table)))));
             }
             GlobalVars.gQuery = XVar.Clone(GlobalVars.gSettings.getSQLQuery());
         }
         file = XVar.Clone(CommonFunctions.GetImageFromDB((XVar)(GlobalVars.gQuery), (XVar)(pdf as object != null), (XVar)((XVar.Pack(var_params as object != null) ? XVar.Pack(var_params) : XVar.Pack(XVar.Array())))));
         return(MVCFunctions.GetBuferContentAndClearBufer());
     }
     catch (RunnerRedirectException ex)
     { return(Redirect(ex.Message)); }
 }