/// <summary> /// Get Format /// </summary> /// <param name="ctx">context</param> /// <param name="AD_PrintFormat_ID">id</param> /// <param name="readFromDisk">refresh from disk</param> /// <param name="isParent">wether tab is parent or a child</param> /// <returns>Format</returns> static public MPrintFormat Get(Ctx ctx, int AD_PrintFormat_ID, bool readFromDisk) { int key = AD_PrintFormat_ID; MPrintFormat pf = null; if (!readFromDisk) { pf = (MPrintFormat)s_formats[key]; } if (pf != null) { if (string.IsNullOrEmpty(pf.GetCtx().GetContext("#TimezoneOffset"))) { pf.GetCtx().SetContext("#TimezoneOffset", ctx.GetContext("#TimezoneOffset")); } } if (pf == null) { pf = new MPrintFormat(ctx, AD_PrintFormat_ID, null); pf.GetCtx().SetContext("#TimezoneOffset", ctx.GetContext("#TimezoneOffset")); s_formats.Add(key, pf); } return(pf); } // get
/// <summary> ///Standard Constructor - save to cache /// </summary> /// <param name="ctx">context</param> /// <param name="AD_WF_Node_ID">id</param> /// <param name="trxName">transaction</param> public MWFNode(Ctx ctx, int AD_WF_Node_ID, Trx trxName) : base(ctx, AD_WF_Node_ID, trxName) { if (AD_WF_Node_ID == 0) { // setAD_WF_Node_ID (0); // setAD_Workflow_ID (0); // setValue (null); // setName (null); SetAction(ACTION_WaitSleep); SetCost(0); SetDuration(0); SetEntityType(ENTITYTYPE_UserMaintained); // U SetIsCentrallyMaintained(true); // Y SetJoinElement(JOINELEMENT_XOR); // X SetDurationLimit(0); SetSplitElement(SPLITELEMENT_XOR); // X SetWaitingTime(0); SetXPosition(0); SetYPosition(0); } // Save to Cache if (Get_ID() != 0) { _cache.Add(GetAD_WF_Node_ID(), this); } }
/// <summary> /// Get Message (cached) /// </summary> /// <param name="ctx">context</param> /// <param name="Value">message value</param> /// <returns>message</returns> public static MMessage Get(Ctx ctx, string value) { if (value == null || value.Length == 0) { return(null); } MMessage retValue = (MMessage)_cache[value]; if (retValue == null) { string sql = "SELECT * FROM AD_Message WHERE Value='" + value + "'"; DataSet ds = null; try { ds = DataBase.DB.ExecuteDataset(sql, null, null); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; retValue = new MMessage(ctx, dr, null); } ds = null; } catch (Exception e) { _log.Log(Level.SEVERE, "get", e); } if (retValue != null) { _cache.Add(value, retValue); } } return(retValue); }
/// <summary> /// Create Conversion Matrix (Client) /// </summary> /// <param name="ctx"></param> private static void CreateRates(Ctx ctx) { _conversions = new CCache <Point, Decimal>("C_UOMConversion", 20); // String sql = MRole.GetDefault(ctx, false).AddAccessSQL( "SELECT C_UOM_ID, C_UOM_To_ID, MultiplyRate, DivideRate " + "FROM C_UOM_Conversion " + "WHERE IsActive='Y' AND M_Product_ID IS NULL", "C_UOM_Conversion", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); DataTable dt = null; IDataReader idr = null; try { idr = DataBase.DB.ExecuteReader(sql, null, null); dt = new DataTable(); dt.Load(idr); idr.Close(); foreach (DataRow dr in dt.Rows) { Point p = new Point(Utility.Util.GetValueOfInt(dr[0]), Utility.Util.GetValueOfInt(dr[1])); Decimal mr = Utility.Util.GetValueOfDecimal(dr[2]); Decimal deci = Utility.Util.GetValueOfDecimal(dr[3]); if (mr != null) { _conversions.Add(p, mr); } // reverse if (deci == null && mr != null) { deci = Decimal.Round(Decimal.Divide(Env.ONE, mr), 2);//, MidpointRounding.AwayFromZero); } if (deci != null) { _conversions.Add(new Point(p.Y, p.X), deci); } } } catch (Exception e) { if (idr != null) { idr.Close(); idr = null; } _log.Log(Level.SEVERE, sql, e); } finally { if (idr != null) { idr.Close(); } dt = null; } }
} // get /// <summary> /// Get existing or create local session /// </summary> /// <param name="ctx">context</param> /// <param name="createNew">create if not found</param> /// <param name="requestAddr">Request address</param> /// <returns>session</returns> public static MSession Get(Ctx ctx, Boolean createNew, String requestAddr) { int AD_Session_ID = ctx.GetContextAsInt("#AD_Session_ID"); MSession session = null; if (AD_Session_ID > 0) { session = cache[AD_Session_ID]; } if (session == null && AD_Session_ID > 0) { // check from DB session = new MSession(ctx, AD_Session_ID, null); if (session.Get_ID() != AD_Session_ID) { session = null; } else { cache.Add(AD_Session_ID, session); } } if (session != null && session.IsProcessed()) { s_log.Log(Level.WARNING, "Session Processed=" + session); cache.Remove(AD_Session_ID); session = null; } if (session == null && createNew) { session = new MSession(ctx, null); // local session if (!string.IsNullOrEmpty(requestAddr)) { session.SetRequest_Addr(requestAddr); } session.Save(); AD_Session_ID = session.GetAD_Session_ID(); ctx.SetContext("#AD_Session_ID", AD_Session_ID.ToString()); cache.Add(AD_Session_ID, session); } if (session == null) { s_log.Fine("No Session"); } return(session); }
/// <summary> /// Get All /// </summary> /// <param name="ctx">context</param> /// <returns>array list</returns> public static MTax[] GetAll(Ctx ctx) { int AD_Client_ID = ctx.GetAD_Client_ID(); int key = AD_Client_ID; MTax[] retValue = (MTax[])_cacheAll[key]; if (retValue != null) { return(retValue); } // Create it String sql = "SELECT * FROM C_Tax WHERE AD_Client_ID=@AD_Client_ID" + " ORDER BY C_Country_ID, C_Region_ID, To_Country_ID, To_Region_ID"; List <MTax> list = new List <MTax>(); //PreparedStatement pstmt = null; DataSet ds; try { SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@AD_Client_ID", AD_Client_ID); ds = new DataSet(); ds = DataBase.DB.ExecuteDataset(sql, param); foreach (DataRow dr in ds.Tables[0].Rows) { MTax tax = new MTax(ctx, dr, null); _cache.Add(tax.GetC_Tax_ID(), tax); list.Add(tax); } ds = null; //pstmt.close (); //pstmt = null; } catch (Exception e) { _log.Log(Level.SEVERE, sql, e); } finally { ds = null; } // Create Array retValue = new MTax[list.Count]; retValue = list.ToArray(); // _cacheAll.Add(key, retValue); return(retValue); }
/// <summary> /// Get Doc Value Workflow /// </summary> /// <param name="ctx">context</param> /// <param name="AD_Client_ID">client</param> /// <param name="AD_Table_ID">table</param> /// <returns>document value workflow array or null</returns> public static MWorkflow[] GetDocValue(Ctx ctx, int AD_Client_ID, int AD_Table_ID) { String key = "C" + AD_Client_ID + "T" + AD_Table_ID; //Reload if (_cacheDocValue.IsReset()) { String sql = "SELECT * FROM AD_Workflow " + "WHERE WorkflowType='V' AND IsActive='Y' AND IsValid='Y' " + "ORDER BY AD_Client_ID, AD_Table_ID"; List <MWorkflow> list = new List <MWorkflow>(); String oldKey = ""; String newKey = null; DataSet ds = null; try { ds = DataBase.DB.ExecuteDataset(sql, null, null); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow rs = ds.Tables[0].Rows[i]; MWorkflow wf = new MWorkflow(ctx, rs, null); newKey = "C" + wf.GetAD_Client_ID() + "T" + wf.GetAD_Table_ID(); if (!newKey.Equals(oldKey) && list.Count > 0) { MWorkflow[] wfs = new MWorkflow[list.Count]; wfs = list.ToArray(); _cacheDocValue.Add(oldKey, wfs); list = new List <MWorkflow>(); } oldKey = newKey; list.Add(wf); } ds = null; } catch (Exception e) { _log.Log(Level.SEVERE, sql, e); } // Last one if (list.Count > 0) { MWorkflow[] wfs = new MWorkflow[list.Count]; wfs = list.ToArray(); _cacheDocValue.Add(oldKey, wfs); } _log.Config("#" + _cacheDocValue.Count); } // Look for Entry MWorkflow[] retValue = (MWorkflow[])_cacheDocValue[key]; return(retValue); }
public List <string> GetUserBILogin() { List <string> lstString = new List <string>(); // add this to utiiy class Type type = (Type)cache.Get("VA037Svc"); if (type == null) { Assembly assem = Assembly.Load("VA037Svc"); type = assem.GetType("VA037Svc.Classes.Common"); cache.Add("VA037Svc", type); } if (type != null) { var o = Activator.CreateInstance(type); MethodInfo methodInfo = type.GetMethod("GetLoginSession", new Type[] { typeof(Ctx), typeof(VLogger) }); object[] param = new object[2]; param[0] = ctx; param[1] = log; var result = methodInfo.Invoke(o, param); lstString.Add(result.ToString()); PropertyInfo prop = type.GetProperty("BIUrl"); if (null != prop) { var propValue = prop.GetValue(type, null); lstString.Add(propValue.ToString()); } } return(lstString); }
} // get /// <summary> /// Get Client Info /// </summary> /// <param name="ctx">context</param> /// <param name="AD_Client_ID">id</param> /// <param name="trxName">optional trx</param> /// <returns>Client Info</returns> public static MClientInfo Get(Ctx ctx, int AD_Client_ID, Trx trxName) { int key = AD_Client_ID; MClientInfo info = (MClientInfo)s_cache[key]; if (info != null) { return(info); } // String sql = "SELECT * FROM AD_ClientInfo WHERE AD_Client_ID=" + AD_Client_ID; DataSet ds = null; try { VConnection vcon = VConnection.Get(); ds = DataBase.DB.ExecuteDataset(sql, null, trxName); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow dr = ds.Tables[0].Rows[i]; info = new MClientInfo(ctx, dr, null); if (trxName == null) { s_cache.Add(key, info); } } } catch (Exception ex) { _log.Log(Level.SEVERE, sql, ex); } ds = null; return(info); }
/// <summary> /// Get MCalendar from Cache /// </summary> /// <param name="ctx">context</param> /// <param name="C_Calendar_ID">id</param> /// <returns>MCalendar</returns> public static MCalendar Get(Context ctx, int C_Calendar_ID) { int key = C_Calendar_ID; MCalendar retValue = (MCalendar)cache[key]; if (retValue != null) { return(retValue); } retValue = new MCalendar(ctx, C_Calendar_ID, null); if (retValue.Get_ID() != 0) { cache.Add(key, retValue); } return(retValue); }
/// <summary> /// Translate to BPartner Language /// </summary> private void Translate() { if (_bpartner != null && _bpartner.GetAD_Language() != null) { String key = _bpartner.GetAD_Language() + Get_ID(); MMailTextTrl trl = cacheTrl[key]; if (trl == null) { trl = GetTranslation(_bpartner.GetAD_Language()); if (trl != null) { cacheTrl.Add(key, trl); } } if (trl != null) { _mailHeader = trl.mailHeader; _mailText = trl.mailText; _mailText2 = trl.mailText2; _mailText3 = trl.mailText3; } } // No Translation _mailHeader = base.GetMailHeader(); _mailText = base.GetMailText(); _mailText2 = base.GetMailText2(); _mailText3 = base.GetMailText3(); }
/* Load Regions (cached) * @param ctx context */ private static void LoadAllRegions(Ctx ctx) { s_regions = new CCache <String, MRegion>("C_Region", 100); String sql = "SELECT * FROM C_Region WHERE IsActive='Y'"; try { DataSet stmt = DataBase.DB.ExecuteDataset(sql, null, null); for (int i = 0; i < stmt.Tables[0].Rows.Count; i++) { DataRow rs = stmt.Tables[0].Rows[i]; MRegion r = new MRegion(ctx, rs, null); s_regions.Add(r.GetC_Region_ID().ToString(), r); if (r.IsDefault()) { s_default = r; } } } catch (Exception e) { _log.Log(Level.SEVERE, sql, e); } _log.Fine(s_regions.Count + " - default=" + s_default); }
/** * Get MCashBook from Cache * @param ctx context * @param C_CashBook_ID id * @return MCashBook */ public static MCashBook Get(Ctx ctx, int C_CashBook_ID) { int key = C_CashBook_ID; MCashBook retValue = (MCashBook)_cache[key]; if (retValue != null) { return(retValue); } retValue = new MCashBook(ctx, C_CashBook_ID, null); if (retValue.Get_ID() != 0) { _cache.Add(key, retValue); } return(retValue); }
/// <summary> ///Get Default Conversion Rate for Client/Org /// </summary> /// <param name="AD_Client_ID">client</param> /// <returns>C_ConversionType_ID or 0 if not found</returns> public static int GetDefault(int AD_Client_ID) { // Try Cache int key = AD_Client_ID; int ii = (int)s_cache[key]; if (ii != 0) { //return ii.intValue(); return(ii); } // Get from DB int C_ConversionType_ID = 0; String sql = "SELECT C_ConversionType_ID " + "FROM C_ConversionType " + "WHERE IsActive='Y'" + " AND AD_Client_ID IN (0, @param1)" // #1 + "ORDER BY IsDefault DESC, AD_Client_ID DESC"; C_ConversionType_ID = DataBase.DB.GetSQLValue(null, sql, AD_Client_ID); // Return s_cache.Add(key, C_ConversionType_ID); return(C_ConversionType_ID); }
/// <summary> /// Get MRfQLine from Cache /// </summary> /// <param name="ctx">context</param> /// <param name="C_RfQLine_ID">ID</param> /// <param name="trxName">Transaction</param> /// <returns>MRFQLINE</returns> public static MRfQLine Get(Ctx ctx, int C_RfQLine_ID, Trx trxName) { int key = C_RfQLine_ID; MRfQLine retValue = (MRfQLine)s_cache[key]; if (retValue != null) { return(retValue); } retValue = new MRfQLine(ctx, C_RfQLine_ID, trxName); if (retValue.Get_ID() != 0) { s_cache.Add(key, retValue); } return(retValue); }
/** * Get Language specific Message Map * @param ad_language Language Key * @return HashMap of Language */ public CCache <String, String> GetMsgMap(String ad_language) { String AD_Language = ad_language; if (AD_Language == null || AD_Language.Length == 0) { AD_Language = Language.GetBaseAD_Language(); } // Do we have the language ? CCache <String, String> retValue = (CCache <String, String>)_languages[AD_Language]; if (retValue != null && retValue.Size() > 0) { return(retValue); } // Load Language retValue = InitMsg(AD_Language); if (retValue != null) { _languages.Add(AD_Language, retValue); return(retValue); } return(retValue); } // getMsgMap
/// <summary> /// Get Charts /// </summary> /// <param name="D_Chart_ID">Chart ID</param> /// <returns>Charts</returns> static public MSeriesFilter Get(int D_SeriesFilter_ID) { int key = D_SeriesFilter_ID; MSeriesFilter msf = null; if (s_chart.ContainsKey(key)) { msf = s_chart[key]; } if (msf == null) { msf = new MSeriesFilter(Env.GetCtx(), key, null); if (s_chart.ContainsKey(key)) { s_chart[key] = msf; } else { s_chart.Add(key, msf); } } else { s_log.Config("Chart ID = " + key); } return(msf); }
/// <summary> /// Get Period from Cache /// </summary> /// <param name="ctx">context</param> /// <param name="C_Period_ID">id</param> /// <returns>MPeriod</returns> public static MPeriod Get(Ctx ctx, int C_Period_ID) { int key = C_Period_ID; MPeriod retValue = (MPeriod)cache[key]; if (retValue != null) { return(retValue); } // retValue = new MPeriod(ctx, C_Period_ID, null); if (retValue.Get_ID() != 0) { cache.Add(key, retValue); } return(retValue); }
} // getColumns() // getColumns() /** * Get Table from Cache * @param ctx context * @param AD_Table_ID id * @return MTable */ public static MTable Get(Ctx ctx, int AD_Table_ID) { int key = AD_Table_ID; MTable retValue = null; s_cache.TryGetValue(key, out retValue); if (retValue != null) { return(retValue); } retValue = new MTable(ctx, AD_Table_ID, null); if (retValue.Get_ID() != 0) { s_cache.Add(key, retValue); } return(retValue); }
} // Get /** * Get Default Request Status * @param ctx context * @param R_RequestType_ID request type * @return Request Type */ public static MStatus GetDefault(Ctx ctx, int R_RequestType_ID) { int key = R_RequestType_ID; MStatus retValue = (MStatus)_cacheDefault[key]; if (retValue != null) { return(retValue); } // Get New String sql = "SELECT * FROM R_Status s " + "WHERE EXISTS (SELECT * FROM R_RequestType rt " + "WHERE rt.R_StatusCategory_ID=s.R_StatusCategory_ID" + " AND rt.R_RequestType_ID=@R_RequestType_ID)" + " AND IsDefault='Y' " + "ORDER BY SeqNo"; //PreparedStatement pstmt = null; DataTable dt = null; IDataReader idr = null; try { // pstmt = DataBase.prepareStatement (sql, null); // pstmt.SetInt(1, R_RequestType_ID); SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@R_RequestType_ID", R_RequestType_ID); idr = DataBase.DB.ExecuteReader(sql, param); dt = new DataTable(); dt.Load(idr); idr.Close(); //ResultSet dr = pstmt.executeQuery (); foreach (DataRow dr in dt.Rows) { retValue = new MStatus(ctx, dr, null); } } catch (Exception ex) { if (idr != null) { idr.Close(); } _log.Log(Level.SEVERE, sql, ex); } finally { if (idr != null) { idr.Close(); } dt = null; } if (retValue != null) { _cacheDefault.Add(key, retValue); } return(retValue); } // GetDefault
} // loadStart /// <summary> ///MLookup Loader ends loading, so add it to cache /// </summary> /// <param name="info"></param> /// <param name="lookup"></param> public static void LoadEnd(VLookUpInfo info, Dictionary <Object, NamePair> lookup, bool allLoaded, bool hasInActive) { if (info.isValidated && lookup.Count > 0) { string key = GetKey(info); s_loadedLookups.Add(key, lookup); s_loadedLookupsParam.Add(key, new KeyValuePair <bool, bool>(allLoaded, hasInActive)); } }
/// <summary> /// Get Price List (cached) /// </summary> /// <param name="ctx">context</param> /// <param name="M_PriceList_ID">id</param> /// <param name="trxName">transaction</param> /// <returns>PriceList</returns> public static MPriceList Get(Ctx ctx, int M_PriceList_ID, Trx trxName) { int key = M_PriceList_ID; MPriceList retValue = (MPriceList)_cache[key]; try { if (retValue == null) { retValue = new MPriceList(ctx, M_PriceList_ID, trxName); _cache.Add(key, retValue); } } catch { } return(retValue); }
/// <summary> /// Get UOM from Cache /// </summary> /// <param name="ctx"></param> /// <param name="C_UOM_ID"></param> /// <returns>UOM</returns> public static MUOM Get(Ctx ctx, int C_UOM_ID) { if (s_cache.Count == 0) { LoadUOMs(ctx); } // int ii = C_UOM_ID; MUOM uom = (MUOM)s_cache[ii]; if (uom != null) { return(uom); } // uom = new MUOM(ctx, C_UOM_ID, null); s_cache.Add(Utility.Util.GetValueOfInt(C_UOM_ID), uom); return(uom); }
} // isNotLogged /// <summary> /// Fill Log with tables to be logged /// </summary> private static void FillChangeLog() { List <int> list = new List <int>(40); String sql = "SELECT t.AD_Table_ID ,t.ChangeLogLevel FROM AD_Table t " + "WHERE (t.IsChangeLog='Y' AND (t.ChangeLogLevel='A' or t.ChangeLogLevel='U') )" // also inactive + " OR EXISTS (SELECT * FROM AD_Column c " + "WHERE t.AD_Table_ID=c.AD_Table_ID AND c.ColumnName='EntityType') " + "ORDER BY t.AD_Table_ID"; DataTable dt = null; IDataReader idr = null; try { idr = DataBase.DB.ExecuteReader(sql, null, null); dt = new DataTable(); dt.Load(idr); idr.Close(); int totalCount = dt.Rows.Count; for (int i = 0; i < totalCount; i++) { DataRow dr = dt.Rows[i]; String changeLogLevel = (String)dr[1]; int AD_Table_ID = Convert.ToInt32(dr[0]); if (changeLogLevel.Equals("A")) { changeLogAll.Add(AD_Table_ID, AD_Table_ID); } else if (changeLogLevel.Equals("U")) { changeLogUpdate.Add(AD_Table_ID, AD_Table_ID); } } } catch (Exception e) { if (idr != null) { idr.Close(); } _log.Log(Level.SEVERE, sql, e); } finally { dt = null; } //// Convert to Array //changeLog = new int[list.Count]; //for (int i = 0; i < changeLog.Length; i++) //{ // int id = list[i]; // changeLog[i] = int.Parse(id.ToString()); //} _log.Info("#" + changeLogAll.Count); } // fillChangeLog
/** * Get BankAccount from Cache * @param ctx context * @param C_BankAccount_ID id * @return MBankAccount */ public static MBankAccount Get(Ctx ctx, int C_BankAccount_ID) { int key = C_BankAccount_ID; MBankAccount retValue = (MBankAccount)_cache[key]; if (retValue != null) return retValue; retValue = new MBankAccount(ctx, C_BankAccount_ID, null); if (retValue.Get_ID() != 0) _cache.Add(key, retValue); return retValue; }
/// <summary> /// Get MProcess from Cache /// </summary> /// <param name="ctx">context</param> /// <param name="AD_Process_ID">AD_Process_ID</param> /// <returns>MProcess</returns> public static MProcess Get(Ctx ctx, int AD_Process_ID) { int key = AD_Process_ID; MProcess retValue = null; if (_cache.ContainsKey(key)) { retValue = (MProcess)_cache[key]; } if (retValue != null) { return(retValue); } retValue = new MProcess(ctx, AD_Process_ID, null); if (retValue.Get_ID() != 0) { _cache.Add(key, retValue); } return(retValue); }
/// <summary> ///Get Document Type (cached) /// </summary> /// <param name="ctx">Ctx</param> /// <param name="C_DocType_ID">id</param> /// <returns>document type</returns> static public MDocType Get(Ctx ctx, int C_DocType_ID) { int key = (int)C_DocType_ID; MDocType retValue = (MDocType)s_cache[key]; if (retValue == null) { retValue = new MDocType(ctx, C_DocType_ID, null); s_cache.Add(key, retValue); } return(retValue); }
/// <summary> /// Load All Modules and maintain Cache /// </summary> private static void LoadAllModules() { string aName = "", nSpace = "", vNo = "", vId = ""; //int keyId = 0; //bool isRead = false; System.Data.IDataReader dr = null; try { if (_cacheModules.Count == 0) { dr = DataBase.DB.ExecuteReader(" SELECT AD_ModuleInfo_ID,AssemblyName,NameSpace," + " VersionNo,VersionID,prefix FROM AD_ModuleInfo WHERE Prefix != 'VIS_'"); Tuple <string, string, string, string> modules = null; while (dr.Read()) { aName = dr[1].ToString() + "Svc"; nSpace = dr[2].ToString(); vNo = dr[3].ToString(); vId = dr[4].ToString(); modules = new Tuple <string, string, string, string>(dr[1].ToString() + "Svc", dr[2].ToString(), dr[3].ToString(), dr[4].ToString()); if (!_cacheModules.ContainsKey(dr[5].ToString())) { _cacheModules.Add(dr[5].ToString(), modules); } } dr.Close(); dr = DataBase.DB.ExecuteReader(" SELECT AD_ModuleInfo_ID,AssemblyName,NameSpace," + " VersionNo,VersionID,prefix,Name FROM AD_ModuleInfo WHERE Prefix='VIS_' "); while (dr.Read()) { modules = new Tuple <string, string, string, string>(dr[1].ToString() + "Svc", dr[2].ToString(), dr[3].ToString(), dr[4].ToString()); if (!_cacheVISModules.ContainsKey(dr[6].ToString())) { _cacheVISModules.Add(dr[6].ToString(), modules); } } dr.Close(); } } catch (Exception ex) { _log.Config("Error Loading Modules" + ex.Message); if (dr != null) { dr.Close(); dr = null; } } }
static public MPrintFont Get(int AD_PrintFont_ID) { int key = AD_PrintFont_ID; MPrintFont pf = (MPrintFont)_fonts[key]; if (pf == null) { pf = new MPrintFont(VAdvantage.Utility.Env.GetContext(), AD_PrintFont_ID, null); _fonts.Add(key, pf); } return(pf); } // get
/// <summary> ///Get TranslationTable from Cache /// </summary> /// <param name="baseTableName">base table name</param> /// <returns>TranslationTable</returns> public static TranslationTable Get(String baseTableName) { TranslationTable retValue = (TranslationTable)s_cache[baseTableName]; if (retValue != null) { return(retValue); } retValue = new TranslationTable(baseTableName); s_cache.Add(baseTableName, retValue); return(retValue); }