Esempio n. 1
0
 public XVar lookupsuggest()
 {
     try
     {
         dynamic LookupSQL = null, LookupSQLTable = null, LookupType = null, contextParams = XVar.Array(), data = XVar.Array(), displayFieldIndex = null, displayFieldName = null, displayedValue = 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, multiselect = 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(), viewContainer = null;
         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), (XVar)(MVCFunctions.postvalue(new XVar("page")))));
         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.EMPLEADO")
         {
             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, registerFields = null;
             checkResult    = new XVar(true);
             registerFields = XVar.Clone((XVar.Pack(pageType == "register") ? XVar.Pack(GlobalVars.gSettings.getPageFields()) : XVar.Pack(XVar.Array())));
             if (!XVar.Equals(XVar.Pack(MVCFunctions.array_search((XVar)(field), (XVar)(registerFields))), XVar.Pack(false)))
             {
                 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 (fieldValue.Value == XVar.Pack(""))
             {
                 continue;
             }
             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);
             }
         }
         if (XVar.Pack(!(XVar)(MVCFunctions.count(likeWheres))))
         {
             likeWheres.InitAndSetArrayItem("1=0", 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 = MVCFunctions.Concat(LookupSQL, lookupQueryObj.OrderByToSql());
             }
         }
         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"]);
         viewContainer     = XVar.Clone(new ViewControlsContainer((XVar)(GlobalVars.gSettings), new XVar(Constants.PAGE_LIST), new XVar(null)));
         var_response      = XVar.Clone(XVar.Array());
         qResult           = XVar.Clone(lookupConnection.query((XVar)(LookupSQL)));
         multiselect       = XVar.Clone(GlobalVars.gSettings.multiSelect((XVar)(lookupField)));
         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);
             }
             displayedValue = XVar.Clone(data[displayFieldIndex]);
             if (XVar.Pack(MVCFunctions.in_array((XVar)(GlobalVars.gSettings.getViewFormat((XVar)(lookupField))), (XVar)(new XVar(0, Constants.FORMAT_DATE_SHORT, 1, Constants.FORMAT_DATE_LONG, 2, Constants.FORMAT_DATE_TIME)))))
             {
                 dynamic ctrlData = XVar.Array();
                 ctrlData = XVar.Clone(XVar.Array());
                 ctrlData.InitAndSetArrayItem(data[linkFieldIndex], lookupField);
                 displayedValue = XVar.Clone(viewContainer.getControl((XVar)(lookupField)).getTextValue((XVar)(ctrlData)));
             }
             var_response.InitAndSetArrayItem(data[linkFieldIndex], null);
             var_response.InitAndSetArrayItem(displayedValue, 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)); }
 }
Esempio n. 2
0
		public ActionResult print()
		{
			try
			{
				dynamic id = null, pageObject = null, strtablename = null, var_params = XVar.Array();
				XTempl xt;
				ABC_Voting_Recirculated1_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["ABC_Voting_Recirculated1_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); }
		}
Esempio n. 3
0
 public XVar autocomplete()
 {
     try
     {
         dynamic         contextParams = XVar.Array(), control = null, editControls = null, field = null, isExistParent = null, masterTable = null, mode = null, pageName = null, pageType = null, parentCtrlsData = null, respObj = null, shortTableName = null;
         ProjectSettings pSet;
         MVCFunctions.Header("Expires", "Thu, 01 Jan 1970 00:00:01 GMT");
         shortTableName = XVar.Clone(MVCFunctions.postvalue(new XVar("shortTName")));
         Assembly.GetExecutingAssembly().GetType(MVCFunctions.Concat("runnerDotNet.", MVCFunctions.Concat("", shortTableName, ""),
                                                                     "_Variables")).InvokeMember("Apply", BindingFlags.InvokeMethod, null, null, null);
         field               = XVar.Clone(MVCFunctions.postvalue(new XVar("field")));
         pageType            = XVar.Clone(MVCFunctions.postvalue(new XVar("pageType")));
         pageName            = XVar.Clone(MVCFunctions.postvalue(new XVar("page")));
         GlobalVars.cipherer = XVar.Clone(new RunnerCipherer((XVar)(GlobalVars.strTableName)));
         pSet = XVar.UnPackProjectSettings(new ProjectSettings((XVar)(GlobalVars.strTableName), (XVar)(pageType), (XVar)(pageName)));
         if (GlobalVars.strTableName != "dbo.EMPLEADO")
         {
             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 checkField = null, registerFields = null;
             checkField     = new XVar(true);
             registerFields = XVar.Clone((XVar.Pack(pageType == "register") ? XVar.Pack(pSet.getPageFields()) : XVar.Pack(XVar.Array())));
             if (!XVar.Equals(XVar.Pack(MVCFunctions.array_search((XVar)(field), (XVar)(registerFields))), XVar.Pack(false)))
             {
                 checkField = new XVar(false);
             }
             if (XVar.Pack(checkField))
             {
                 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());
                 }
             }
         }
         editControls  = XVar.Clone(new EditControlsContainer(new XVar(null), (XVar)(pSet), (XVar)(pageType), (XVar)(GlobalVars.cipherer)));
         control       = XVar.Clone(editControls.getControl((XVar)(field)));
         contextParams = XVar.Clone(XVar.Array());
         contextParams.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("data")))), "data");
         masterTable = XVar.Clone(MVCFunctions.postvalue(new XVar("masterTable")));
         if ((XVar)(masterTable != XVar.Pack("")) && (XVar)(XSession.Session.KeyExists(MVCFunctions.Concat(masterTable, "_masterRecordData"))))
         {
             dynamic masterControlsData = XVar.Array(), masterData = XVar.Array();
             masterData         = XVar.Clone(XSession.Session[MVCFunctions.Concat(masterTable, "_masterRecordData")]);
             masterControlsData = XVar.Clone(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("masterData")))));
             foreach (KeyValuePair <XVar, dynamic> mValue in masterControlsData.GetEnumerator())
             {
                 masterData.InitAndSetArrayItem(mValue.Value, mValue.Key);
             }
             contextParams.InitAndSetArrayItem(masterData, "masterData");
         }
         RunnerContext.push((XVar)(new RunnerContextItem(new XVar(Constants.CONTEXT_ROW), (XVar)(contextParams))));
         parentCtrlsData = XVar.Clone(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("parentCtrlsData")))));
         isExistParent   = XVar.Clone(MVCFunctions.postvalue(new XVar("isExistParent")));
         mode            = XVar.Clone(MVCFunctions.intval((XVar)(MVCFunctions.postvalue(new XVar("mode")))));
         respObj         = XVar.Clone(new XVar("success", true, "data", control.getLookupContentToReload((XVar)(XVar.Equals(XVar.Pack(isExistParent), XVar.Pack("1"))), (XVar)(mode), (XVar)(parentCtrlsData))));
         MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(respObj)));
         RunnerContext.pop();
         MVCFunctions.Echo(new XVar(""));
         return(MVCFunctions.GetBuferContentAndClearBufer());
     }
     catch (RunnerRedirectException ex)
     { return(Redirect(ex.Message)); }
 }
Esempio n. 4
0
        public ActionResult list()
        {
            try
            {
                dynamic i = null, mode = null, options = XVar.Array(), pageObject = null;
                XTempl  xt;
                GlobalVars.requestTable = new XVar("dbo.ESTADO_COMPESADO");
                GlobalVars.requestPage  = new XVar("list");
                CommonFunctions.add_nocache_headers();
                dbo_ESTADO_COMPESADO_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_ESTADO_COMPESADO_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_ESTADO_COMPESADO_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)); }
        }
Esempio n. 5
0
 public override XVar getTextValue(dynamic data)
 {
     return(CommonFunctions.format_longdate((XVar)(CommonFunctions.db2time((XVar)(data[this.field])))));
 }
Esempio n. 6
0
        public ActionResult add()
        {
            try
            {
                dynamic id = null, pageMode = null, pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                Licencias_sin_goce_sueldo_Variables.Apply();
                CommonFunctions.add_nocache_headers();
                CommonFunctions.InitLookupLinks();
                if (XVar.Pack(!(XVar)(AddPage.processAddPageSecurity((XVar)(GlobalVars.strTableName)))))
                {
                    return(MVCFunctions.GetBuferContentAndClearBufer());
                }
                AddPage.handleBrokenRequest();
                {
                    TLayout t_layout = null;

                    t_layout                        = new TLayout(new XVar("add_bootstrap"), new XVar("OfficeOffice"), new XVar("MobileOffice"));
                    t_layout.version                = 3;
                    t_layout.bootstrapTheme         = "default";
                    t_layout.customCssPageName      = "Licencias_sin_goce_sueldo_add";
                    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", "addheader", "block", "addheader", "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_add", "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", "addfields", "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", "addbuttons", "block", "addbuttons", "substyle", 1));

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


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


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

                    t_layout.blocks["top"].Add("bottombuttons");
                    GlobalVars.page_layouts["Licencias_sin_goce_sueldo_add"] = 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          = "Licencias_sin_goce_sueldo_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["Licencias_sin_goce_sueldo_list"] = t_layout;
                }

                pageMode   = XVar.Clone(AddPage.readAddModeFromRequest());
                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)));
                var_params = XVar.Clone(XVar.Array());
                var_params.InitAndSetArrayItem(id, "id");
                var_params.InitAndSetArrayItem(xt, "xt");
                var_params.InitAndSetArrayItem(pageMode, "mode");
                var_params.InitAndSetArrayItem(Constants.PAGE_ADD, "pageType");
                var_params.InitAndSetArrayItem(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("page")), "pageName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("a")), "action");
                var_params.InitAndSetArrayItem(false, "needSearchClauseObj");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("afteradd")), "afterAdd_id");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("mastertable")), "masterTable");
                if (XVar.Pack(var_params["masterTable"]))
                {
                    dynamic i = null;
                    i = new XVar(1);
                    var_params.InitAndSetArrayItem(XVar.Array(), "masterKeysReq");
                    while (XVar.Pack(MVCFunctions.REQUESTKeyExists(MVCFunctions.Concat("masterkey", i))))
                    {
                        var_params.InitAndSetArrayItem(MVCFunctions.postvalue(MVCFunctions.Concat("masterkey", i)), "masterKeysReq", i);
                        i++;
                    }
                }


                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("dashelement")), "dashElementName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("fromDashboard")), "fromDashboard");
                var_params.InitAndSetArrayItem((XVar.Pack(var_params["fromDashboard"]) ? XVar.Pack(var_params["fromDashboard"]) : XVar.Pack(MVCFunctions.postvalue(new XVar("dashTName")))), "dashTName");
                if (pageMode == Constants.ADD_INLINE)
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("forLookup")), "forListPageLookup");
                    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");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("masterpagetype")), "masterPageType");
                }
                if ((XVar)(pageMode == Constants.ADD_ONTHEFLY) || (XVar)((XVar)(pageMode == Constants.ADD_INLINE) && (XVar)(MVCFunctions.postvalue(new XVar("forLookup")))))
                {
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("table")), "lookupTable");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("field")), "lookupField");
                    var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("pageType")), "lookupPageType");
                    if (XVar.Pack(MVCFunctions.postvalue(new XVar("parentsExist"))))
                    {
                        var_params.InitAndSetArrayItem(MVCFunctions.my_json_decode((XVar)(MVCFunctions.postvalue(new XVar("parentCtrlsData")))), "parentCtrlsData");
                    }
                }
                GlobalVars.pageObject = XVar.Clone(new AddPage((XVar)(var_params)));
                GlobalVars.pageObject.init();
                GlobalVars.pageObject.process();
                ViewBag.xt = xt;
                return(View(xt.GetViewPath()));
            }
            catch (RunnerRedirectException ex)
            { return(Redirect(ex.Message)); }
        }
Esempio n. 7
0
 public XVar checkduplicates()
 {
     try
     {
         dynamic         _connection = null, data = XVar.Array(), denyChecking = null, fieldControlType = null, fieldName = null, fieldSQL = null, hasDuplicates = null, pageType = null, qResult = null, regEmailMode = null, regUsernameMode = null, returnJSON = null, sql = null, tableName = null, value = null, where = null;
         ProjectSettings pSet;
         tableName        = XVar.Clone(MVCFunctions.postvalue(new XVar("tableName")));
         pageType         = XVar.Clone(MVCFunctions.postvalue(new XVar("pageType")));
         fieldName        = XVar.Clone(MVCFunctions.postvalue(new XVar("fieldName")));
         fieldControlType = XVar.Clone(MVCFunctions.postvalue(new XVar("fieldControlType")));
         value            = XVar.Clone(MVCFunctions.postvalue(new XVar("value")));
         if (XVar.Pack(!(XVar)(CommonFunctions.checkTableName((XVar)(tableName)))))
         {
             MVCFunctions.Echo(new XVar(0));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         Assembly.GetExecutingAssembly().GetType(MVCFunctions.Concat("runnerDotNet.", MVCFunctions.Concat("", tableName, ""),
                                                                     "_Variables")).InvokeMember("Apply", BindingFlags.InvokeMethod, null, null, null);
         if ((XVar)(pageType != Constants.PAGE_REGISTER) && (XVar)((XVar)(!(XVar)(CommonFunctions.isLogged())) || (XVar)(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Search"))))))
         {
             returnJSON = XVar.Clone(new XVar("success", false, "error", MVCFunctions.Concat("Error: You have not permissions to read the ", tableName, " table's data")));
             MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         _connection     = XVar.Clone(GlobalVars.cman.byTable((XVar)(GlobalVars.strTableName)));
         pSet            = XVar.UnPackProjectSettings(new ProjectSettings((XVar)(GlobalVars.strTableName), (XVar)(pageType)));
         denyChecking    = XVar.Clone(pSet.allowDuplicateValues((XVar)(fieldName)));
         regEmailMode    = new XVar(false);
         regUsernameMode = new XVar(false);
         if (XVar.Pack(denyChecking))
         {
             returnJSON = XVar.Clone(new XVar("success", false, "error", "Duplicated values are allowed"));
             MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         GlobalVars.cipherer = XVar.Clone(new RunnerCipherer((XVar)(GlobalVars.strTableName), (XVar)(pSet)));
         if (XVar.Pack(GlobalVars.cipherer.isFieldEncrypted((XVar)(fieldName))))
         {
             value = XVar.Clone(GlobalVars.cipherer.MakeDBValue((XVar)(fieldName), (XVar)(value), (XVar)(fieldControlType), new XVar(true)));
         }
         else
         {
             value = XVar.Clone(CommonFunctions.make_db_value((XVar)(fieldName), (XVar)(value), (XVar)(fieldControlType), new XVar(""), (XVar)(GlobalVars.strTableName)));
         }
         if (value == "null")
         {
             fieldSQL = XVar.Clone(RunnerPage._getFieldSQL((XVar)(fieldName), (XVar)(_connection), (XVar)(pSet)));
         }
         else
         {
             fieldSQL = XVar.Clone(RunnerPage._getFieldSQLDecrypt((XVar)(fieldName), (XVar)(_connection), (XVar)(pSet), (XVar)(GlobalVars.cipherer)));
         }
         where = XVar.Clone(MVCFunctions.Concat(fieldSQL, (XVar.Pack(value == "null") ? XVar.Pack(" is ") : XVar.Pack("=")), value));
         if (XVar.Pack(regEmailMode))
         {
             where = XVar.Clone(_connection.comparisonSQL((XVar)(fieldSQL), (XVar)(value), new XVar(true)));
         }
         if (XVar.Pack(regUsernameMode))
         {
             where = XVar.Clone(_connection.comparisonSQL((XVar)(fieldSQL), (XVar)(value), (XVar)(pSet.isCaseInsensitiveUsername())));
         }
         sql     = XVar.Clone(MVCFunctions.Concat("SELECT count(*) from ", _connection.addTableWrappers((XVar)(pSet.getOriginalTableName())), " where ", where));
         qResult = XVar.Clone(_connection.query((XVar)(sql)));
         if ((XVar)(!(XVar)(qResult)) || (XVar)(!(XVar)(data = XVar.Clone(qResult.fetchNumeric()))))
         {
             returnJSON = XVar.Clone(new XVar("success", false, "error", "Error: Wrong SQL query"));
             MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         hasDuplicates = XVar.Clone((XVar.Pack(data[0]) ? XVar.Pack(true) : XVar.Pack(false)));
         returnJSON    = XVar.Clone(new XVar("success", true, "hasDuplicates", hasDuplicates, "error", ""));
         MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
         return(MVCFunctions.GetBuferContentAndClearBufer());
     }
     catch (RunnerRedirectException ex)
     { return(Redirect(ex.Message)); }
 }
Esempio n. 8
0
        public virtual XVar getLinkData(dynamic data, dynamic _param_keylink, dynamic _param_html = null)
        {
            #region default values
            if (_param_html as Object == null)
            {
                _param_html = new XVar(true);
            }
            #endregion

            #region pass-by-value parameters
            dynamic keylink = XVar.Clone(_param_keylink);
            dynamic html    = XVar.Clone(_param_html);
            #endregion

            dynamic isExactMatched = null, lData = XVar.Array(), link = null, prefix = null, ret = null, target = null, title = null, var_type = null;
            if (XVar.Pack(!(XVar)(MVCFunctions.strlen((XVar)(data[this.field])))))
            {
                return(false);
            }
            ret   = XVar.Clone(data[this.field]);
            title = XVar.Clone(ret);
            link  = XVar.Clone(ret);
            if (MVCFunctions.substr((XVar)(ret), (XVar)(MVCFunctions.strlen((XVar)(ret)) - 1)) == "#")
            {
                dynamic i = null;
                i     = XVar.Clone(MVCFunctions.strpos((XVar)(ret), new XVar("#")));
                title = XVar.Clone(MVCFunctions.substr((XVar)(ret), new XVar(0), (XVar)(i)));
                link  = XVar.Clone(MVCFunctions.substr((XVar)(ret), (XVar)(i + 1), (XVar)((MVCFunctions.strlen((XVar)(ret)) - i) - 2)));
                if (XVar.Pack(!(XVar)(title)))
                {
                    title = XVar.Clone(link);
                }
            }
            prefix         = XVar.Clone(getContainer().pSet.getLinkPrefix((XVar)(this.field)));
            target         = XVar.Clone((XVar.Pack(getContainer().pSet.openLinkInNewWindow((XVar)(this.field))) ? XVar.Pack(" target=_blank") : XVar.Pack("")));
            var_type       = XVar.Clone(getContainer().pSet.getLinkType((XVar)(this.field)));
            isExactMatched = new XVar(false);
            if (XVar.Pack(this.searchHighlight))
            {
                dynamic searchData = XVar.Array();
                searchData = XVar.Clone(this.pageObject.searchClauseObj.getSearchToHighlight((XVar)(this.field)));
                if (XVar.Pack(searchData))
                {
                    isExactMatched = new XVar(true);
                    foreach (KeyValuePair <XVar, dynamic> searchWord in searchData["searchWords"].GetEnumerator())
                    {
                        if (searchWord.Value != data[this.field])
                        {
                            isExactMatched = new XVar(false);
                            break;
                        }
                    }
                }
            }
            if (var_type == 1)
            {
                if (XVar.Equals(XVar.Pack(getContainer().pSet.getLinkWordNameType((XVar)(this.field))), XVar.Pack("Text")))
                {
                    title = XVar.Clone(getContainer().pSet.getLinkWordText((XVar)(this.field)));
                }
                else
                {
                    title = XVar.Clone(CommonFunctions.GetCustomLabel((XVar)(getContainer().pSet.getLinkWordText((XVar)(this.field)))));
                }
                if (XVar.Pack(isExactMatched))
                {
                    title = XVar.Clone(addHighlightingSpan((XVar)(title)));
                }
            }
            else
            {
                if (var_type == 2)
                {
                    title = XVar.Clone(data[getContainer().pSet.getLinkDisplayField((XVar)(this.field))]);
                    if (XVar.Pack(isExactMatched))
                    {
                        title = XVar.Clone(addHighlightingSpan((XVar)(title)));
                    }
                    else
                    {
                        if ((XVar)(this.field == getContainer().pSet.getLinkDisplayField((XVar)(this.field))) && (XVar)(this.searchHighlight))
                        {
                            title = XVar.Clone(highlightSearchWord((XVar)(MVCFunctions.runner_htmlspecialchars((XVar)(title))), new XVar(true), new XVar("")));
                        }
                    }
                }
                else
                {
                    if (XVar.Pack(this.searchHighlight))
                    {
                        if (XVar.Pack(isExactMatched))
                        {
                            title = XVar.Clone(addHighlightingSpan((XVar)(MVCFunctions.Concat(prefix, title))));
                        }
                        else
                        {
                            title = XVar.Clone(MVCFunctions.Concat(prefix, highlightSearchWord((XVar)(MVCFunctions.runner_htmlspecialchars((XVar)(title))), new XVar(true), new XVar(""))));
                        }
                    }
                    else
                    {
                        title = XVar.Clone(MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.Concat(prefix, title))));
                    }
                }
            }
            if ((XVar)(XVar.Equals(XVar.Pack(MVCFunctions.strpos((XVar)(link), new XVar("://"))), XVar.Pack(false))) && (XVar)(MVCFunctions.substr((XVar)(link), new XVar(0), new XVar(7)) != "mailto:"))
            {
                link = XVar.Clone(MVCFunctions.Concat(prefix, link));
            }
            lData = XVar.Clone(XVar.Array());
            lData.InitAndSetArrayItem(link, "link");
            lData.InitAndSetArrayItem(target, "target");
            lData.InitAndSetArrayItem(title, "title");
            return(lData);
        }
Esempio n. 9
0
        public ActionResult print()
        {
            try
            {
                dynamic pageObject = null, strtablename = null, var_params = XVar.Array();
                XTempl  xt;
                CommonFunctions.add_nocache_headers();
                Saldo_Horas_Empleado_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 = "Saldo_Horas_Empleado_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["Saldo_Horas_Empleado_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)); }
        }
Esempio n. 10
0
        public static void InitLocale()
        {
            // locale settings

            GlobalVars.locale_info = new XVar();

            GlobalVars.locale_info["LOCALE_LANGNAME"] = "en";
            GlobalVars.locale_info["LOCALE_CTRYNAME"] = "US";
            // date settings
            GlobalVars.locale_info["LOCALE_ICENTURY"]   = "1";
            GlobalVars.locale_info["LOCALE_IDATE"]      = "0";
            GlobalVars.locale_info["LOCALE_ILDATE"]     = "0";
            GlobalVars.locale_info["LOCALE_SDATE"]      = "/";
            GlobalVars.locale_info["LOCALE_SLONGDATE"]  = "dddd, MMMM d, yyyy";
            GlobalVars.locale_info["LOCALE_SSHORTDATE"] = "M/d/yyyy";
            // weekday names
            GlobalVars.locale_info["LOCALE_IFIRSTDAYOFWEEK"] = "6";
            GlobalVars.locale_info["LOCALE_SDAYNAME1"]       = "Monday";
            GlobalVars.locale_info["LOCALE_SDAYNAME2"]       = "Tuesday";
            GlobalVars.locale_info["LOCALE_SDAYNAME3"]       = "Wednesday";
            GlobalVars.locale_info["LOCALE_SDAYNAME4"]       = "Thursday";
            GlobalVars.locale_info["LOCALE_SDAYNAME5"]       = "Friday";
            GlobalVars.locale_info["LOCALE_SDAYNAME6"]       = "Saturday";
            GlobalVars.locale_info["LOCALE_SDAYNAME7"]       = "Sunday";
            GlobalVars.locale_info["LOCALE_SABBREVDAYNAME1"] = "Mon";
            GlobalVars.locale_info["LOCALE_SABBREVDAYNAME2"] = "Tue";
            GlobalVars.locale_info["LOCALE_SABBREVDAYNAME3"] = "Wed";
            GlobalVars.locale_info["LOCALE_SABBREVDAYNAME4"] = "Thu";
            GlobalVars.locale_info["LOCALE_SABBREVDAYNAME5"] = "Fri";
            GlobalVars.locale_info["LOCALE_SABBREVDAYNAME6"] = "Sat";
            GlobalVars.locale_info["LOCALE_SABBREVDAYNAME7"] = "Sun";
            // month names
            GlobalVars.locale_info["LOCALE_SMONTHNAME1"]        = "January";
            GlobalVars.locale_info["LOCALE_SMONTHNAME2"]        = "February";
            GlobalVars.locale_info["LOCALE_SMONTHNAME3"]        = "March";
            GlobalVars.locale_info["LOCALE_SMONTHNAME4"]        = "April";
            GlobalVars.locale_info["LOCALE_SMONTHNAME5"]        = "May";
            GlobalVars.locale_info["LOCALE_SMONTHNAME6"]        = "June";
            GlobalVars.locale_info["LOCALE_SMONTHNAME7"]        = "July";
            GlobalVars.locale_info["LOCALE_SMONTHNAME8"]        = "August";
            GlobalVars.locale_info["LOCALE_SMONTHNAME9"]        = "September";
            GlobalVars.locale_info["LOCALE_SMONTHNAME10"]       = "October";
            GlobalVars.locale_info["LOCALE_SMONTHNAME11"]       = "November";
            GlobalVars.locale_info["LOCALE_SMONTHNAME12"]       = "December";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME1"]  = "Jan";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME2"]  = "Feb";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME3"]  = "Mar";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME4"]  = "Apr";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME5"]  = "May";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME6"]  = "Jun";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME7"]  = "Jul";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME8"]  = "Aug";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME9"]  = "Sep";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME10"] = "Oct";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME11"] = "Nov";
            GlobalVars.locale_info["LOCALE_SABBREVMONTHNAME12"] = "Dec";
            // time settings
            GlobalVars.locale_info["LOCALE_ITIME"]         = "0";
            GlobalVars.locale_info["LOCALE_ITIMEMARKPOSN"] = "0";
            GlobalVars.locale_info["LOCALE_ITLZERO"]       = "0";
            GlobalVars.locale_info["LOCALE_S1159"]         = "AM";
            GlobalVars.locale_info["LOCALE_S2359"]         = "PM";
            GlobalVars.locale_info["LOCALE_STIME"]         = ":";
            GlobalVars.locale_info["LOCALE_STIMEFORMAT"]   = "h:mm:ss tt";
            // currency settings
            GlobalVars.locale_info["LOCALE_ICURRDIGITS"]     = "2";
            GlobalVars.locale_info["LOCALE_ICURRENCY"]       = "0";
            GlobalVars.locale_info["LOCALE_INEGCURR"]        = "0";
            GlobalVars.locale_info["LOCALE_SCURRENCY"]       = "$";
            GlobalVars.locale_info["LOCALE_SMONDECIMALSEP"]  = ".";
            GlobalVars.locale_info["LOCALE_SMONGROUPING"]    = "3;0";
            GlobalVars.locale_info["LOCALE_SMONTHOUSANDSEP"] = ",";
            // numbers formatting settings
            GlobalVars.locale_info["LOCALE_IDIGITS"]       = "2";
            GlobalVars.locale_info["LOCALE_INEGNUMBER"]    = "1";
            GlobalVars.locale_info["LOCALE_SDECIMAL"]      = ".";
            GlobalVars.locale_info["LOCALE_SGROUPING"]     = "3;0";
            GlobalVars.locale_info["LOCALE_SNEGATIVESIGN"] = "-";
            GlobalVars.locale_info["LOCALE_SPOSITIVESIGN"] = "";
            GlobalVars.locale_info["LOCALE_STHOUSAND"]     = ",";

            GlobalVars.locale_info.InitAndSetArrayItem(CommonFunctions.GetLongDateFormat(), "LOCALE_ILONGDATE");
        }
Esempio n. 11
0
        public ActionResult edit()
        {
            try
            {
                dynamic id = null, keys = XVar.Array(), pageMode = null, pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                dbo__ABCSecurity_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("edit2"), new XVar("AvenueAvenue"), new XVar("MobileAvenue"));
                    t_layout.version           = 2;
                    t_layout.blocks["top"]     = XVar.Array();
                    t_layout.containers["all"] = XVar.Array();
                    t_layout.containers["all"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "master"));
                    t_layout.containers["master"] = XVar.Array();
                    t_layout.containers["master"].Add(new XVar("name", "masterinfo", "block", "mastertable_block", "substyle", 1));

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


                    t_layout.containers["all"].Add(new XVar("name", "wrapper", "block", "", "substyle", 1, "container", "edit"));
                    t_layout.containers["edit"] = XVar.Array();
                    t_layout.containers["edit"].Add(new XVar("name", "editheader", "block", "editheader", "substyle", 2));

                    t_layout.containers["edit"].Add(new XVar("name", "message", "block", "message_block", "substyle", 1));

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

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

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


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


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

                    t_layout.blocks["top"].Add("all");
                    GlobalVars.page_layouts["dbo__ABCSecurity_edit"] = 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("list6"), new XVar("AvenueAvenue"), new XVar("MobileAvenue"));
                    t_layout.version               = 2;
                    t_layout.blocks["center"]      = XVar.Array();
                    t_layout.containers["message"] = XVar.Array();
                    t_layout.containers["message"].Add(new XVar("name", "message", "block", "message_block", "substyle", 1));

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

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

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

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

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

                    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.skins["left"] = "menu";

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

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

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

                    t_layout.containers["toplinks"].Add(new XVar("name", "toplinks_advsearch", "block", "asearch_link", "substyle", 1));

                    t_layout.containers["toplinks"].Add(new XVar("name", "toplinks_import", "block", "import_link", "substyle", 1));

                    t_layout.containers["toplinks"].Add(new XVar("name", "toplinks_export", "block", "export_link", "substyle", 1));

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

                    t_layout.skins["toplinks"] = "2";

                    t_layout.blocks["top"].Add("toplinks");
                    t_layout.containers["hmenu"] = XVar.Array();
                    t_layout.containers["hmenu"].Add(new XVar("name", "hmenu", "block", "menu_block", "substyle", 1));

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

                    t_layout.blocks["top"].Add("hmenu");
                    t_layout.containers["search"] = XVar.Array();
                    t_layout.containers["search"].Add(new XVar("name", "search", "block", "searchform_block", "substyle", 1));

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

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

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

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

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

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

                    t_layout.blocks["top"].Add("search");
                    t_layout.containers["recordcontrols"] = XVar.Array();
                    t_layout.containers["recordcontrols"].Add(new XVar("name", "recordcontrols_new", "block", "newrecord_controls_block", "substyle", 1));

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

                    t_layout.skins["recordcontrols"] = "2";

                    t_layout.blocks["top"].Add("recordcontrols");
                    GlobalVars.page_layouts["dbo__ABCSecurity_list"] = 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";
                }

                pageMode = XVar.Clone(EditPage.readEditModeFromRequest());
                xt       = XVar.UnPackXTempl(new XTempl());
                id       = XVar.Clone(MVCFunctions.postvalue(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");
                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(GlobalVars.strTableName, "tName");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("a")), "action");
                var_params.InitAndSetArrayItem(MVCFunctions.postvalue(new XVar("fields")), "selectedFields");


                var_params.InitAndSetArrayItem(MVCFunctions.postvalue((XVar)(MVCFunctions.Concat("value_captcha_", 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)); }
        }
Esempio n. 12
0
 public override XVar getTextValue(dynamic data)
 {
     return(CommonFunctions.str_format_number((XVar)(data[this.field]), (XVar)(this.container.pSet.isDecimalDigits((XVar)(this.field)))));
 }
Esempio n. 13
0
        public ActionResult view()
        {
            try
            {
                dynamic keys = XVar.Array(), pageMode = null, pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                admin_members_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_members_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_members_view"] = 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          = "dbo_REGISTRO_HORAS_COMPESADAS_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_REGISTRO_HORAS_COMPESADAS_list"] = 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          = "dbo_Permisos2_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_Permisos2_list"] = 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)); }
        }
Esempio n. 14
0
        public override XVar buildControl(dynamic _param_value, dynamic _param_mode, dynamic _param_fieldNum, dynamic _param_validate, dynamic _param_additionalCtrlParams, dynamic _param_data)
        {
            #region pass-by-value parameters
            dynamic value                = XVar.Clone(_param_value);
            dynamic mode                 = XVar.Clone(_param_mode);
            dynamic fieldNum             = XVar.Clone(_param_fieldNum);
            dynamic validate             = XVar.Clone(_param_validate);
            dynamic additionalCtrlParams = XVar.Clone(_param_additionalCtrlParams);
            dynamic data                 = XVar.Clone(_param_data);
            #endregion

            dynamic nHeight = null;
            base.buildControl((XVar)(value), (XVar)(mode), (XVar)(fieldNum), (XVar)(validate), (XVar)(additionalCtrlParams), (XVar)(data));
            nHeight = XVar.Clone(this.pageObject.pSetEdit.getNRows((XVar)(this.field)));
            if (XVar.Pack(this.pageObject.pSetEdit.isUseRTE((XVar)(this.field))))
            {
                dynamic browser = null;
                value   = XVar.Clone(RTESafe((XVar)(value)));
                browser = new XVar("");
                if (MVCFunctions.postvalue("browser") == "ie")
                {
                    browser = new XVar("&browser=ie");
                }
                MVCFunctions.Echo(MVCFunctions.Concat("<iframe frameborder=\"0\" vspace=\"0\" hspace=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" id=\"", this.cfield, "\" ", (XVar.Pack((XVar)((XVar)(mode == Constants.MODE_INLINE_EDIT) || (XVar)(mode == Constants.MODE_INLINE_ADD)) && (XVar)(this.is508 == true)) ? XVar.Pack(MVCFunctions.Concat("alt=\"", this.strLabel, "\" ")) : XVar.Pack("")), "name=\"", this.cfield, "\" title=\"Basic rich text editor\" style='"));
                MVCFunctions.Echo(MVCFunctions.Concat("width: 100%; min-width:480px; height: ", nHeight + 100, "px;'"));
                MVCFunctions.Echo(MVCFunctions.Concat(" src=\"", MVCFunctions.GetTableLink(new XVar("rte"), new XVar(""), (XVar)(MVCFunctions.Concat("ptype=", this.pageObject.pageType, "&table=", CommonFunctions.GetTableURL((XVar)(this.pageObject.tName)), "&", "id=", this.id, "&", this.iquery, browser, "&", (XVar.Pack((XVar)(mode == Constants.MODE_ADD) || (XVar)(mode == Constants.MODE_INLINE_ADD)) ? XVar.Pack("action=add") : XVar.Pack(""))))), "\">"));
                MVCFunctions.Echo("</iframe>");
            }
            else
            {
                dynamic classString = null, style = null;
                classString = new XVar("");
                style       = XVar.Clone(MVCFunctions.Concat("height: ", nHeight, "px;"));
                if (XVar.Pack(this.pageObject.isBootstrap()))
                {
                    classString = new XVar(" class=\"form-control\"");
                }
                MVCFunctions.Echo(MVCFunctions.Concat("<textarea ", getPlaceholderAttr(), " id=\"", this.cfield, "\" ", classString, " alt=\"", this.strLabel, "\" name=\"", this.cfield, "\" style=\"", style, "\">", MVCFunctions.runner_htmlspecialchars((XVar)(value)), "</textarea>"));
            }
            buildControlEnd((XVar)(validate), (XVar)(mode));
            return(null);
        }
Esempio n. 15
0
        public virtual XVar sortTables()
        {
            dynamic addedTables = XVar.Array(), allTables = null, arr = XVar.Array(), groupsMap = XVar.Array(), menu = XVar.Array();

            this.sortedTables = XVar.Clone(XVar.Array());
            foreach (KeyValuePair <XVar, dynamic> _tbl in this.tables.GetEnumerator())
            {
                this.sortedTables.InitAndSetArrayItem(new XVar(0, _tbl.Key, 1, _tbl.Value[1]), null);
            }
            MVCFunctions.usort((XVar)(this.sortedTables), new XVar("rightsSortFunc"));
            this.alphaOrderedTables = XVar.Clone(XVar.Array());
            foreach (KeyValuePair <XVar, dynamic> t in this.sortedTables.GetEnumerator())
            {
                this.alphaOrderedTables.InitAndSetArrayItem(t.Value[0], null);
            }
            this.menuOrderedTables = XVar.Clone(XVar.Array());
            menu        = XVar.Clone(getMenuNodes());
            addedTables = XVar.Clone(XVar.Array());
            groupsMap   = XVar.Clone(XVar.Array());
            allTables   = XVar.Clone(CommonFunctions.GetTablesListWithoutSecurity());
            foreach (KeyValuePair <XVar, dynamic> m in menu.GetEnumerator())
            {
                arr = XVar.Clone(XVar.Array());
                if ((XVar)(m.Value["pageType"] == "WebReports") || (XVar)(m.Value["type"] == "Separator"))
                {
                    continue;
                }
                if ((XVar)((XVar)(m.Value["table"]) && (XVar)(!(XVar)(addedTables[m.Value["table"]]))) && (XVar)(!XVar.Equals(XVar.Pack(MVCFunctions.array_search((XVar)(m.Value["table"]), (XVar)(allTables))), XVar.Pack(false))))
                {
                    addedTables.InitAndSetArrayItem(true, m.Value["table"]);
                    arr.InitAndSetArrayItem(m.Value["table"], "table");
                }
                if (XVar.Pack(m.Value["parent"]))
                {
                    arr.InitAndSetArrayItem(groupsMap[m.Value["parent"]], "parent");
                    this.menuOrderedTables.InitAndSetArrayItem(MVCFunctions.count(this.menuOrderedTables), arr["parent"], "items", null);
                }
                if ((XVar)(true) || (XVar)(m.Value["type"] == "Group"))
                {
                    groupsMap.InitAndSetArrayItem(MVCFunctions.count(this.menuOrderedTables), m.Value["id"]);
                    arr.InitAndSetArrayItem(m.Value["title"], "title");
                    arr.InitAndSetArrayItem(XVar.Array(), "items");
                    arr.InitAndSetArrayItem(true, "collapsed");
                }
                this.menuOrderedTables.InitAndSetArrayItem(arr, null);
            }
            if (MVCFunctions.count(addedTables) < MVCFunctions.count(this.alphaOrderedTables))
            {
                dynamic unlistedId = null;
                unlistedId = XVar.Clone(MVCFunctions.count(this.menuOrderedTables));
                arr        = XVar.Clone(XVar.Array());
                arr.InitAndSetArrayItem(true, "collapsed");
                arr.InitAndSetArrayItem("Unlisted tables", "title");
                arr.InitAndSetArrayItem(XVar.Array(), "items");
                this.menuOrderedTables.InitAndSetArrayItem(arr, null);
                foreach (KeyValuePair <XVar, dynamic> table in this.alphaOrderedTables.GetEnumerator())
                {
                    if (XVar.Pack(!(XVar)(addedTables[table.Value])))
                    {
                        this.menuOrderedTables.InitAndSetArrayItem(MVCFunctions.count(this.menuOrderedTables), unlistedId, "items", null);
                        this.menuOrderedTables.InitAndSetArrayItem(new XVar("table", table.Value, "parent", unlistedId), null);
                    }
                }
            }
            return(null);
        }
Esempio n. 16
0
        public virtual XVar buildSearchCtrlBlockArr(dynamic _param_recId, dynamic _param_fName, dynamic _param_ctrlInd, dynamic _param_opt, dynamic _param_not, dynamic _param_isChached, dynamic _param_val1, dynamic _param_val2, dynamic _param_panelField = null, dynamic _param_flexible = null, dynamic _param_immutable = null, dynamic _param_both = null)
        {
            #region default values
            if (_param_panelField as Object == null)
            {
                _param_panelField = new XVar(false);
            }
            if (_param_flexible as Object == null)
            {
                _param_flexible = new XVar(true);
            }
            if (_param_immutable as Object == null)
            {
                _param_immutable = new XVar(false);
            }
            if (_param_both as Object == null)
            {
                _param_both = new XVar(false);
            }
            #endregion

            #region pass-by-value parameters
            dynamic recId      = XVar.Clone(_param_recId);
            dynamic fName      = XVar.Clone(_param_fName);
            dynamic ctrlInd    = XVar.Clone(_param_ctrlInd);
            dynamic opt        = XVar.Clone(_param_opt);
            dynamic var_not    = XVar.Clone(_param_not);
            dynamic isChached  = XVar.Clone(_param_isChached);
            dynamic val1       = XVar.Clone(_param_val1);
            dynamic val2       = XVar.Clone(_param_val2);
            dynamic panelField = XVar.Clone(_param_panelField);
            dynamic flexible   = XVar.Clone(_param_flexible);
            dynamic immutable  = XVar.Clone(_param_immutable);
            dynamic both       = XVar.Clone(_param_both);
            #endregion

            dynamic filterRowAttrs = null, filterRowId = null, postfix = null, renderHidden = null, srchCtrlBlock = XVar.Array();
            srchCtrlBlock = XVar.Clone(XVar.Array());
            postfix       = new XVar("");
            if (XVar.Pack(panelField))
            {
                postfix = XVar.Clone(MVCFunctions.Concat("_", MVCFunctions.GoodFieldName((XVar)(fName))));
            }
            if (opt == XVar.Pack(""))
            {
                opt = XVar.Clone(this.pSet.getDefaultSearchOption((XVar)(fName)));
            }
            renderHidden = XVar.Clone((XVar)(MVCFunctions.strtolower((XVar)(opt)) == "empty") || (XVar)(MVCFunctions.strtolower((XVar)(opt)) == "not empty"));
            srchCtrlBlock.InitAndSetArrayItem(getCtrlParamsArr((XVar)(fName), (XVar)(recId), (XVar)(ctrlInd), (XVar)(val1), (XVar)(opt), (XVar)(renderHidden), (XVar)(isChached)), MVCFunctions.Concat("searchcontrol", postfix));
            renderHidden = XVar.Clone((XVar)(MVCFunctions.strtolower((XVar)(opt)) != "between") && (XVar)(MVCFunctions.strtolower((XVar)(opt)) != "not between"));
            if ((XVar)(flexible) || (XVar)(!(XVar)(renderHidden)))
            {
                srchCtrlBlock.InitAndSetArrayItem(getSecCtrlParamsArr((XVar)(fName), (XVar)(recId), (XVar)(ctrlInd), (XVar)(val2), (XVar)(opt), (XVar)(renderHidden), (XVar)(isChached)), MVCFunctions.Concat("searchcontrol1", postfix));
            }
            if (XVar.Pack(!(XVar)(immutable)))
            {
                srchCtrlBlock.InitAndSetArrayItem(getDelButtonHtml((XVar)(fName), (XVar)(recId)), "delCtrlButt");
            }
            filterRowId    = XVar.Clone(getFilterRowId((XVar)(recId), (XVar)(fName)));
            filterRowAttrs = XVar.Clone(MVCFunctions.Concat("id=\"", filterRowId, "\" "));
            if (XVar.Pack(isChached))
            {
                filterRowAttrs = MVCFunctions.Concat(filterRowAttrs, this.dispNoneStyle);
            }
            srchCtrlBlock.InitAndSetArrayItem(filterRowAttrs, MVCFunctions.Concat("filterRow_attrs", postfix));
            if (XVar.Pack(immutable))
            {
                srchCtrlBlock.InitAndSetArrayItem("rnr-basic-search-field", MVCFunctions.Concat("filterRow_class", postfix));
            }
            srchCtrlBlock.InitAndSetArrayItem(fName, "fName");
            srchCtrlBlock.InitAndSetArrayItem(getCtrlSearchType((XVar)(fName), (XVar)(recId), (XVar)(ctrlInd), (XVar)(opt), (XVar)(var_not), (XVar)(flexible), (XVar)(both)), MVCFunctions.Concat("searchtype", postfix));
            srchCtrlBlock.InitAndSetArrayItem(getNotBox((XVar)(fName), (XVar)(recId), (XVar)(var_not)), "notbox");
            srchCtrlBlock.InitAndSetArrayItem(CommonFunctions.GetFieldLabel((XVar)(MVCFunctions.GoodFieldName((XVar)(this.tName))), (XVar)(MVCFunctions.GoodFieldName((XVar)(fName)))), MVCFunctions.Concat("fLabel", postfix));
            return(srchCtrlBlock);
        }
Esempio n. 17
0
 public override XVar addCommonHtml()
 {
     this.body["begin"] = MVCFunctions.Concat(this.body["begin"], CommonFunctions.GetBaseScriptsForPage((XVar)(this.isDisplayLoading)));
     this.body.InitAndSetArrayItem(XTempl.create_method_assignment(new XVar("assignBodyEnd"), this), "end");
     return(null);
 }
Esempio n. 18
0
        public virtual XVar SQLWhere(dynamic _param_SearchFor, dynamic _param_strSearchOption, dynamic _param_SearchFor2, dynamic _param_etype, dynamic _param_isSuggest)
        {
            #region pass-by-value parameters
            dynamic SearchFor       = XVar.Clone(_param_SearchFor);
            dynamic strSearchOption = XVar.Clone(_param_strSearchOption);
            dynamic SearchFor2      = XVar.Clone(_param_SearchFor2);
            dynamic etype           = XVar.Clone(_param_etype);
            dynamic isSuggest       = XVar.Clone(_param_isSuggest);
            #endregion

            dynamic baseResult = null, cleanvalue2 = null, gstrField = null, searchIsCaseInsensitive = null, value1 = null, value2 = null;
            baseResult = XVar.Clone(baseSQLWhere((XVar)(strSearchOption)));
            if (XVar.Equals(XVar.Pack(baseResult), XVar.Pack(false)))
            {
                return("");
            }
            if (baseResult != XVar.Pack(""))
            {
                return(baseResult);
            }
            if ((XVar)(!(XVar)(MVCFunctions.strlen((XVar)(SearchFor)))) && (XVar)(!(XVar)(MVCFunctions.strlen((XVar)(SearchFor2)))))
            {
                return("");
            }
            value1      = XVar.Clone(this.pageObject.cipherer.MakeDBValue((XVar)(this.field), (XVar)(SearchFor), (XVar)(etype), new XVar(true)));
            value2      = new XVar(false);
            cleanvalue2 = new XVar(false);
            if (strSearchOption == "Between")
            {
                cleanvalue2 = XVar.Clone(CommonFunctions.prepare_for_db((XVar)(this.field), (XVar)(SearchFor2), (XVar)(etype)));
                value2      = XVar.Clone(CommonFunctions.make_db_value((XVar)(this.field), (XVar)(SearchFor2), (XVar)(etype)));
            }
            if ((XVar)((XVar)((XVar)(strSearchOption != "Contains") && (XVar)(strSearchOption != "Starts with")) && (XVar)((XVar)(XVar.Equals(XVar.Pack(value1), XVar.Pack("null"))) && (XVar)(XVar.Equals(XVar.Pack(value2), XVar.Pack("null"))))) && (XVar)(!(XVar)(this.pageObject.cipherer.isFieldPHPEncrypted((XVar)(this.field)))))
            {
                return("");
            }
            if ((XVar)((XVar)(strSearchOption == "Contains") || (XVar)(strSearchOption == "Starts with")) && (XVar)(!(XVar)(isStringValidForLike((XVar)(SearchFor)))))
            {
                return("");
            }
            searchIsCaseInsensitive = XVar.Clone(this.pageObject.pSetEdit.getNCSearch());
            if ((XVar)(CommonFunctions.IsCharType((XVar)(this.var_type))) && (XVar)(!(XVar)(this.btexttype)))
            {
                gstrField = XVar.Clone(getFieldSQLDecrypt());
                if ((XVar)(!(XVar)(this.pageObject.cipherer.isFieldPHPEncrypted((XVar)(this.field)))) && (XVar)(searchIsCaseInsensitive))
                {
                    if (XVar.Pack(MVCFunctions.strlen((XVar)(SearchFor))))
                    {
                        value1 = XVar.Clone(this.connection.upper((XVar)(value1)));
                    }
                    if (XVar.Pack(MVCFunctions.strlen((XVar)(SearchFor2))))
                    {
                        value2 = XVar.Clone(this.connection.upper((XVar)(value2)));
                    }
                    gstrField = XVar.Clone(this.connection.upper((XVar)(gstrField)));
                }
            }
            else
            {
                if ((XVar)(strSearchOption == "Contains") || (XVar)(strSearchOption == "Starts with"))
                {
                    gstrField = XVar.Clone(this.connection.field2char((XVar)(getFieldSQLDecrypt()), (XVar)(this.var_type)));
                }
                else
                {
                    if (this.pageObject.pSetEdit.getViewFormat((XVar)(this.field)) == Constants.FORMAT_TIME)
                    {
                        gstrField = XVar.Clone(this.connection.field2time((XVar)(getFieldSQLDecrypt()), (XVar)(this.var_type)));
                    }
                    else
                    {
                        gstrField = XVar.Clone(getFieldSQLDecrypt());
                    }
                }
            }
            if (strSearchOption == "Contains")
            {
                if (XVar.Pack(this.pageObject.cipherer.isFieldPHPEncrypted((XVar)(this.field))))
                {
                    return(MVCFunctions.Concat(gstrField, "=", this.pageObject.cipherer.MakeDBValue((XVar)(this.field), (XVar)(SearchFor))));
                }
                SearchFor = XVar.Clone(this.connection.escapeLIKEpattern((XVar)(SearchFor)));
                if ((XVar)((XVar)(CommonFunctions.IsCharType((XVar)(this.var_type))) && (XVar)(!(XVar)(this.btexttype))) && (XVar)(searchIsCaseInsensitive))
                {
                    return(MVCFunctions.Concat(gstrField, " ", this.var_like, " ", this.connection.upper((XVar)(this.connection.prepareString((XVar)(MVCFunctions.Concat("%", SearchFor, "%")))))));
                }
                return(MVCFunctions.Concat(gstrField, " ", this.var_like, " ", this.connection.prepareString((XVar)(MVCFunctions.Concat("%", SearchFor, "%")))));
            }
            if (strSearchOption == "Equals")
            {
                return(MVCFunctions.Concat(gstrField, "=", value1));
            }
            if (strSearchOption == "Starts with")
            {
                SearchFor = XVar.Clone(this.connection.escapeLIKEpattern((XVar)(SearchFor)));
                if ((XVar)((XVar)(CommonFunctions.IsCharType((XVar)(this.var_type))) && (XVar)(!(XVar)(this.btexttype))) && (XVar)(searchIsCaseInsensitive))
                {
                    return(MVCFunctions.Concat(gstrField, " ", this.var_like, " ", this.connection.upper((XVar)(this.connection.prepareString((XVar)(MVCFunctions.Concat(SearchFor, "%")))))));
                }
                return(MVCFunctions.Concat(gstrField, " ", this.var_like, " ", this.connection.prepareString((XVar)(MVCFunctions.Concat(SearchFor, "%")))));
            }
            if (strSearchOption == "More than")
            {
                return(MVCFunctions.Concat(gstrField, ">", value1));
            }
            if (strSearchOption == "Less than")
            {
                return(MVCFunctions.Concat(gstrField, "<", value1));
            }
            if (strSearchOption == "Equal or more than")
            {
                return(MVCFunctions.Concat(gstrField, ">=", value1));
            }
            if (strSearchOption == "Equal or less than")
            {
                return(MVCFunctions.Concat(gstrField, "<=", value1));
            }
            if (strSearchOption == "Between")
            {
                dynamic betweenRange = XVar.Array();
                betweenRange = XVar.Clone(XVar.Array());
                if ((XVar)(!XVar.Equals(XVar.Pack(value1), XVar.Pack("null"))) && (XVar)(MVCFunctions.strlen((XVar)(SearchFor))))
                {
                    betweenRange.InitAndSetArrayItem(MVCFunctions.Concat(gstrField, ">=", value1), "from");
                }
                if ((XVar)(!XVar.Equals(XVar.Pack(value2), XVar.Pack("null"))) && (XVar)(MVCFunctions.strlen((XVar)(SearchFor2))))
                {
                    if (XVar.Pack(CommonFunctions.IsDateFieldType((XVar)(this.var_type))))
                    {
                        dynamic timeArr = XVar.Array();
                        timeArr = XVar.Clone(CommonFunctions.db2time((XVar)(cleanvalue2)));
                        if ((XVar)((XVar)(timeArr[3] == 0) && (XVar)(timeArr[4] == 0)) && (XVar)(timeArr[5] == 0))
                        {
                            timeArr = XVar.Clone(CommonFunctions.adddays((XVar)(timeArr), new XVar(1)));
                            value2  = XVar.Clone(MVCFunctions.mysprintf(new XVar("%02d-%02d-%02d"), (XVar)(timeArr)));
                            value2  = XVar.Clone(CommonFunctions.add_db_quotes((XVar)(this.field), (XVar)(value2), (XVar)(this.pageObject.tName)));
                            betweenRange.InitAndSetArrayItem(MVCFunctions.Concat(gstrField, "<", value2), "to");
                        }
                        else
                        {
                            betweenRange.InitAndSetArrayItem(MVCFunctions.Concat(gstrField, "<=", value2), "to");
                        }
                    }
                    else
                    {
                        betweenRange.InitAndSetArrayItem(MVCFunctions.Concat(gstrField, "<=", value2), "to");
                    }
                }
                return(MVCFunctions.implode(new XVar(" and "), (XVar)(betweenRange)));
            }
            return("");
        }
Esempio n. 19
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();
                dbo_EMPLEADO_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        = "dbo_EMPLEADO_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["dbo_EMPLEADO_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("dbo_EMPLEADO", "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)); }
        }
Esempio n. 20
0
        public virtual XVar suggestValue(dynamic _param_value, dynamic _param_searchFor, dynamic var_response, dynamic row)
        {
            #region pass-by-value parameters
            dynamic value     = XVar.Clone(_param_value);
            dynamic searchFor = XVar.Clone(_param_searchFor);
            #endregion

            dynamic SuggestStringSize = null, realValue = null, viewFormat = null;
            SuggestStringSize = XVar.Clone(CommonFunctions.GetGlobalData(new XVar("suggestStringSize"), new XVar(40)));
            if (SuggestStringSize <= MVCFunctions.runner_strlen((XVar)(searchFor)))
            {
                var_response.InitAndSetArrayItem(searchFor, MVCFunctions.Concat("_", searchFor));
                return(null);
            }
            viewFormat = XVar.Clone(this.pageObject.pSetEdit.getViewFormat((XVar)(this.field)));
            if (viewFormat == Constants.FORMAT_NUMBER)
            {
                dynamic dotPosition = null;
                dotPosition = XVar.Clone(MVCFunctions.strpos((XVar)(value), new XVar(".")));
                if (!XVar.Equals(XVar.Pack(dotPosition), XVar.Pack(false)))
                {
                    dynamic i = null;
                    i = XVar.Clone(MVCFunctions.strlen((XVar)(value)) - 1);
                    for (; dotPosition < i; i--)
                    {
                        if (MVCFunctions.substr((XVar)(value), (XVar)(i), new XVar(1)) != "0")
                        {
                            if (i < MVCFunctions.strlen((XVar)(value)) - 1)
                            {
                                value = XVar.Clone(MVCFunctions.substr((XVar)(value), new XVar(0), (XVar)(i + 1)));
                            }
                            break;
                        }
                        if ((XVar)(i == dotPosition + 1) && (XVar)(XVar.Pack(0) < dotPosition))
                        {
                            value = XVar.Clone(MVCFunctions.substr((XVar)(value), new XVar(0), (XVar)(dotPosition)));
                            break;
                        }
                    }
                }
            }
            realValue = XVar.Clone(value);
            if (viewFormat == Constants.FORMAT_HTML)
            {
                dynamic get_text = null, html_tags = null, match = XVar.Array();
                html_tags = XVar.Clone(MVCFunctions.Concat("/<.*?>/i", (XVar.Pack(GlobalVars.useUTF8) ? XVar.Pack("u") : XVar.Pack(""))));
                get_text  = XVar.Clone(MVCFunctions.Concat("/(.*<.*>|^.*?)([.]*", MVCFunctions.preg_quote((XVar)(searchFor), new XVar("/")), ".*?)(<.*>|$)/i", (XVar.Pack(GlobalVars.useUTF8) ? XVar.Pack("u") : XVar.Pack(""))));
                value     = XVar.Clone(MVCFunctions.preg_replace((XVar)(html_tags), new XVar(""), (XVar)(MVCFunctions.runner_html_entity_decode((XVar)(value)))));
                if (XVar.Equals(XVar.Pack(MVCFunctions.stristr((XVar)(value), (XVar)(searchFor))), XVar.Pack(false)))
                {
                    return(null);
                }
                if (XVar.Pack(MVCFunctions.preg_match((XVar)(get_text), (XVar)(realValue), (XVar)(match))))
                {
                    realValue = XVar.Clone(match[2]);
                }
                else
                {
                    realValue = XVar.Clone(value);
                }
            }
            if (SuggestStringSize < MVCFunctions.runner_strlen((XVar)(value)))
            {
                dynamic startPos = null, valueLength = null;
                startPos    = new XVar(0);
                valueLength = new XVar(0);
                value       = XVar.Clone(cutStr((XVar)(value), (XVar)(searchFor), (XVar)(SuggestStringSize), ref startPos, ref valueLength));
                if (!XVar.Equals(XVar.Pack(viewFormat), XVar.Pack(Constants.FORMAT_HTML)))
                {
                    realValue = XVar.Clone(value);
                }
                if (XVar.Pack(0) < startPos)
                {
                    value = XVar.Clone(MVCFunctions.Concat("...", value));
                }
                if (startPos + SuggestStringSize != valueLength)
                {
                    value = MVCFunctions.Concat(value, "...");
                }
            }
            var_response.InitAndSetArrayItem(realValue, value);
            return(null);
        }
Esempio n. 21
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_Preferencias_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_Preferencias_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_Preferencias_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)); }
        }
Esempio n. 22
0
        public override XVar buildControl(dynamic _param_value, dynamic _param_mode, dynamic _param_fieldNum, dynamic _param_validate, dynamic _param_additionalCtrlParams, dynamic _param_data)
        {
            #region pass-by-value parameters
            dynamic value                = XVar.Clone(_param_value);
            dynamic mode                 = XVar.Clone(_param_mode);
            dynamic fieldNum             = XVar.Clone(_param_fieldNum);
            dynamic validate             = XVar.Clone(_param_validate);
            dynamic additionalCtrlParams = XVar.Clone(_param_additionalCtrlParams);
            dynamic data                 = XVar.Clone(_param_data);
            #endregion

            dynamic         alt = null, classString = null, controlWidth = null, dateEditType = null, dayStyle = null, dp = null, fmt = null, hasImgCal = null, initDayOpt = null, initMonthOpt = null, initYearOpt = null, monthStyle = null, ovalue = null, ovalue1 = null, ret = null, retday = null, retmonth = null, retyear = null, setHiddenElem = null, showTime = null, space = null, time = XVar.Array(), tvalue = null, yearStyle = null;
            ProjectSettings pSet;
            base.buildControl((XVar)(value), (XVar)(mode), (XVar)(fieldNum), (XVar)(validate), (XVar)(additionalCtrlParams), (XVar)(data));
            if (XVar.Pack(fieldNum))
            {
                this.cfield = XVar.Clone(MVCFunctions.Concat("value", fieldNum, "_", MVCFunctions.GoodFieldName((XVar)(this.field)), "_", this.id));
            }
            pSet         = XVar.UnPackProjectSettings(getProjectSettings());
            dateEditType = XVar.Clone(getDateEditType((XVar)(pSet)));
            MVCFunctions.Echo(MVCFunctions.Concat("<input id=\"", this.ctype, "\" type=\"hidden\" name=\"", this.ctype, "\" value=\"date", dateEditType, "\">"));
            tvalue = XVar.Clone(value);
            time   = XVar.Clone(CommonFunctions.db2time((XVar)(tvalue)));
            if (XVar.Pack(!(XVar)(MVCFunctions.count(time))))
            {
                time = XVar.Clone(new XVar(0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0));
            }
            classString = new XVar("");
            if (this.pageObject.getLayoutVersion() == Constants.BOOTSTRAP_LAYOUT)
            {
                classString = new XVar(" form-control");
            }
            dp        = new XVar(0);
            hasImgCal = new XVar(true);
            showTime  = XVar.Clone(pSet.dateEditShowTime((XVar)(this.field)));
            switch (((XVar)dateEditType).ToInt())
            {
            case Constants.EDIT_DATE_SIMPLE_INLINE:
            case Constants.EDIT_DATE_SIMPLE_DP:
                if (dateEditType == Constants.EDIT_DATE_SIMPLE_INLINE)
                {
                    hasImgCal = new XVar(false);
                }
                ovalue = XVar.Clone(value);
                if (GlobalVars.locale_info["LOCALE_IDATE"] == 1)
                {
                    fmt = XVar.Clone(MVCFunctions.Concat("dd", GlobalVars.locale_info["LOCALE_SDATE"], "MM", GlobalVars.locale_info["LOCALE_SDATE"], "yyyy"));
                }
                else
                {
                    if (GlobalVars.locale_info["LOCALE_IDATE"] == 0)
                    {
                        fmt = XVar.Clone(MVCFunctions.Concat("MM", GlobalVars.locale_info["LOCALE_SDATE"], "dd", GlobalVars.locale_info["LOCALE_SDATE"], "yyyy"));
                    }
                    else
                    {
                        fmt = XVar.Clone(MVCFunctions.Concat("yyyy", GlobalVars.locale_info["LOCALE_SDATE"], "MM", GlobalVars.locale_info["LOCALE_SDATE"], "dd"));
                    }
                }
                if ((XVar)((XVar)((XVar)(showTime) || (XVar)(time[3])) || (XVar)(time[4])) || (XVar)(time[5]))
                {
                    dynamic timeAttrs = null;
                    timeAttrs = XVar.Clone(this.pageObject.pSetEdit.getFormatTimeAttrs((XVar)(this.field)));
                    fmt       = MVCFunctions.Concat(fmt, " ", GlobalVars.locale_info["LOCALE_STIMEFORMAT"]);
                }
                if (XVar.Pack(time[0]))
                {
                    ovalue = XVar.Clone(CommonFunctions.format_datetime_custom((XVar)(time), (XVar)(fmt)));
                }
                ovalue1 = XVar.Clone(MVCFunctions.Concat(time[2], "-", time[1], "-", time[0]));
                if ((XVar)((XVar)((XVar)(showTime) || (XVar)(time[3])) || (XVar)(time[4])) || (XVar)(time[5]))
                {
                    ovalue1 = MVCFunctions.Concat(ovalue1, " ", time[3], ":", time[4], ":", time[5]);
                }
                ret = XVar.Clone(MVCFunctions.Concat("<input ", getPlaceholderAttr(), " id=\"", this.cfield, "\" ", this.inputStyle, " class=\"", classString, "\" type=\"Text\" name=\"", this.cfield, "\" value=\"", ovalue, "\">"));
                ret = MVCFunctions.Concat(ret, "<input id=\"ts", this.cfield, "\" type=\"Hidden\" name=\"ts", this.cfield, "\" value=\"", ovalue1, "\">");
                if (this.pageObject.getLayoutVersion() == Constants.BOOTSTRAP_LAYOUT)
                {
                    ret = MVCFunctions.Concat(ret, "<span class=\"input-group-addon\" id=\"imgCal_", this.cfield, "\"><span class=\"glyphicon glyphicon-calendar\"></span></span>");
                }
                else
                {
                    if (XVar.Pack(hasImgCal))
                    {
                        ret = MVCFunctions.Concat(ret, "<a href=\"#\" id=\"imgCal_", this.cfield, "\" data-icon=\"calendar\" title=\"Click Here to Pick up the date\"></a>");
                    }
                }
                if (this.pageObject.getLayoutVersion() == Constants.BOOTSTRAP_LAYOUT)
                {
                    if (XVar.Pack(CommonFunctions.isRTL()))
                    {
                        ret = MVCFunctions.Concat(ret, "<span></span>");
                    }
                    ret = XVar.Clone(MVCFunctions.Concat("<div class=\"input-group date\">", ret, "</div>"));
                }
                MVCFunctions.Echo(ret);
                break;

            case Constants.EDIT_DATE_DD_INLINE:
            case Constants.EDIT_DATE_DD_DP:
            case Constants.EDIT_DATE_DD:
                if ((dateEditType == Constants.EDIT_DATE_DD_INLINE) || (dateEditType == Constants.EDIT_DATE_DD_DP))
                {
                    dp = new XVar(1);
                }
                controlWidth = XVar.Clone(pSet.getControlWidth((XVar)(this.field)));
                if (XVar.Pack(0) < controlWidth)
                {
                    dynamic dayWidth = null, mothWidth = null, yearWidth = null;
                    controlWidth -= 10;
                    yearWidth     = XVar.Clone((XVar)Math.Floor((double)(controlWidth * 0.300000)));
                    yearStyle     = XVar.Clone(MVCFunctions.Concat("style=\"min-width: ", yearWidth, "px;margin-right:5px;\" "));
                    dayWidth      = XVar.Clone((XVar)Math.Floor((double)(controlWidth * 0.200000)));
                    dayStyle      = XVar.Clone(MVCFunctions.Concat("style=\"min-width: ", dayWidth, "px; margin-right:5px;\" "));
                    mothWidth     = XVar.Clone((controlWidth - yearWidth) - dayWidth);
                    monthStyle    = XVar.Clone(MVCFunctions.Concat("style=\"min-width: ", mothWidth, "px; margin-right:5px;\" "));
                }
                else
                {
                    dayStyle   = new XVar("");
                    monthStyle = new XVar("");
                    yearStyle  = new XVar("");
                }
                alt          = XVar.Clone(MVCFunctions.Concat("alt=\"", this.strLabel, "\" "));
                initMonthOpt = new XVar("<option>&nbsp;</option>");
                if (XVar.Pack(time[1]))
                {
                    dynamic months = XVar.Array();
                    months       = XVar.Clone(CommonFunctions.getMountNames());
                    initMonthOpt = XVar.Clone(MVCFunctions.Concat("<option>", months[time[1]], "</option>"));
                }
                initMonthOpt = MVCFunctions.Concat(initMonthOpt, "<option>", maxLengthMonth(), "</option>");
                initDayOpt   = XVar.Clone(MVCFunctions.Concat("<option>", (XVar.Pack(time[2]) ? XVar.Pack(time[2]) : XVar.Pack("&nbsp;")), " </option><option>22</option>"));
                initYearOpt  = XVar.Clone(MVCFunctions.Concat("<option>", (XVar.Pack(time[0]) ? XVar.Pack(time[0]) : XVar.Pack("&nbsp;")), "</option><option>2000</option>"));
                retday       = XVar.Clone(MVCFunctions.Concat("<select class=\"", classString, "\" id=\"day", this.cfield, "\" ", dayStyle, alt, "name=\"day", this.cfield, "\" >", initDayOpt, "</select>"));
                retmonth     = XVar.Clone(MVCFunctions.Concat("<select class=\"", classString, "\" id=\"month", this.cfield, "\" ", monthStyle, alt, "name=\"month", this.cfield, "\" >", initMonthOpt, "</option></select>"));
                retyear      = XVar.Clone(MVCFunctions.Concat("<select class=\"", classString, "\" id=\"year", this.cfield, "\" ", yearStyle, alt, "name=\"year", this.cfield, "\" >", initYearOpt, "</select>"));
                space        = XVar.Clone((XVar.Pack(XVar.Pack(0) < controlWidth) ? XVar.Pack("") : XVar.Pack("&nbsp;")));
                if (GlobalVars.locale_info["LOCALE_ILONGDATE"] == 1)
                {
                    ret = XVar.Clone(MVCFunctions.Concat(retday, space, retmonth, space, retyear));
                }
                else
                {
                    if (GlobalVars.locale_info["LOCALE_ILONGDATE"] == 0)
                    {
                        ret = XVar.Clone(MVCFunctions.Concat(retmonth, space, retday, space, retyear));
                    }
                    else
                    {
                        ret = XVar.Clone(MVCFunctions.Concat(retyear, space, retmonth, space, retday));
                    }
                }
                setHiddenElem = new XVar("type=hidden");
                if (this.pageObject.getLayoutVersion() == Constants.BOOTSTRAP_LAYOUT)
                {
                    setHiddenElem = XVar.Clone(MVCFunctions.Concat("class=\"", classString, " hiddenPickerElement\""));
                }
                if ((XVar)((XVar)(time[0]) && (XVar)(time[1])) && (XVar)(time[2]))
                {
                    ret = MVCFunctions.Concat(ret, "<input id=\"", this.cfield, "\" ", setHiddenElem, " name=\"", this.cfield, "\" value=\"", time[0], "-", time[1], "-", time[2], "\">");
                }
                else
                {
                    ret = MVCFunctions.Concat(ret, "<input id=\"", this.cfield, "\" ", setHiddenElem, " name=\"", this.cfield, "\" value=\"\">");
                }
                if (XVar.Pack(dp))
                {
                    if (this.pageObject.getLayoutVersion() == Constants.BOOTSTRAP_LAYOUT)
                    {
                        ret = MVCFunctions.Concat(ret, "<button class=\"btn btn-default\" id=\"imgCal_", this.cfield, "\" aria-hidden=true><span class=\"glyphicon glyphicon-calendar\"  ></span></button>");
                    }
                    else
                    {
                        ret = MVCFunctions.Concat(ret, "<a href=\"#\" id=\"imgCal_", this.cfield, "\" data-icon=\"calendar\" title=\"Click Here to Pick up the date\"></a>");
                        ret = MVCFunctions.Concat(ret, "<input id=\"ts", this.cfield, "\" type=hidden name=\"ts", this.cfield, "\" value=\"", time[2], "-", time[1], "-", time[0], "\">");
                    }
                }
                if (this.pageObject.getLayoutVersion() == Constants.BOOTSTRAP_LAYOUT)
                {
                    ret = XVar.Clone(MVCFunctions.Concat("<span class=\"bs-date-control form-inline\">", ret, "</span>"));
                }
                MVCFunctions.Echo(ret);
                break;

            default:
                ovalue = XVar.Clone(value);
                if (XVar.Pack(time[0]))
                {
                    if ((XVar)((XVar)((XVar)(showTime) || (XVar)(time[3])) || (XVar)(time[4])) || (XVar)(time[5]))
                    {
                        ovalue = XVar.Clone(CommonFunctions.str_format_datetime((XVar)(time)));
                    }
                    else
                    {
                        ovalue = XVar.Clone(CommonFunctions.format_shortdate((XVar)(time)));
                    }
                }
                MVCFunctions.Echo(MVCFunctions.Concat("<input ", getPlaceholderAttr(), " id=\"", this.cfield, "\" type=text class=\"", classString, "\" name=\"", this.cfield, "\" ", this.inputStyle, " value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(ovalue)), "\">"));
                break;
            }
            buildControlEnd((XVar)(validate), (XVar)(mode));
            return(null);
        }
Esempio n. 23
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");
                dbo_EMPLEADO_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  = "dbo_EMPLEADO_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["dbo_EMPLEADO_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)); }
        }
Esempio n. 24
0
        /// <summary>
        /// Update record in the table
        /// </summary>
        public void Update()
        {
            XVar tableinfo   = GlobalVars.dal_info[this.m_infoKey];
            XVar updateParam = "";
            XVar updateValue = "";
            XVar blobs       = XVar.Array();

            foreach (var f in tableinfo.GetEnumerator())
            {
                var fieldInfo = this.GetType().GetField(f.Value["varname"]);
                if (fieldInfo != null && fieldInfo.GetValue(this) != null)
                {
                    if (f.Value["key"] != null)
                    {
                        this.Param[f.Value["varname"]] = fieldInfo.GetValue(this);
                    }
                    else
                    {
                        this.Value[f.Value["varname"]] = fieldInfo.GetValue(this);
                    }
                }
                if (f.Value["key"] == null && !MVCFunctions.array_change_key_case(this.Param, Constants.CASE_UPPER).KeyExists(MVCFunctions.strtoupper(f.Key)))
                {
                    foreach (var fieldValue in this.Value.GetEnumerator())
                    {
                        if (MVCFunctions.strtoupper(fieldValue.Key) != MVCFunctions.strtoupper(f.Key))
                        {
                            continue;
                        }
                        updateValue = MVCFunctions.Concat(updateValue, _connection.addFieldWrappers(f.Key), "=", this.PrepareValue(fieldValue.Value, f.Value["type"]), ", ");

                        if (_connection.dbType == Constants.nDATABASE_Oracle)
                        {
                            if (CommonFunctions.IsBinaryType(f.Value["type"]))
                            {
                                blobs[f.Key] = fieldValue.Value;
                            }
                        }
                        break;
                    }
                }
                else
                {
                    foreach (var fieldValue in this.Param.GetEnumerator())
                    {
                        if (MVCFunctions.strtoupper(fieldValue.Key) != MVCFunctions.strtoupper(f.Key))
                        {
                            continue;
                        }
                        updateParam = MVCFunctions.Concat(updateParam, _connection.addFieldWrappers(f.Key), "=", this.PrepareValue(fieldValue.Value, f.Value["type"]), " and ");
                        break;
                    }
                }
            }

            //	construct SQL and do update
            if (updateParam)
            {
                updateParam = MVCFunctions.substr(updateParam, 0, -5);
            }
            if (updateValue)
            {
                updateValue = MVCFunctions.substr(updateValue, 0, -2);
            }
            if (updateValue && updateParam)
            {
                XVar dalSQL = MVCFunctions.Concat("update ", _connection.addTableWrappers(this.m_TableName), " set ", updateValue, " where ", updateParam);
                this.Execute_Query(blobs, dalSQL, tableinfo);
            }

            //	cleanup
            this.Reset();
        }
Esempio n. 25
0
        public ActionResult list()
        {
            try
            {
                dynamic i = null, mode = null, options = XVar.Array(), pageObject = null;
                XTempl  xt;
                ABC_Voting_Recirculated1_Variables.Apply();
                CommonFunctions.add_nocache_headers();
                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("list6"), new XVar("AvenueAvenue"), new XVar("MobileAvenue"));
                    t_layout.version               = 2;
                    t_layout.blocks["center"]      = XVar.Array();
                    t_layout.containers["message"] = XVar.Array();
                    t_layout.containers["message"].Add(new XVar("name", "message", "block", "message_block", "substyle", 1));

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

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

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

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

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

                    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.skins["left"] = "menu";

                    t_layout.blocks["left"].Add("left");
                    t_layout.blocks["top"]   = XVar.Array();
                    t_layout.skins["master"] = "empty";

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

                    t_layout.containers["toplinks"].Add(new XVar("name", "toplinks_advsearch", "block", "asearch_link", "substyle", 1));

                    t_layout.containers["toplinks"].Add(new XVar("name", "toplinks_import", "block", "import_link", "substyle", 1));

                    t_layout.containers["toplinks"].Add(new XVar("name", "toplinks_export", "block", "export_link", "substyle", 1));

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

                    t_layout.skins["toplinks"] = "2";

                    t_layout.blocks["top"].Add("toplinks");
                    t_layout.containers["hmenu"] = XVar.Array();
                    t_layout.containers["hmenu"].Add(new XVar("name", "hmenu", "block", "menu_block", "substyle", 1));

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

                    t_layout.blocks["top"].Add("hmenu");
                    t_layout.containers["search"] = XVar.Array();
                    t_layout.containers["search"].Add(new XVar("name", "search", "block", "searchform_block", "substyle", 1));

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

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

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

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

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

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

                    t_layout.blocks["top"].Add("search");
                    t_layout.containers["recordcontrols"] = XVar.Array();
                    t_layout.containers["recordcontrols"].Add(new XVar("name", "recordcontrols_new", "block", "newrecord_controls_block", "substyle", 1));

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

                    t_layout.skins["recordcontrols"] = "2";

                    t_layout.blocks["top"].Add("recordcontrols");
                    GlobalVars.page_layouts["ABC_Voting_Recirculated1_list"] = 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";
                }

                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_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(Constants.PAGE_LIST, "pageType");
                options.InitAndSetArrayItem((XVar.Pack(MVCFunctions.postvalue(new XVar("id"))) ? XVar.Pack(MVCFunctions.postvalue(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("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))
                {
                    dynamic mapSettings = XVar.Array();
                }
                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)); }
        }
Esempio n. 26
0
        public ActionResult view()
        {
            try
            {
                dynamic keys = XVar.Array(), pageMode = null, pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                dbo_acceso_uggroups_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      = "dbo_acceso_uggroups_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["dbo_acceso_uggroups_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")), "GroupID");
                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)); }
        }
Esempio n. 27
0
        public ActionResult edit()
        {
            try
            {
                dynamic id = null, keys = XVar.Array(), pageMode = null, pageObject = null, var_params = XVar.Array();
                XTempl  xt;
                INGRESAR_COMPESADO_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      = "INGRESAR_COMPESADO_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["INGRESAR_COMPESADO_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          = "INGRESAR_COMPESADO_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["INGRESAR_COMPESADO_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_compesados");
                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)); }
        }
Esempio n. 28
0
 public XVar fulltext()
 {
     try
     {
         dynamic         _connection = null, cViewControl = null, container = null, data = XVar.Array(), field = null, fieldValue = null, htmlEncodedValue = null, keys = XVar.Array(), keysArr = XVar.Array(), lookup = null, lookupInRegisterPage = null, mainField = null, mainTable = null, mode = null, pageType = null, qResult = null, returnJSON = null, searchClauseObj = null, sessionPrefix = null, sql = null, table = null, where = null;
         ProjectSettings pSet;
         mode      = XVar.Clone(MVCFunctions.postvalue(new XVar("mode")));
         table     = XVar.Clone(MVCFunctions.postvalue(new XVar("table")));
         field     = XVar.Clone(MVCFunctions.postvalue(new XVar("field")));
         pageType  = XVar.Clone(MVCFunctions.postvalue(new XVar("pagetype")));
         mainTable = XVar.Clone(MVCFunctions.postvalue(new XVar("maintable")));
         mainField = XVar.Clone(MVCFunctions.postvalue(new XVar("mainfield")));
         lookup    = new XVar(false);
         if ((XVar)(mainTable) && (XVar)(mainField))
         {
             lookup = new XVar(true);
         }
         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);
         pSet = XVar.UnPackProjectSettings(new ProjectSettings((XVar)(CommonFunctions.GetTableByShort((XVar)(table))), (XVar)(pageType)));
         GlobalVars.cipherer  = XVar.Clone(new RunnerCipherer((XVar)(CommonFunctions.GetTableByShort((XVar)(table))), (XVar)(pSet)));
         _connection          = XVar.Clone(GlobalVars.cman.byTable((XVar)(GlobalVars.strTableName)));
         lookupInRegisterPage = new XVar(false);
         if (XVar.Pack(!(XVar)(MVCFunctions.in_array((XVar)(field), (XVar)(pSet.getListFields())))))
         {
             lookupInRegisterPage = new XVar(false);
         }
         if ((XVar)((XVar)(!(XVar)(CommonFunctions.isLogged())) || (XVar)(!(XVar)(CommonFunctions.CheckSecurity((XVar)(XSession.Session[MVCFunctions.Concat("_", GlobalVars.strTableName, "_OwnerID")]), new XVar("Search"))))) && (XVar)(!(XVar)(lookupInRegisterPage)))
         {
             returnJSON = XVar.Clone(new XVar("success", false, "error", ""));
             MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         if (XVar.Pack(!(XVar)(pSet.checkFieldPermissions((XVar)(field)))))
         {
             returnJSON = XVar.Clone(new XVar("success", false, "error", "Error: You have not permission for read this text"));
             MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         if (XVar.Pack(!(XVar)(GlobalVars.gQuery.HasGroupBy())))
         {
             GlobalVars.gQuery.RemoveAllFieldsExcept((XVar)(pSet.getFieldIndex((XVar)(field))));
         }
         keysArr = XVar.Clone(pSet.getTableKeys());
         keys    = XVar.Clone(XVar.Array());
         foreach (KeyValuePair <XVar, dynamic> k in keysArr.GetEnumerator())
         {
             keys.InitAndSetArrayItem(MVCFunctions.postvalue((XVar)(MVCFunctions.Concat("key", k.Key + 1))), k.Value);
         }
         where = XVar.Clone(CommonFunctions.KeyWhere((XVar)(keys)));
         if (pSet.getAdvancedSecurityType() == Constants.ADVSECURITY_VIEW_OWN)
         {
             where = XVar.Clone(CommonFunctions.whereAdd((XVar)(where), (XVar)(CommonFunctions.SecuritySQL(new XVar("Search"), (XVar)(GlobalVars.strTableName)))));
         }
         sql     = XVar.Clone(GlobalVars.gQuery.gSQLWhere((XVar)(where)));
         qResult = XVar.Clone(_connection.query((XVar)(sql)));
         if ((XVar)(!(XVar)(qResult)) || (XVar)(!(XVar)(data = XVar.Clone(GlobalVars.cipherer.DecryptFetchedArray((XVar)(qResult.fetchAssoc()))))))
         {
             returnJSON = XVar.Clone(new XVar("success", false, "error", "Error: Wrong SQL query"));
             MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
             return(MVCFunctions.GetBuferContentAndClearBufer());
         }
         fieldValue    = XVar.Clone(data[field]);
         sessionPrefix = XVar.Clone(pSet.getOriginalTableName());
         if (mode == Constants.LIST_DASHBOARD)
         {
             sessionPrefix = XVar.Clone(MVCFunctions.Concat("Dashboard_", pSet.getOriginalTableName()));
         }
         if (XVar.Pack(lookup))
         {
             sessionPrefix = XVar.Clone(MVCFunctions.Concat(pSet.getOriginalTableName(), "_lookup_", mainTable, "_", mainField));
         }
         searchClauseObj = XVar.Clone(SearchClause.UnserializeObject((XVar)(XSession.Session[MVCFunctions.Concat(sessionPrefix, "_advsearch")])));
         container       = XVar.Clone(new ViewControlsContainer((XVar)(pSet), new XVar(Constants.PAGE_LIST), new XVar(null)));
         cViewControl    = XVar.Clone(container.getControl((XVar)(field)));
         if ((XVar)(cViewControl.localControlsContainer) && (XVar)(!(XVar)(cViewControl.linkAndDisplaySame)))
         {
             cViewControl.localControlsContainer.fullText = new XVar(true);
         }
         else
         {
             cViewControl.container.fullText = new XVar(true);
         }
         if (XVar.Pack(searchClauseObj))
         {
             dynamic useViewControl = null;
             if ((XVar)(searchClauseObj.bIsUsedSrch) || (XVar)(useViewControl))
             {
                 cViewControl.searchClauseObj = XVar.Clone(searchClauseObj);
                 cViewControl.searchHighlight = new XVar(true);
             }
         }
         htmlEncodedValue = XVar.Clone(cViewControl.showDBValue((XVar)(data), new XVar("")));
         returnJSON       = XVar.Clone(new XVar("success", true, "textCont", MVCFunctions.nl2br((XVar)(htmlEncodedValue))));
         MVCFunctions.Echo(CommonFunctions.printJSON((XVar)(returnJSON)));
         return(MVCFunctions.GetBuferContentAndClearBufer());
     }
     catch (RunnerRedirectException ex)
     { return(Redirect(ex.Message)); }
 }