protected virtual XVar getMultiselectLookupValues(dynamic _param_value) { #region pass-by-value parameters dynamic value = XVar.Clone(_param_value); #endregion dynamic LookupSQL = null, displayValue = null, i = null, lookupArr = XVar.Array(), lookupValues = XVar.Array(), lookuprow = XVar.Array(), qResult = null, var_in = null, withoutWhere = null; var_in = XVar.Clone(getDbPreparedValuesList((XVar)(value))); if (XVar.Pack(!(XVar)(MVCFunctions.strlen((XVar)(var_in))))) { return(new XVar(0, value)); } if (XVar.Pack(MVCFunctions.count(this.resolvedLookupValues[value]))) { return(this.resolvedLookupValues[value]); } withoutWhere = new XVar(false); i = new XVar(0); for (; i < 2; i++) { LookupSQL = XVar.Clone(getMultiselectLookupResolvingSQL((XVar)(value), (XVar)(var_in), (XVar)(withoutWhere))); CommonFunctions.LogInfo((XVar)(LookupSQL)); lookupArr = XVar.Clone(XVar.Array()); qResult = XVar.Clone(this.lookupConnection.query((XVar)(LookupSQL))); while (XVar.Pack(lookuprow = XVar.Clone(qResult.fetchNumeric()))) { displayValue = XVar.Clone(lookuprow[this.displayFieldIndex]); lookupArr.InitAndSetArrayItem(displayValue, null); this.resolvedLinkLookupValues.InitAndSetArrayItem(lookuprow[this.linkFieldIndex], value, displayValue); } if (MVCFunctions.count(lookupArr) == MVCFunctions.count(MVCFunctions.explode(new XVar(","), (XVar)(var_in)))) { break; } withoutWhere = new XVar(true); } lookupValues = XVar.Clone(XVar.Array()); lookupArr = XVar.Clone(MVCFunctions.array_unique((XVar)(lookupArr))); foreach (KeyValuePair <XVar, dynamic> lookupvalue in lookupArr.GetEnumerator()) { lookupValues.InitAndSetArrayItem(getDecryptLookupValue((XVar)(lookupvalue.Value)), null); } if (XVar.Pack(MVCFunctions.count(lookupValues))) { this.resolvedLookupValues.InitAndSetArrayItem(lookupValues, value); } return(lookupValues); }
public virtual XVar addControlsJSAndCSS() { dynamic appearOnPageFunc = null, fields = XVar.Array(), getEditFieldsFunc = null, pageTypeStr = null, pageTypes = null, searchFields = null, searchPanelActivated = null; pageTypes = XVar.Clone(XVar.Array()); switch (((XVar)this.pageType).ToString()) { case Constants.PAGE_ADD: pageTypeStr = new XVar("Add"); break; case Constants.PAGE_EDIT: pageTypeStr = new XVar("Edit"); break; case Constants.PAGE_VIEW: case Constants.PAGE_LIST: case Constants.PAGE_SEARCH: pageTypeStr = new XVar("List"); break; case Constants.PAGE_REGISTER: pageTypeStr = new XVar("RegisterOrSearch"); break; default: pageTypeStr = new XVar(""); break; } searchPanelActivated = XVar.Clone(isSearchPanelActivated()); if ((XVar)(pageTypeStr == XVar.Pack("")) && (XVar)(!(XVar)(searchPanelActivated))) { return(null); } if ((XVar)(pageTypeStr != XVar.Pack("")) && (XVar)(this.pageType != Constants.PAGE_SEARCH)) { getEditFieldsFunc = XVar.Clone(MVCFunctions.Concat("get", (XVar.Pack((XVar)(this.pageAddLikeInline) || (XVar)(this.pageEditLikeInline)) ? XVar.Pack("Inline") : XVar.Pack("")), pageTypeStr, "Fields")); if ((XVar)(this.pageAddLikeInline) || (XVar)(this.pageEditLikeInline)) { appearOnPageFunc = XVar.Clone(MVCFunctions.Concat("appearOnInline", pageTypeStr)); } else { appearOnPageFunc = XVar.Clone(MVCFunctions.Concat("appearOn", pageTypeStr, "Page")); } } switch (((XVar)this.pageType).ToString()) { case Constants.PAGE_REGISTER: fields = XVar.Clone(this.pSetEdit.getPageFields()); break; case Constants.PAGE_SEARCH: fields = XVar.Clone(this.pSetEdit.getAdvSearchFields()); break; default: fields = XVar.Clone(XVar.Array()); if (XVar.Pack(getEditFieldsFunc)) { fields = XVar.Clone(this.pSetEdit.Invoke(getEditFieldsFunc)); } break; } searchFields = XVar.Clone(XVar.Array()); if (XVar.Pack(searchPanelActivated)) { searchFields = XVar.Clone(this.pSetEdit.getPanelSearchFields()); searchFields = XVar.Clone(MVCFunctions.array_merge((XVar)(searchFields), (XVar)(this.pSetEdit.getAllSearchFields()))); searchFields = XVar.Clone(MVCFunctions.array_unique((XVar)(searchFields))); fields = XVar.Clone(MVCFunctions.array_merge((XVar)(searchFields), (XVar)(fields))); fields = XVar.Clone(MVCFunctions.array_unique((XVar)(fields))); } foreach (KeyValuePair <XVar, dynamic> f in fields.GetEnumerator()) { dynamic appear = null; appear = new XVar(false); if ((XVar)((XVar)(this.pageType == Constants.PAGE_REGISTER) || (XVar)(this.pageType == Constants.PAGE_SEARCH)) || (XVar)(MVCFunctions.in_array((XVar)(f.Value), (XVar)(searchFields)))) { appear = new XVar(true); } else { if (XVar.Pack(appearOnPageFunc)) { appear = XVar.Clone(this.pSetEdit.Invoke(appearOnPageFunc, (XVar)(f.Value))); } } if (XVar.Pack(appear)) { getControl((XVar)(f.Value)).addJSFiles(); getControl((XVar)(f.Value)).addCSSFiles(); } } return(null); }