Ejemplo n.º 1
0
        /// <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);
        }