PK `FmT # 10.9.1.0_release18/Releasenotes.txt
• Task ID-004198 – A new Feature has been added as EXECUTION TRACE in Application Settings. This feature will trace the execution of an option from java script to java script, which can be used to analyse the issues related to different errors/performance issues at different layers as client/server/dll levels. In each layer the request and response string will be shown along with cumulative time taken.
○ Note: Below table should be created in the DB
§ Postgre:
□ CREATE TABLE axp_webtrace( username varchar(50),sessionid varchar(50),datetime timestamp, logtext text)
§ Oracle:
□ CREATE TABLE axp_webtrace( username varchar(50),sessionid varchar(50),datetime timestamp,logtext clob)
• Task ID-003756 : GI Staffing. We require to attach the .msg format files in header and grid. These are mail format files of Outlook.
• Task ID-004686 - Excel export column alignment based on column defination
• Task ID-004687 -- Tstruct structure level formload caching logic withdrawn as it is handled through developer option and global parameter and values. PK/O O PK `FmT 6 10.9.1.0_release18/10.9.1.0_release18/versionInfo.json{
"version": "10.9.1.0",
"subVersion": "release18",
"10.9.1.0": {
"10.9.1.0": {
"releaseDate": "",
"description": [""],
"features": [""],
"enhancements": [""]
}
}
}PKĹ PK `FmT ; 10.9.1.0_release18/10.9.1.0_release18/App_Code/Constants.csusing System;
using System.Collections.Generic;
using System.Web;
///
/// Summary description for Constants
///
public class Constants
{
public Constants()
{
//
// TODO: Add constructor logic here
//
}
public const string vbCrLf = "";
#region Error messages for culture
public const string ERROR = "";
public const string ERRORCLOSE = "";
public const string REC_NOT_FOUND = "No data found.";
public const string SEL_ROWS_FOUND = "All rows are already selected.";
public const string SESSIONERROR = "invalid sessionid";
public const string CUSTOMERROR = "Server error. Please try again.If the problem continues, please contact your administrator.";
public const string SUCCESS = "";
public const string SUCCESSCLOSE = "";
public const string SESSIONEXPMSG = "Disconnected because you have logged into another session.";
public const string EMPTYOPTION = "-- Select --";
public const string PARAMERR = "err.aspx?errmsg=Invalid parameter";
public const string LOGINERR = "signin.aspx?msg=Invalid Username or Password.";
public const string LOGINPAGE = "signin.aspx";
public const string ERRPATH = "../aspx/err.aspx?errmsg=";
public const string ERAUTHENTICATION = "Session Authentication failed...";
public const string DUPLICATESESS = "Duplicate_session";
public const string INVALIDURL = "Requested Page cannot be loaded as the URL contains invalid character.";
public const string MALICIOUSNPUTDETECTED = "Invalid input detected, Please try again.";
#endregion
public const string IMGPrefix = "nodb_";
public const string AXPIMAGEPATH = "axpimagepath";
public const string TRACESPLITSTR2 = "♦♦";
public const string TRACESPLITSTR1 = "♦";
public const string IMGSRCPrefix = "nodbsrc_";
public const string PROGRESS = "InProgress";
public const string INIT = "INIT";
public const string AOWE = "AOWE";
public const string APPEND = "APPEND";
public const string BACKIMG = "../AxpImages/icons/24X24/backbutton.png";
public const string FORWARDIMG = "../AxpImages/icons/24X24/forwardbutton.png";
public const string TILE = "tile";
public const string DEFAULT = "default";
public const string DOUBLE = "double";
public const string SINGLE = "single";
public const string ACPICKPAGESIZE = "50";
public const string TABBED = "tabbed";
public const string AXPISROWVALID = "axp__isGrdVld";
public const string GeneralLog = "GeneralLog";
public const string structHTML = "TSTHTML";
public const string tstHeaderHTML = "TSTHDRHTML";
public const string toolbarBtnIcons = "TOOLBTNS";
public const string attachHTML = "ATTHTML";
public const string taskBtns = "TSKBTNS";
public const string structScript = "TSTSCRIPT";
public const string structBtns = "TSTBTNS";
public const string structCaption = "TSTCAPTION";
public const string strSubmitCancel = "TSTFOOTER";
public const string strDesign = "TSTDESIGN";
public static string[] fileTypes = { ".bmp", ".jpg", ".jpeg", ".pjpeg", ".png", ".gif", ".doc", ".docx", ".xml", ".xlsx", ".ppt", ".pdf", ".txt", ".xls", ".pwd", ".tiff", ".tif", ".dib", ".jfif", ".heic", ".xlxs", ".csv", ".eml", ".msg" };
public const string NO_DRAFTS = "No Drafts";
public const string DRAFT_REFRESH = "refresh";
public const string NO_DRAFT_HTML = "
";
public const string EX_DRAFT_HTML = "";
public const string ORCL_QRY_PRPS_DSGN = "declare cnt int; val varchar2(31000); begin val := '$VALUE$'; select count(*) into cnt from axpCloudDevSettings where TranID='$TRANID$' and type='$TYPE$'; if (cnt>0) then UPDATE axpCloudDevSettings SET value = val where TranID='$TRANID$' and type='$TYPE$'; else insert into axpCloudDevSettings (USERID,tranid,type,value) Values ('$USERID$','$TRANID$','$TYPE$',val) ; END IF; end; ";
public const string ORCL_QRY_PRPS_USER = "declare cnt int; begin select count(*) into cnt from axpCloudUserSettings where userid = '$USERID$' and TranID='$TRANID$' and type='$TYPE$'; if (cnt>0) then UPDATE axpCloudUserSettings SET value = '$VALUE$' where userid = '$USERID$' and TranID='$TRANID$' and type='$TYPE$'; else insert into axpCloudUserSettings (userid,tranid,type,value) Values ('$USERID$','$TRANID$','$TYPE$','$VALUE$') ; END IF; end;";
public const string MYSQL_QRY_PRPS_DSGN = "INSERT INTO axpCloudDevSettings (userid,TranID,Type,Value) values ('$USERID$','$TRANID$','$TYPE$','$VALUE$') ON DUPLICATE KEY UPDATE Value= values(Value);";
public const string MYSQL_QRY_PRPS_USER = "INSERT INTO axpCloudUserSettings (userid,TranID,Type,Value) values ('$USERID$','$TRANID$','$TYPE$','$VALUE$') ON DUPLICATE KEY UPDATE Value= values(Value);";
public const string SQL_QRY_PRPS_USER = "if exists(select * from axpCloudUserSettings where userid='$USERID$' and Type='$TYPE$' and TranID='$TRANID$') update axpCloudUserSettings set Value ='$VALUE$' where userid='$USERID$' and Type='$TYPE$' and TranID='$TRANID$' else insert into axpCloudUserSettings (userid,TranID,Type,Value) values ('$USERID$','$TRANID$','$TYPE$','$VALUE$')";
public const string SQL_QRY_PRPS_DSGN = "if exists(select * from axpCloudDevSettings where Type='$TYPE$' and TranID='$TRANID$') update axpCloudDevSettings set Value ='$VALUE$' where Type='$TYPE$' and TranID='$TRANID$' else insert into axpCloudDevSettings (userid,TranID,Type,Value) values ('$USERID$','$TRANID$','$TYPE$','$VALUE$')";
public const string QUERY_GET_PRPS_STATUS = "Select ( CASE WHEN (Select Value from axpCloudDevSettings where userid='$USERID$' and type='$TYPE$' and TranID='$TRANID$') IS NULL THEN to_clob('0') else (Select Value from axpCloudDevSettings where userid='$USERID$' and type='$TYPE$' and TranID='$TRANID$') end ) AS admn,(CASE WHEN (Select Value from axpCloudUserSettings where USERID='$USERID$' and type ='$TYPE$' and TranID='$TRANID$') IS NULL THEN to_clob('0') else (Select Value from axpCloudUserSettings where USERID='$USERID$' and type='$TYPE$' and TranID='$TRANID$')end ) AS usr from dual"; //from dual, to_clob
public const string MYSQL_QUERY_GET_PRPS_STATUS = "Select ( CASE WHEN (Select Value from axpCloudDevSettings where userid='$USERID$' and type='$TYPE$' and TranID='$TRANID$') IS NULL THEN '0' else (Select Value from axpCloudDevSettings where userid='$USERID$' and type='$TYPE$' and TranID='$TRANID$') end ) AS admn,(CASE WHEN (Select Value from axpCloudUserSettings where USERID='$USERID$' and type ='$TYPE$' and TranID='$TRANID$') IS NULL THEN '0' else (Select Value from axpCloudUserSettings where USERID='$USERID$' and type='$TYPE$' and TranID='$TRANID$')end ) AS usr ";
public const string SQL_CHECK_USER = "SELECT USERNAME FROM AX_USER_SETTINGS WHERE USERNAME = '$USERID$'";
public const string SQL_LOAD_USER_APPSETTINGS = "SELECT APPSETTINGS FROM AX_USER_SETTINGS WHERE USERNAME = '$USERID$'";
public const string SQL_SAVE_USER_APPSETTINGS = "UPDATE AX_USER_SETTINGS SET APPSETTINGS = '$VALUE$' WHERE USERNAME = '$USERID$'";
public const string SQL_INSERT_USER_APPSETTINGS = "INSERT INTO AX_USER_SETTINGS (USERNAME, APPSETTINGS) VALUES ('$USERID$', '$VALUE$')";
public const string DEFAULT_USER_APPSETTINGS = "{\"sabrnig\":false}";
public const string MYSQL_QUERY_IVIR_SAVE_JSON = "update AX_USER_SETTINGS set IR_CONFIG = '$VALUE$' where USERNAME = '$USERID$'";
public const string MYSQL_QUERY_IVIR_GET_JSON = "select IR_CONFIG from AX_USER_SETTINGS where USERNAME = '$USERID$'";
public const string UPDATE_PRIVATE_SSO_TOKEN_IN_DB = "update axusers set singleloginkey = '$VALUE$' where USERNAME = '$USERID$'";
public const string GET_TST_CUSTOM_ACTIONS = "Select configname,cvalue from axpconfigs_$TRANSID$";
public const string RAPID_FORMLOAD_TBL = "Axp_formload";
public const string RAPID_DEPENDENCY_TBL = "Axp_Dependents";
public const string GET_RAPID_DEF_SP = "SP_RAPIDDEFINITION";
public const string GET_IV_GROUPED_BUTTONS = "Select cvalue from axpconfigsiv_$IVNAME$ where configname='groupbtns'";
public const string GET_IV_TEMPLETE = "select cvalue, elements from templates where type='Iview' and iviewid='$IVNAME$'";
public const string VAR_TRANSID = "$TRANSID$";
public const string VAR_IVNAME = "$IVNAME$";
public const string IVIEWSTRUCT = "ivewstruct";
public const string IVIEWPARAM = "ivewsparam";
public const string REDISXML = " axrowtypeaxp__fontdetailsTypeNameCaptionkeysizeTotal keyskeys";
public const string CACMENU = "CACMENU";
public const string REDISTSTRUCT = "Tstruct";
public const string REDISTSTRUCTMOB = "TstructMob";
public const string REDISTSTRUCTTABLE = "TstDcTable";
public const string REDISTSTRUCTDOFORM = "TstructDoForm";
public const string REDISTSTRUCTDESIGN = "TstDsgn";
public const string REDISTSTRUCTAXDESIGN = "axTstDsgn";
public const string REDISTSTRUCTAXCUSTHTML = "axTstCustomHtml";
public const string REDISTSTRUCTAXDESIGNTABLE = "axTstDsgnTbl";
public const string REDISTSTRUCTALL = "axTstAll";
public const string REDISTSTRUCTDTLS = "TstructDtls";
public const string REDISTSTRUCTDTLSMOB = "TstructDtlsMob";
public const string REDISTSTRUCTDESIGNDTLS = "TstDsgnDtls";
public const string DEPFLDARRAY = "depFldArray";
public const string FIELDNAME = "fieldName";
public const string FIELDINDEX = "fieldIndex";
public const string FORMLOADARRAY = "FormLoadArray";
public const string FORMLOADINDEX = "FormLoadIndex";
public const string CLOUD_HOME_API = "api/Session/IsValidSession/{0}/{1}";
public const string REDISMENUDATA = "MenuData";
public const string REDISGLOBALVARS = "GlobalVars";
public const string REDISAXUSEROPTIONS = "axUserOptions";
public const string REDISLVRECORDLISTING = "lvRecordListing";
public const string ListViewFieldsInfo = "ListFldsInfo";
public const string RedisIviewObjList = "IviewObjList";
public const string RedisIviewObj = "IviewObj";
public const string RedisListviewObjList = "ListviewObjList";
public const string RedisListviewObj = "ListviewObj";
public const string RedisIviewSettings = "IviewSettings";
public const string RedisListviewSettings = "ListviewSettings";
public const string RedisOldIviewSettings = "IviewOldSettings";
public const string RedisOldListviewSettings = "ListviewOldSettings";
public const string RedisOldIviewTemplates = "IviewOldTemplates";
public const string RedisOldListviewTemplates = "ListviewOldTemplates";
//public const string GET_SEARCH_DATA = "select SEARCHTEXT,HLTYPE,STRUCTNAME,PARAMS from axp_appsearch where username=:username";
public const string GET_SEARCH_DATA = "select SEARCHTEXT,HLTYPE,STRUCTNAME,PARAMS from axp_appsearch where username=:username and lower(searchtext) like $KEYWORD$";
public const string COLLAPSEMENU = "Collapse";
public const string CFG_CONFIG_FILE = "generic_config";
public const string GET_DASHBOARD_FILTERDATA = "select * from axp_fparamvalues where username=:username";// columns will be adding dynamically
//Note: While changing 'DEFAULT_CONFIGSTR', verify the 'AppConfiguration.cs' scenarios as well. No spaces should be used before and after in Key Names.
public const string DEFAULT_CONFIGSTR = "{\"configStr\": [{\"AxLoginTrace\": \"false\"},{\"AxAlertTimeout\": \"3\"},{\"AxBreadCrumb\": \"false\"},{\"AxEnableDirectDB\": \"false\"},{\"AxExportTallyTid\": \"\"},{\"AxCPWDOnLogin\": \"true\"},{\"AxHelpIview\": \"\"},{\"AxSessionExtend\": \"true\"},{\"AxDisableSplit\":\"false\"},{\"AxGlobalSrchLimit\":\"10000\"},{\"AxErrorMsg\": \"false\"},{\"AxErrorMsgTimeout\": \"0\"},{\"AxShowLoggedinUsersCount\": \"false\"},{\"AxImpExpTemptPath\": \"\"},{\"AxLanguages\": \"english\"},{\"AxUSCulture\": \"false\"},{\"AxDevInstance\": \"false\"},{\"AxDisplayAutoGenVal\": \"false\"},{\"AxIsPerfCode\": \"true\"},{\"AxDcGridOnSave\": \"true\"},{\"AxAttachmentSize\": \"1\"},{\"AxImagePath\": \"\"},{\"AxAttachFilePath\": \"\"},{\"AxGridAttachPath\": \"\"},{\"AxShowSubmitCancel\": \"false\"},{\"AxDesignerAccess\": \"designer\"},{\"AxIsPrintExe\": \"true\"},{\"AxPrintExePath\": \"\"},{\"AxHtmlPath\": \"\"},{\"AxPrintMargins\": \"50,50,200,100\"},{\"AxPrintTitleAlign\": \"center\"},{\"AxIviewcelltextwrap\": \"true\"},{\"AxMergeRowIviews\": \"\"},{\"AxPrintRowsMaxLimit\": \"10000\"},{\"AxDbPagination\": \"true\"},{\"AxDefaultPageSize\": \"30\"},{\"AxShowAppTitle\": \"true\"},{\"AxGetIviewRowCount\": \"false\"},{\"AxIviewDataWSRows\": \"1000\"},{\"AxInlineGridEdit\": \"true\"},{\"AxHomeBuildAccess\": \"default\"},{\"AxMaxNumOfWidgets\": \"99\"},{\"AxMenuStyle\": \"default\"},{\"AxMenuColumns\": \"3\"},{\"AxSubmenuPerView\": \"6\"},{\"AxMenuWordWrap\": \"false\"},{\"AxSubMenuCount\": \"4\"},{\"AxDirectSubMenuCount\": \"6\"},{\"AxWizardType\": \"classic\"},{\"AxDrafts\": \"false\"},{\"AxAutoPurge\": \"true\"},{\"AxMaxDraftsCount\": \"1\"},{\"AutoSavePublish\" : \"false\"}],\"configLangKeys\": [{\"AxAppTitle_ENG\": \"\"},{\"AxCopyRightText_ENG\": \"Powered by Axpert\"},{\"AxPrintTitle_ENG\": \"\"}]}";
#region Fast Data
public const string FD_TBL_DEFINITION = "select * from axp_FastDataDefinition";
public const string FD_TBL_ASSOCIATION = "select * from axp_fastdataassociation";
public const string FD_DT_DEFINITION = "FdDtDefinition";
public const string FD_DT_ASSOCIATION = "FdDtAssociation";
public const string RS_FD_DEFINITION = "RsFdDefinition";
public const string FD_REFRESH_DT = "FDRefreshDT";
#endregion
//public const string IMPEXP_GETTSTUCTS = "select name,caption from tstructs where blobno=1 and name in (SELECT SNAME FROM AXUSERACCESS WHERE STYPE = 't' AND RNAME IN (select userroles from axuserlevelgroups ul join axusergroups ug on ul.usergroup= ug.groupname where ul.username = '{0}')) order by lower(caption)";
public const string IMPEXP_GETTSTRUCTS = "select distinct t.name, t.caption from tstructs t left outer join AXUSERACCESS a on a.sname=t.name and a.stype='t' where (('default' in (select userroles from axuserlevelgroups ul join axusergroups ug on ul.usergroup=ug.groupname where ul.username = '{0}')) or a.rname in (select userroles from axuserlevelgroups ul join axusergroups ug on ul.usergroup=ug.groupname where ul.username = '{0}')) order by 2";
public const string SQL_GET_AXLANGSOURCE = "Select distinct langname from axlangsource order by langname asc";
public const string AXPATTACHMENTPATH = "axpattachmentpath";
public const string DESIGN_MODE_BTN_HTML = "Design Mode";
public const string WIZARD_TEMPLATE = "";
public const string TBL_AXRELATIONS = "select mstruct,dstruct,mfield,dfield from axrelations where rtype='sp' or rtype='md'";
public const string RS_AXRELATIONS = "RS_AxRelations";
public const int DEFAULT_DRAFTS_RETAIN_COUNT = 3;
public const string UNIQUE_DRAFT_KEY_PHRASE = "-sad-";
//Config Page
public const string CONFIG_LOCK_KEY = "ConfigLock";
public const string CONFIGAPP_JSON_KEY = "ConfigAppJSON";
public const string AXAPPS_XML_KEY = "AxAppsXML";
//Axpert Web Logs
public const string SQL_GET_AXPWEBLOGS = "SELECT USERNAME, LOGTIME, SESSIONID, IPADDRESS, LOGDETAILS FROM AXPWEBLOGS WHERE TYPE = '$Type$'";
public const string SQL_SET_AXPWEBLOGS = "INSERT INTO AXPWEBLOGS(USERNAME, LOGTIME, TYPE, SESSIONID, IPADDRESS, LOGDETAILS) VALUES ('$Username$', '$Logtime$', '$Type$', '$Sessionid$', '$Ipaddress$', '$Logdetails$')";
// public const string SQL_GET_AXPCONFIGS = "select * from (select A.STYPE, A.STRUCTNAME, A.CONTEXT, A.SFIELD, A.ICOLUMN, A.SBUTTON, A.HLINK, A.PROPS, A.PROPSVAL from axpstructconfig a, axuserlevelgroups b where A.USERROLES = axusergroup and B.AXUSERNAME = '$username$' union all select A.STYPE, A.STRUCTNAME, A.CONTEXT, A.SFIELD, A.ICOLUMN, A.SBUTTON, A.HLINK, A.PROPS, A.PROPSVAL from axpstructconfig a where nvl( USERROLES,'default')= 'default') where stype = '$stype$' and structname = '$transid$'";
//public const string SQL_GET_AXPCONFIGS = "select * from (select A.STYPE,A.STRUCTNAME, A.CONTEXT, A.SFIELD,A.PROPS, A.PROPSVAL from axpstructconfig a, axuserlevelgroups b where A.USERROLES = axusergroup and B.AXUSERNAME = '$username$' union all select A.STYPE,A.STRUCTNAME, A.CONTEXT, A.SFIELD,A.PROPS, A.PROPSVAL from axpstructconfig a where upper(nvl( USERROLES,'ALL'))= 'ALL') where stype = '$stype$' and structname = '$transid$'";
public const string SQL_GET_AXPCONFIGS = "SELECT A.STYPE,A.STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a, axuserlevelgroups b WHERE A.USERROLES = axusergroup AND B.AXUSERNAME = '$username$' AND stype = '$stype$' AND structname = '$transid$' AND A.STRUCTNAME NOT LIKE 'ALL%' UNION SELECT A.STYPE,A.STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a WHERE NVL (USERROLES, 'ALL') = 'ALL' AND stype = '$stype$' AND structname = '$transid$' AND A.STRUCTNAME NOT LIKE 'ALL%' UNION SELECT A.STYPE, '$transid$' STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a, axuserlevelgroups b WHERE A.USERROLES = axusergroup AND B.AXUSERNAME = '$username$' AND stype = '$stype$' AND A.STRUCTNAME LIKE 'ALL%' UNION SELECT A.STYPE,'$transid$' STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a WHERE NVL(USERROLES, 'ALL') = 'ALL' AND stype = '$stype$' AND A.STRUCTNAME LIKE 'ALL%'";
public const string SQL_GET_AXPCONFIGS_MYSQL = "SELECT A.STYPE,A.STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a, axuserlevelgroups b WHERE A.USERROLES = axusergroup AND B.AXUSERNAME = '$username$' AND stype = '$stype$' AND structname = '$transid$' AND A.STRUCTNAME NOT LIKE 'ALL%' UNION SELECT A.STYPE,A.STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a WHERE ifnull(USERROLES, 'ALL') = 'ALL' AND stype = '$stype$' AND structname = '$transid$' AND A.STRUCTNAME NOT LIKE 'ALL%' UNION SELECT A.STYPE, '$transid$' STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a, axuserlevelgroups b WHERE A.USERROLES = axusergroup AND B.AXUSERNAME = '$username$' AND stype = '$stype$' AND A.STRUCTNAME LIKE 'ALL%' UNION SELECT A.STYPE,'$transid$' STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a WHERE ifnull(USERROLES, 'ALL') = 'ALL' AND stype = '$stype$' AND A.STRUCTNAME LIKE 'ALL%'";
public const string SQL_GET_AXPCONFIGS_MSSQL = "SELECT A.STYPE,A.STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a, axuserlevelgroups b WHERE A.USERROLES = axusergroup AND B.AXUSERNAME = '$username$' AND stype = '$stype$' AND structname = '$transid$' AND A.STRUCTNAME NOT LIKE 'ALL%' UNION SELECT A.STYPE,A.STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a WHERE isnull(USERROLES, 'ALL') = 'ALL' AND stype = '$stype$' AND structname = '$transid$' AND A.STRUCTNAME NOT LIKE 'ALL%' UNION SELECT A.STYPE, '$transid$' STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a, axuserlevelgroups b WHERE A.USERROLES = axusergroup AND B.AXUSERNAME = '$username$' AND stype = '$stype$' AND A.STRUCTNAME LIKE 'ALL%' UNION SELECT A.STYPE,'$transid$' STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a WHERE isnull(USERROLES, 'ALL') = 'ALL' AND stype = '$stype$' AND A.STRUCTNAME LIKE 'ALL%'";
public const string SQL_GET_AXPCONFIGS_POSTGRESQL = "SELECT A.STYPE,A.STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a, axuserlevelgroups b WHERE A.USERROLES = axusergroup AND B.AXUSERNAME = '$username$' AND stype = '$stype$' AND structname = '$transid$' AND A.STRUCTNAME NOT LIKE 'ALL%' UNION SELECT A.STYPE,A.STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a WHERE COALESCE(USERROLES, 'ALL') = 'ALL' AND stype = '$stype$' AND structname = '$transid$' AND A.STRUCTNAME NOT LIKE 'ALL%' UNION SELECT A.STYPE, '$transid$' STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a, axuserlevelgroups b WHERE A.USERROLES = axusergroup AND B.AXUSERNAME = '$username$' AND stype = '$stype$' AND A.STRUCTNAME LIKE 'ALL%' UNION SELECT A.STYPE,'$transid$' STRUCTNAME,A.CONTEXT,A.SFIELD,A.ICOLUMN,A.SBUTTON,A.HLINK,A.PROPS,A.PROPSVAL FROM axpstructconfig a WHERE COALESCE(USERROLES, 'ALL') = 'ALL' AND stype = '$stype$' AND A.STRUCTNAME LIKE 'ALL%'";
public const string SQL_GET_TSTRUCTDESIGN = "select * from $tblname$ where lower(transid)=lower('$transid$') and module='$mod$' order by created_on desc";
public const string SQL_GET_OLDTSTRUCTDESIGN = "select value from axpclouddevsettings where type='axDesign' and lower(TRANID)=lower('$transid$')";
public const string SQL_GET_AXPGENCONFIGS = "select props,asprops,propsval,structname,stype,userroles,propvalue2 from axpstructconfig where props='General'";
//Adding for App config
public const string STRUCTTYPE_TSTRUCT = "Tstruct";
public const string STRUCTTYPE_IVIEW = "Iview";
public const string CONFIGTYPE_DESIGN = "design";
public const string CONFIGTYPE_CONFIGS = "configs";
public const string AXCONFIGURATIONS = "axpconfigurations";
public const string AXCONFIGURATIONTABLE = "axpConfigTable";
public const string AXOLDDESIGN = "axOldDesign";
public const string AXLOGGEDUSER = "axloggedUser";
public const string AXPAGETITLE = "PageTitle";
public const string AXHYBRIDINFO = "GetHybridInfo";
public const string AXCONFIGTSTRUCT = "Tstruct";
public const string AXCONFIGIVIEW = "Iview";
public const string AXCONFIGGENERAL = "General";
public const string AXNODATACONFIGTSTRUCT = "Tstruct";
public const string AXNODATACONFIGIVIEW = "Iview";
public const string AXNODATACONFIGGENERAL = "General";
public const string NOTIFICATION_PHASE = "-notify-";
}
PKDFc Fc PK `FmT ; 10.9.1.0_release18/10.9.1.0_release18/App_Code/DBContext.csusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Configuration;
using System.Security.Cryptography;
using System.Text;
using System.Xml;
using Oracle.DataAccess.Client;
using System.Collections;
using System.Text.RegularExpressions;
using System.Globalization;
///
/// Summary description for Iviewdb
///
public class DBContext
{
private string db_type = String.Empty;
private string _connectionString = String.Empty;
LogFile.Log logobj = new LogFile.Log();
FDR objfd;
public DBContext()
{
db_type = HttpContext.Current.Session["axdb"].ToString();
_connectionString = HttpContext.Current.Session["axconstr"].ToString();
}
public DataTable GetDataTableInline(string query)
{
DataTable dt = new DataTable();
try
{
Ihelper _helper = new Helper().SetDatabase(db_type, _connectionString);
dt = _helper.ExecuteDataSetSqlInline(query).Tables[0];
return dt;
}
catch (Exception ex)
{
throw ex;
}
return dt;
}
public DataSet GetMainPageDataDB(string query) // using for stored procedure call with multi select queries
{
Ihelper _helper = new Helper().SetDatabase(db_type, _connectionString);
DataSet ds = new DataSet();
try
{
if (db_type.ToLower() == "oracle")
{
logobj.CreateLog("Dashboard ,oracledb-User:" + HttpContext.Current.Session["user"], HttpContext.Current.Session.SessionID, "dashBoard-db", "new");
_helper.AddInParameter("@IUser", HttpContext.Current.Session["user"], DbType.String);
_helper.AddOutParameter("ORes1", DbType.Object);
_helper.AddOutParameter("ORes2", DbType.Object);
_helper.AddOutParameter("ORes3", DbType.Object);
_helper.AddOutParameter("ORes4", DbType.Object);
_helper.AddOutParameter("ORes5", DbType.Object);
_helper.AddOutParameter("ORes6", DbType.Object);
ds = _helper.ExecuteDataSet("sp_dashboardmultisql");
}
else if (db_type.ToLower() == "ms sql")
{
logobj.CreateLog("Dashboard mssqldb-User:" + HttpContext.Current.Session["user"], HttpContext.Current.Session.SessionID, "dashBoard-db", "new");
_helper.AddInParameter("@IUser", HttpContext.Current.Session["user"], DbType.String);
ds = _helper.ExecuteDataSet("sp_dashboardmultisql");
}
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb")
{
logobj.CreateLog("Dashboard mysqldb-User:" + HttpContext.Current.Session["user"], HttpContext.Current.Session.SessionID, "dashBoard-db", "new");
_helper.AddInParameter("IUser", HttpContext.Current.Session["user"], DbType.String);
ds = _helper.ExecuteDataSet("sp_dashboardmultisql");
}
else if (db_type.ToLower() == "postgresql"|| db_type.ToLower() == "postgre")
{
logobj.CreateLog("Dashboard Postgresdb-User:" + HttpContext.Current.Session["user"], HttpContext.Current.Session.SessionID, "dashBoard-db", "new");
_helper.AddInParameter("IUser", HttpContext.Current.Session["user"], DbType.String);
ds = _helper.ExecuteDataSet("sp_dashboardmultisql");
}
}
catch (Exception ex)
{
throw ex;
}
return ds;
}
public DataSet GetRapidDefData(string procName, string transId) // using for stored procedure call with multi select queries
{
Ihelper _helper = new Helper().SetDatabase(db_type, _connectionString);
DataSet ds = new DataSet();
try
{
if (db_type.ToLower() == "oracle")
{
logobj.CreateLog("GetRapidDef ,oracledb-Transid:" + transId, HttpContext.Current.Session.SessionID, "GetRapidDefSP-db", "new");
_helper.AddInParameter("@ITid", transId, DbType.String);
_helper.AddOutParameter("ORes1", DbType.Object);
_helper.AddOutParameter("ORes2", DbType.Object);
ds = _helper.ExecuteDataSet(procName);
}
else if (db_type.ToLower() == "ms sql")
{
_helper.AddInParameter("@ITid", transId, DbType.String);
ds = _helper.ExecuteDataSet(procName);
}
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb")
{
_helper.AddInParameter("ITid", transId, DbType.String);
ds = _helper.ExecuteDataSet(procName);
}
else if (db_type.ToLower() == "postgresql"|| db_type.ToLower() == "postgre")
{
_helper.AddInParameter("ITid", transId, DbType.String);
ds = _helper.ExecuteDataSet(procName);
}
}
catch (Exception ex)
{
throw ex;
}
return ds;
}
public DataSet GetMainPageDBInline(string type) // for inline query call with multi select queries
{
DataSet ds = new DataSet();
try
{
if (type == "dashboard")
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
string quickl = "select * from axquicklinks where name='" + HttpContext.Current.Session["user"] + "' order by AXQUICKLINKSID asc";
ds = _helper1.ExecuteDataSetSqlInline(quickl);
string task = "select * from axtasks where sname='" + HttpContext.Current.Session["user"] + "'";
ds.Tables.Add("Table1");
ds.Tables["Table1"].Merge(_helper1.ExecuteDataSetSqlInline(task).Tables[0]);
string mess = "select * from axmessages where mname='" + HttpContext.Current.Session["user"] + "'";
ds.Tables.Add("Table2");
ds.Tables["Table2"].Merge(_helper1.ExecuteDataSetSqlInline(mess).Tables[0]);
string dbwdetails = "select axp_dbwdetailsid,username,title,widgettype,sqltext,tablehlinks from axp_dbwdetails where username='" + HttpContext.Current.Session["user"] + "'";
ds.Tables.Add("Table3");
ds.Tables["Table3"].Merge(_helper1.ExecuteDataSetSqlInline(dbwdetails).Tables[0]);
string srparams = "select s.* from axp_searchparams s,axp_dbwdetails m where s.WIDGETNAME=m.title and m.username='" + HttpContext.Current.Session["user"] + "'";
ds.Tables.Add("Table4");
ds.Tables["Table4"].Merge(_helper1.ExecuteDataSetSqlInline(srparams).Tables[0]);
}
else
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
//string mess = "select * from axmessages where mname='" + HttpContext.Current.Session["user"] + "'";
//ds = _helper1.ExecuteDataSetSqlInline(mess);
//string dbwdetails = "select count(*) as rcount from axp_dbwdetails where uname='" + HttpContext.Current.Session["user"] + "'";
//string dbwdetails = "SELECT count(*) as rcount from axugwidgets u join axp_chartconfig d on u.widgetname = d.axp_chartconfigid where u.axugwidgetsid in (SELECT u.axugwidgetsid from axusers a join axuserlevelgroups b on a.axusersid = b.axusersid join axusergroups c on b.usergroup = c.groupname join axugwidgets u on c.axusergroupsid = u.axusergroupsId where a.username = '" + HttpContext.Current.Session["user"] + "' group by u.axugwidgetsid)";
string dbwdetails = "SELECT count(*) as rcount from AX_WIDGET ax join AX_WIDGET_ROLE ar on ax.WIDGET_ID = ar.WIDGET_ID WHERE ar.ROLENAME IN(SELECT distinct c.groupname from axusers a join axuserlevelgroups b on a.username = b.username join axusergroups c on b.usergroup = c.groupname where a.username = '" + HttpContext.Current.Session["user"] + "')";
//ds.Tables.Add("Table1");
try
{
ds = _helper1.ExecuteDataSetSqlInline(dbwdetails);
}
catch (Exception ex)
{
return ds;
}
}
}
catch (Exception ex)
{
throw ex;
}
return ds;
}
public DataSet GetMainPageDBTableInline(string querys, string fltParams, string widgetId) // single select query call
{
if (HttpContext.Current.Session["FDR"] != null)
objfd = (FDR)HttpContext.Current.Session["FDR"];
else
objfd = new FDR();
DataSet ds = new DataSet();
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
List widgets = widgetId.Split(';').ToList();
string uName = "username:" + HttpContext.Current.Session["user"];
if (fltParams != "")
fltParams = uName + "~" + fltParams;
else
fltParams = uName;
for (int i = 0; i < widgets.Count; i++)
{
DataTable dt = new DataTable();
dt = objfd.GetDashBoardData(widgets[i].ToString(), fltParams);
if (dt == null || dt.Rows.Count == 0)
{
string subQuery = querys.Split(';')[i];
subQuery = subQuery.Replace(":username", "'" + HttpContext.Current.Session["user"] + "'").ToString();
subQuery = subQuery.Replace(":USERNAME", "'" + HttpContext.Current.Session["user"] + "'").ToString();
if (!string.IsNullOrEmpty(fltParams))
{
try
{
for (int prCount = 0; prCount < fltParams.Split('~').Length; prCount++)
{
string paramValue = fltParams.Split('~')[prCount];
subQuery = subQuery.Replace(":" + paramValue.Split(':')[0].ToLower(), "'" + paramValue.Split(':')[1].ToString() + "'").ToString();
subQuery = subQuery.Replace(":" + paramValue.Split(':')[0].ToUpper(), "'" + paramValue.Split(':')[1].ToString() + "'").ToString();
}
}
catch (Exception ex)
{
logobj.CreateLog("filter params " + ex.Message, "dashBoard-filter", "filter-exception", "new");
}
}
subQuery = Regex.Replace(subQuery, @"(:)\w+", "''").ToString();
if (subQuery != "")
{
string query = subQuery.Replace(" ", " ");
ds.Tables.Add("Table" + i + "");
try
{
ds.Tables["Table" + i + ""].Merge(_helper1.ExecuteDataSetSqlInline(query).Tables[0]);
}
catch (Exception ex)
{
logobj.CreateLog("Dashboard-sql " + ex.Message, query, "sqlquery-exception", "new");
}
}
}
else
{
ds.Tables.Add("Table" + i + "");
ds.Tables["Table" + i + ""].Merge(dt);
}
}
}
catch (Exception ex)
{
logobj.CreateLog("Dashboard " + ex.Message, HttpContext.Current.Session.SessionID, "dashBoard-exception", "new");
}
return ds;
}
public DataSet GetSearchData(string querys, int limit) // single select query call
{
DataSet ds = new DataSet();
try
{
querys = querys.Replace(":username", "'" + HttpContext.Current.Session["user"] + "'").ToString();
querys = querys.Replace(":USERNAME", "'" + HttpContext.Current.Session["user"] + "'").ToString();
if (db_type.ToLower() == "oracle")
{
querys = querys + "and rownum <= " + limit.ToString();
}
else if (db_type.ToLower() == "ms sql")
{
querys = querys.Replace("select", "select TOP " + limit.ToString());
}
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb")
{
querys = querys.Replace(@"\", "\\\\");
querys = querys + " limit " + limit.ToString();
}
else if (db_type.ToLower() == "postgresql"|| db_type.ToLower() == "postgre")
{
querys = querys.Replace(@"\", "\\\\");
querys = querys + " limit " + limit.ToString();
}
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
ds = _helper1.ExecuteDataSetSqlInline(querys);
if (HttpContext.Current.Session["AxDirectDBException"] != null)
{
string exMSg = HttpContext.Current.Session["AxDirectDBException"].ToString();
HttpContext.Current.Session.Remove("AxDirectDBException");
//ds.Tables.Add(CreateExcTable(exMSg));
}
}
catch (Exception ex)
{
logobj.CreateLog("SearchData " + ex.Message, HttpContext.Current.Session.SessionID, "SearchData-exception", "new");
}
return ds;
}
private DataTable CreateExcTable(string excMessage)
{
DataTable dt = new DataTable();
dt.TableName = "AxException";
dt.Columns.Add("exp");
DataRow dr = dt.NewRow();
dr[0] = excMessage;
dt.Rows.Add(dr);
dt.AcceptChanges();
return dt;
}
public bool ExecuteSqlQueryInline(string query) // insert, update & delete query call
{
bool flagcount = false;
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
flagcount = _helper1.ExecuteNonQuerySqlinline(query) == 1 ? true : false;
}
catch (Exception ex)
{
throw ex;
}
return flagcount;
}
private static void SessExpires()
{
string url = Convert.ToString(HttpContext.Current.Application["SessExpiryPath"]);
HttpContext.Current.Response.Write("");
}
public DataSet InsertMainPageDBTableInline(string linkName, string linkUrl) // insert, update & delete query call
{
DataSet ds = new DataSet();
try
{
if (HttpContext.Current.Session["user"] != null)
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
var query = "";
if (db_type.ToLower() == "oracle")
query = "insert into axquicklinks(axquicklinksid,name,linkname,linkurl) values(axquicklinks_seq.NEXTVAL,'" + HttpContext.Current.Session["user"] + "','" + linkName + "','" + linkUrl + "')";
else
query = "insert into axquicklinks(name,linkname,linkurl) values('" + HttpContext.Current.Session["user"] + "','" + linkName + "','" + linkUrl + "')";
if (_helper1.ExecuteNonQuerySqlinline(query) == 1)
{
ds = _helper1.ExecuteDataSetSqlInline("select max(AXQUICKLINKSID) AS ID from axquicklinks");
}
}
else
{
SessExpires();
}
}
catch (Exception ex)
{
throw ex;
}
return ds;
}
public DataSet GetChoices(string sql, string session)
{
Ihelper _helper = new Helper().SetDatabase(db_type, _connectionString);
DataSet Ds = new DataSet();
try
{
if (db_type.ToLower() == "oracle")
{
_helper.AddInParameter("Isql", sql, DbType.String);
_helper.AddInParameter("IsessionID", session, DbType.String);
_helper.AddInOutParameter("p_return_cur", DbType.Object);
}
else
{
_helper.AddInParameter("@Isql", sql, DbType.String);
_helper.AddInParameter("@IsessionID", session, DbType.String);
}
Ds = _helper.ExecuteDataSet("sp_getchoices");
//if(db_type.ToLower() == "mysql")
//{
// Ds = GetResultXML(Ds);
//}
}
catch (Exception ex)
{
throw ex;
}
return Ds;
}
//private DataSet GetResultXML(DataSet Ds)
//{
// if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0)
// {
// if (Ds.Tables[0].Rows[0][0].ToString() != "done" && !Ds.Tables[0].Rows[0][0].ToString().Trim().StartsWith(""))
// {
// Ds.DataSetName = "response";
// Ds.Tables[0].TableName = "row";
// string xmlRes = Ds.GetXml();
// xmlRes = "" + xmlRes + "";
// DataTable table = Ds.Tables[0];
// if (Ds.Tables.CanRemove(table))
// {
// Ds.Tables.Remove(table);
// }
// // create new table
// DataTable newDT = new DataTable("row");
// newDT.Columns.Add("result", typeof(string));
// Ds.Tables.Add(newDT);
// DataRow row = newDT.NewRow();
// newDT.Rows.Add(row);
// Ds.Tables[0].Rows[0][0] = xmlRes;
// }
// }
// return Ds;
//}
public DataSet GetIviewStructure(string iviewname)
{
Ihelper _helper = new Helper().SetDatabase(db_type, _connectionString);
DataSet ds = new DataSet();
try
{
string lang = string.IsNullOrEmpty(HttpContext.Current.Session["language"].ToString()) ? string.Empty :
(HttpContext.Current.Session["language"].ToString());
_helper.AddInParameter("@Iiviewname", iviewname, DbType.String);
_helper.AddInParameter("@ILanguage", lang, DbType.String);
if (db_type.ToLower() == "oracle")
_helper.AddOutParameter("Ocur1", DbType.Object);
ds = _helper.ExecuteDataSet("sp_GetIviewStructure");
}
catch (Exception ex)
{
logobj.CreateLog("call get Iview structure Direct -" + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "directDB", string.Empty);
throw ex;
}
return ds;
}
public DataSet GetIviewDataDB(string query, string pageno, string pageSize, bool isGrandtol)
{
Ihelper _helper = new Helper().SetDatabase(db_type, _connectionString);
DataSet ds = new DataSet();
try
{
_helper.AddInParameter("@ISql", query, DbType.String);
_helper.AddInParameter("@INoofRec", pageSize, DbType.String);
_helper.AddInParameter("@IpageNo", pageno, DbType.String);
//New parameters added
isGrandtol = true;
_helper.AddInParameter("@ICountFlag", isGrandtol == false ? 0 : 1, DbType.String);
if (db_type.ToLower() == "oracle")
{
_helper.AddOutParameter("OIviewCount", DbType.Object);
_helper.AddOutParameter("OResult", DbType.Object);
}
ds = _helper.ExecuteDataSet("GetIview");
}
catch (Exception ex)
{
throw ex;
}
return ds;
}
public DataSet GetIviewDataDBInline(string query, string pageno, string pageSize, bool isGrandtol)
{
DataSet ds = new DataSet();
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
string pagination = "select a.* from (select rownum as rowno, '' as axrowtype, a.* from ( " + query + ")a )a ";
pagination += " where rowno between " + ((int.Parse(pageno) - 1) * (int.Parse(pageSize)) + 1) + " and " + (int.Parse(pageno) * int.Parse(pageSize));
ds = _helper1.ExecuteDataSetSqlInline(pagination);
if (isGrandtol == true)
{
string count = "select count(*) as IVIEWCOUNT from (" + query + ")a ";
ds.Tables.Add("Table1");
ds.Tables["Table1"].Merge(_helper1.ExecuteDataSetSqlInline(count).Tables[0]);
}
}
catch (Exception ex)
{
throw ex;
}
return ds;
}
//Added on 15-07-2016 for direct db call to get pdflist values for tstruct
public string GetPDFList(string trasnsid, string sessionid)
{
Ihelper _helper = new Helper().SetDatabase(db_type, _connectionString);
DataSet ds = new DataSet();
try
{
_helper.AddInParameter("@p_Itid", trasnsid, DbType.String);
_helper.AddInParameter("@IsessionID", sessionid, DbType.String);
if (db_type.ToLower() == "oracle")
_helper.AddOutParameter("p_return_cur", DbType.Object);
ds = _helper.ExecuteDataSet("sp_GetPDFList");
}
catch (Exception ex)
{
throw ex;
}
if ((ds.Tables.Count > 0) && (ds.Tables[0].Rows.Count > 0))
return ds.Tables[0].Rows[0][0].ToString();
else
return string.Empty;
}
public DataSet GetAxConfigurations(string transid, string structType, bool tstDesing, string configType)
{
DataSet ds = new DataSet();
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
string sqlTstDesign = string.Empty;
string SqlQuery = string.Empty;
string username = string.Empty;
if (HttpContext.Current.Session["user"] != null)
username = HttpContext.Current.Session["user"].ToString();
if (configType == "" || configType == "configs")
{
if (db_type.ToLower() == "oracle")
SqlQuery = Constants.SQL_GET_AXPCONFIGS;
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb")
SqlQuery = Constants.SQL_GET_AXPCONFIGS_MYSQL;
else if (db_type.ToLower() == "ms sql")
SqlQuery = Constants.SQL_GET_AXPCONFIGS_MSSQL;
else if (db_type.ToLower() == "postgresql"|| db_type.ToLower() == "postgre")
SqlQuery = Constants.SQL_GET_AXPCONFIGS_POSTGRESQL;
SqlQuery = SqlQuery.Replace("$username$", username);
SqlQuery = SqlQuery.Replace("$stype$", structType);
SqlQuery = SqlQuery.Replace("$transid$", transid);
}
if (structType == "Tstruct" && (configType == "design" || configType == ""))
{
sqlTstDesign = Constants.SQL_GET_TSTRUCTDESIGN;
if (tstDesing)
sqlTstDesign = sqlTstDesign.Replace("$tblname$", "AX_LAYOUTDESIGN_SAVED");
else
sqlTstDesign = sqlTstDesign.Replace("$tblname$", "AX_LAYOUTDESIGN");
sqlTstDesign = sqlTstDesign.Replace("$transid$", transid);
sqlTstDesign = sqlTstDesign.Replace("$mod$", "TSTRUCT");
if (SqlQuery != "")
SqlQuery += ";" + sqlTstDesign;
else
SqlQuery = sqlTstDesign;
}
try
{
ds = _helper1.ExecuteDataSetSqlConfig(SqlQuery);
}
catch (Exception ex)
{
logobj.CreateLog("Get AxConfigurations DB Exception - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "GetAxConfigurations-db", string.Empty, "true");
return ds;
}
}
catch (Exception ex)
{
logobj.CreateLog("Get AxConfigurations - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "GetAxConfigurations", string.Empty, "true");
throw ex;
}
return ds;
}
public string GetAxOldDesign(string transid)
{
string oldDesign = string.Empty;
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
string SqlQuery = Constants.SQL_GET_OLDTSTRUCTDESIGN;
SqlQuery = SqlQuery.Replace("$transid$", transid);
try
{
DataSet dsOldDesing = new DataSet();
dsOldDesing = _helper1.ExecuteDataSetSqlConfig(SqlQuery);
if (dsOldDesing.Tables[0].Rows.Count > 0)
oldDesign = dsOldDesing.Tables[0].Rows[0][0].ToString();
}
catch (Exception ex)
{
logobj.CreateLog("Get AxOldDesign DB Exception - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "GetAxOldDesign-db", string.Empty, "true");
return oldDesign;
}
}
catch (Exception ex)
{
logobj.CreateLog("Get AxOldDesign - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "GetAxOldDesign", string.Empty, "true");
throw ex;
}
return oldDesign;
}
public string GetAxNewDesign(string transid)
{
string newDesign = string.Empty;
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
string SqlQuery = Constants.SQL_GET_TSTRUCTDESIGN;
SqlQuery = SqlQuery.Replace("$tblname$", "AX_LAYOUTDESIGN");
SqlQuery = SqlQuery.Replace("$transid$", transid);
SqlQuery = SqlQuery.Replace("$mod$", "TSTRUCT");
try
{
DataSet dsNewDesing = new DataSet();
dsNewDesing = _helper1.ExecuteDataSetSqlConfig(SqlQuery);
if (dsNewDesing.Tables[0].Rows.Count > 0)
newDesign = dsNewDesing.Tables[0].Rows[0]["CONTENT"].ToString();
}
catch (Exception ex)
{
logobj.CreateLog("Get GetAxNewDesign DB Exception - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "GetAxNewDesign-db", string.Empty, "true");
return newDesign;
}
}
catch (Exception ex)
{
logobj.CreateLog("Get GetAxNewDesign - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "GetAxNewDesign", string.Empty, "true");
throw ex;
}
return newDesign;
}
public string SaveDesignJson(string transid, string designContent)
{
string SaveId = string.Empty;
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
string SqlQuery = string.Empty;
string username = string.Empty;
if (HttpContext.Current.Session["user"] != null)
username = HttpContext.Current.Session["user"].ToString();
SqlQuery = "select DESIGN_ID from AX_LAYOUTDESIGN_SAVED where transid='" + transid + "'";
DataSet dsNewDesing = new DataSet();
dsNewDesing = _helper1.ExecuteDataSetSqlInline(SqlQuery);
if (dsNewDesing.Tables[0].Rows.Count > 0 && dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString() != "")
{
Ihelper _helper2 = new Helper().SetDatabase(db_type, _connectionString);
if (db_type.ToLower() == "oracle")
{
SqlQuery = "update AX_LAYOUTDESIGN_SAVED SET CONTENT=:CONTENT,MODULE='TSTRUCT',UPDATED_BY='" + username + "',is_deleted='N',is_publish='N',updated_on=CURRENT_TIMESTAMP where transid='" + transid + "'";
_helper2.AddInParameter(":CONTENT", designContent, DbType.String);
}
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb" || db_type.ToLower() == "ms sql")
{
SqlQuery = "update AX_LAYOUTDESIGN_SAVED SET CONTENT=@CONTENT,MODULE='TSTRUCT',UPDATED_BY='" + username + "',is_deleted='N',is_publish='N',updated_on=CURRENT_TIMESTAMP where transid='" + transid + "'";
_helper2.AddInParameter("@CONTENT", designContent, DbType.String);
}
else if (db_type.ToLower() == "postgresql"|| db_type.ToLower() == "postgre")
{
SqlQuery = "update AX_LAYOUTDESIGN_SAVED SET CONTENT=:CONTENT,MODULE='TSTRUCT',UPDATED_BY='" + username + "',is_deleted='N',is_publish='N',updated_on=CURRENT_TIMESTAMP where transid='" + transid + "'";
_helper2.AddInParameter(":CONTENT", designContent, DbType.String);
}
if (_helper2.ExecuteNonQuerySqlinline(SqlQuery) == 1)
SaveId = dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString();
}
else
{
Ihelper _helper2 = new Helper().SetDatabase(db_type, _connectionString);
if (db_type.ToLower() == "oracle")
{
SqlQuery = "insert into AX_LAYOUTDESIGN_SAVED (TRANSID,CONTENT,MODULE,CREATED_BY) values ('" + transid + "',:CONTENT,'TSTRUCT','" + username + "')";
_helper2.AddInParameter(":CONTENT", designContent, DbType.String);
}
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb" || db_type.ToLower() == "ms sql")
{
SqlQuery = "insert into AX_LAYOUTDESIGN_SAVED (TRANSID,CONTENT,MODULE,CREATED_BY) values ('" + transid + "',@CONTENT,'TSTRUCT','" + username + "')";
_helper2.AddInParameter("@CONTENT", designContent, DbType.String);
}
else if (db_type.ToLower() == "postgresql"|| db_type.ToLower() == "postgre")
{
SqlQuery = "insert into AX_LAYOUTDESIGN_SAVED (TRANSID,CONTENT,MODULE,CREATED_BY) values ('" + transid + "',:CONTENT,'TSTRUCT','" + username + "')";
_helper2.AddInParameter(":CONTENT", designContent, DbType.String);
}
if (_helper2.ExecuteNonQuerySqlinline(SqlQuery) == 1)
{
SqlQuery = "select DESIGN_ID from AX_LAYOUTDESIGN_SAVED where transid='" + transid + "'";
Ihelper _helper3 = new Helper().SetDatabase(db_type, _connectionString);
dsNewDesing = _helper3.ExecuteDataSetSqlInline(SqlQuery);
if (dsNewDesing.Tables[0].Rows.Count > 0 && dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString() != "")
SaveId = dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString();
}
}
}
catch (Exception ex)
{
logobj.CreateLog("Get SaveDesignJson - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "SaveDesignJson", string.Empty, "true");
}
return SaveId;
}
public string PublishDesignJson(string transid, string SavedId)
{
string PublishId = string.Empty;
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
string SqlQuery = string.Empty;
string username = string.Empty;
if (HttpContext.Current.Session["user"] != null)
username = HttpContext.Current.Session["user"].ToString();
SqlQuery = "select DESIGN_ID,TRANSID,CONTENT,MODULE,CREATED_BY,RESPONSIBILITY,PARENT_DESIGN_ID from AX_LAYOUTDESIGN_SAVED where TRANSID='" + transid + "';select DESIGN_ID from AX_LAYOUTDESIGN where TRANSID='" + transid + "';";
DataSet dsNewDesing = new DataSet();
dsNewDesing = _helper1.ExecuteDataSetSqlConfig(SqlQuery);
if (dsNewDesing.Tables.Count > 0)
{
string Content = string.Empty, Module = string.Empty, Created_by = string.Empty, Updated_by = string.Empty, P_Design_Id = string.Empty;
if (dsNewDesing.Tables["Table0"].Rows.Count > 0)
{
if (SavedId == "")
SavedId = dsNewDesing.Tables["Table0"].Rows[0]["DESIGN_ID"].ToString();
Content = dsNewDesing.Tables["Table0"].Rows[0]["CONTENT"].ToString();
Module = dsNewDesing.Tables["Table0"].Rows[0]["MODULE"].ToString();
Updated_by = Created_by = dsNewDesing.Tables["Table0"].Rows[0]["CREATED_BY"].ToString();
P_Design_Id = dsNewDesing.Tables["Table0"].Rows[0]["PARENT_DESIGN_ID"].ToString();
if (dsNewDesing.Tables["Table1"].Rows.Count > 0 && dsNewDesing.Tables["Table1"].Rows[0]["DESIGN_ID"].ToString() != "")
{
Ihelper _helper2 = new Helper().SetDatabase(db_type, _connectionString);
if (db_type.ToLower() == "oracle")
{
SqlQuery = "update AX_LAYOUTDESIGN SET CONTENT=:CONTENT,MODULE='" + Module + "',UPDATED_BY='" + Updated_by + "',UPDATED_ON=CURRENT_TIMESTAMP where TRANSID='" + transid + "'";
_helper2.AddInParameter(":CONTENT", Content, DbType.String);
}
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb" || db_type.ToLower() == "ms sql")
{
SqlQuery = "update AX_LAYOUTDESIGN SET CONTENT=@CONTENT,MODULE='" + Module + "',UPDATED_BY='" + Updated_by + "',UPDATED_ON=CURRENT_TIMESTAMP where TRANSID='" + transid + "'";
_helper2.AddInParameter("@CONTENT", Content, DbType.String);
}
else if (db_type.ToLower() == "postgresql"|| db_type.ToLower() == "postgre")
{
SqlQuery = "update AX_LAYOUTDESIGN SET CONTENT=:CONTENT,MODULE='" + Module + "',UPDATED_BY='" + Updated_by + "',UPDATED_ON=CURRENT_TIMESTAMP where TRANSID='" + transid + "'";
_helper2.AddInParameter(":CONTENT", Content, DbType.String);
}
if (_helper2.ExecuteNonQuerySqlinline(SqlQuery) == 1)
{
SqlQuery = "select DESIGN_ID from AX_LAYOUTDESIGN where TRANSID='" + transid + "'";
Ihelper _helper3 = new Helper().SetDatabase(db_type, _connectionString);
dsNewDesing = _helper3.ExecuteDataSetSqlInline(SqlQuery);
if (dsNewDesing.Tables[0].Rows.Count > 0 && dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString() != "")
P_Design_Id = PublishId = dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString();
}
}
else
{
Ihelper _helper2 = new Helper().SetDatabase(db_type, _connectionString);
if (db_type.ToLower() == "oracle")
{
SqlQuery = "insert into AX_LAYOUTDESIGN (TRANSID,CONTENT,MODULE,CREATED_BY) values ('" + transid + "',:CONTENT,'" + Module + "','" + Created_by + "')";
_helper2.AddInParameter(":CONTENT", Content, DbType.String);
}
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb" || db_type.ToLower() == "ms sql")
{
SqlQuery = "insert into AX_LAYOUTDESIGN (TRANSID,CONTENT,MODULE,CREATED_BY) values ('" + transid + "',@CONTENT,'" + Module + "','" + Created_by + "')";
_helper2.AddInParameter("@CONTENT", Content, DbType.String);
}
else if (db_type.ToLower() == "postgresql"|| db_type.ToLower() == "postgre")
{
SqlQuery = "insert into AX_LAYOUTDESIGN (TRANSID,CONTENT,MODULE,CREATED_BY) values ('" + transid + "',:CONTENT,'" + Module + "','" + Created_by + "')";
_helper2.AddInParameter(":CONTENT", Content, DbType.String);
}
if (_helper2.ExecuteNonQuerySqlinline(SqlQuery) == 1)
{
SqlQuery = "select DESIGN_ID from AX_LAYOUTDESIGN where TRANSID='" + transid + "'";
Ihelper _helper3 = new Helper().SetDatabase(db_type, _connectionString);
dsNewDesing = _helper3.ExecuteDataSetSqlInline(SqlQuery);
if (dsNewDesing.Tables[0].Rows.Count > 0 && dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString() != "")
P_Design_Id = PublishId = dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString();
}
}
if (PublishId != string.Empty)
{
Ihelper _helper4 = new Helper().SetDatabase(db_type, _connectionString);
SqlQuery = "update AX_LAYOUTDESIGN_SAVED SET PARENT_DESIGN_ID='" + P_Design_Id + "',IS_PUBLISH='Y' where DESIGN_ID='" + SavedId + "'";
if (_helper4.ExecuteNonQuerySqlinline(SqlQuery) == 1)
return PublishId;
}
}
}
}
catch (Exception ex)
{
logobj.CreateLog("Get PublishDesignJson - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "PublishDesignJson", string.Empty, "true");
}
return PublishId;
}
public string ResetDesignJson(string transid, string SavedId)
{
string Reset = string.Empty;
try
{
Ihelper _helper1 = new Helper().SetDatabase(db_type, _connectionString);
string SqlQuery = string.Empty;
string username = string.Empty;
if (HttpContext.Current.Session["user"] != null)
username = HttpContext.Current.Session["user"].ToString();
SqlQuery = "select DESIGN_ID from AX_LAYOUTDESIGN_SAVED where TRANSID='" + transid + "'";
DataSet dsNewDesing = new DataSet();
dsNewDesing = _helper1.ExecuteDataSetSqlInline(SqlQuery);
if (dsNewDesing.Tables[0].Rows.Count > 0 && dsNewDesing.Tables[0].Rows[0]["DESIGN_ID"].ToString() != "")
{
SqlQuery = "DELETE from AX_LAYOUTDESIGN_SAVED where transid='" + transid + "'";
_helper1.ExecuteNonQuerySqlinline(SqlQuery);
Ihelper _helper2 = new Helper().SetDatabase(db_type, _connectionString);
SqlQuery = "DELETE from AX_LAYOUTDESIGN where transid='" + transid + "'";
_helper2.ExecuteNonQuerySqlinline(SqlQuery);
Reset = "reseted";
}
else
Reset = "500";
}
catch (Exception ex)
{
logobj.CreateLog("Get ResetDesignJson - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "ResetDesignJson", string.Empty, "true");
}
return Reset;
}
public string SavePublishDesign(string transid, string designContent, string SavedId)
{
string SaveId = string.Empty, PublishId = string.Empty;
try
{
SaveId = SaveDesignJson(transid, designContent);
PublishId = PublishDesignJson(transid, SavedId);
}
catch (Exception ex)
{
logobj.CreateLog("Get SavePublishDesign - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "SavePublishDesign", string.Empty, "true");
}
return SaveId + "~" + PublishId;
}
public void SaveExecutionTrace(string logtext)
{
try
{
string SqlQuery = string.Empty;
string userName = string.Empty;
if (HttpContext.Current.Session["username"] != null)
userName = HttpContext.Current.Session["username"].ToString();
string sessId = HttpContext.Current.Session.SessionID;
Ihelper _helper2 = new Helper().SetDatabase(db_type, _connectionString);
if (db_type.ToLower() == "oracle")
{
SqlQuery = "insert into axp_webtrace (USERNAME,SESSIONID,DATETIME,LOGTEXT) values ('" + userName + "','" + sessId + "',CURRENT_TIMESTAMP,:LOGTEXT)";
_helper2.AddInParameter(":LOGTEXT", logtext, DbType.String);
}
else if (db_type.ToLower() == "mysql" || db_type.ToLower() == "mariadb" || db_type.ToLower() == "ms sql")
{
SqlQuery = "insert into axp_webtrace (USERNAME,SESSIONID,DATETIME,LOGTEXT) values ('" + userName + "','" + sessId + "',CURRENT_TIMESTAMP,@LOGTEXT)";
_helper2.AddInParameter("@LOGTEXT", logtext, DbType.String);
}
else if (db_type.ToLower() == "postgresql" || db_type.ToLower() == "postgre")
{
SqlQuery = "insert into axp_webtrace (USERNAME,SESSIONID,DATETIME,LOGTEXT) values ('" + userName + "','" + sessId + "',CURRENT_TIMESTAMP,:LOGTEXT)";
_helper2.AddInParameter(":LOGTEXT", logtext, DbType.String);
}
_helper2.ExecuteNonQuerySqlinline(SqlQuery);
}
catch (Exception ex)
{
logobj.CreateLog("SaveExecutionTrace - " + ex.Message + "", HttpContext.Current.Session["nsessionid"].ToString(), "SaveExecutionTrace", string.Empty, "true");
}
}
}
PKͨ
PK `FmT <