Esempio n. 1
0
        /// <summary>
        /// Get MRefTable from Cache
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="AD_Reference_ID">id</param>
        /// <returns>MRefTable</returns>
        public static MRefTable Get(Ctx ctx, int AD_Reference_ID)
        {
            int       key      = AD_Reference_ID;
            MRefTable retValue = (MRefTable)cache[key];

            if (retValue != null)
            {
                return(retValue);
            }
            retValue = new MRefTable(ctx, AD_Reference_ID, null);
            if (retValue.Get_ID() != 0)
            {
                cache.Add(key, retValue);
            }
            return(retValue);
        }
Esempio n. 2
0
        /// <summary>
        /// Get FK Name
        /// </summary>
        /// <returns>foreign key column name</returns>
        public String GetFKColumnName()
        {
            String keyColumnName = GetColumnName();
            int    displayType   = GetAD_Reference_ID();

            if (displayType == DisplayType.List)
            {
                return("Value");
            }
            if (displayType == DisplayType.Account)
            {
                return("C_ValidCombination_ID");
            }
            //
            if (displayType == DisplayType.Table)
            {
                int       AD_Reference_ID = GetAD_Reference_Value_ID();
                MRefTable rt = MRefTable.Get(GetCtx(), AD_Reference_ID);
                return(rt.GetKeyColumnName());
            }
            return(keyColumnName);
        }