示例#1
0
 /// <summary>
 /// Get All Attributes
 /// </summary>
 /// <returns>Registration Attributes</returns>
 public MRegistrationAttribute[] GetAttributes()
 {
     if (_allAttributes == null)
     {
         _allAttributes = MRegistrationAttribute.GetAll(GetCtx());
     }
     return(_allAttributes);
 }       //	getAttributes
示例#2
0
        }       //	getAll

        /// <summary>
        /// Get Registration Attribute (cached)
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="A_RegistrationAttribute_ID">id</param>
        /// <param name="trxName">trx</param>
        /// <returns>Registration Attribute</returns>
        public static MRegistrationAttribute Get(Ctx ctx, int A_RegistrationAttribute_ID, Trx trxName)
        {
            int key = Utility.Util.GetValueOfInt(A_RegistrationAttribute_ID);
            MRegistrationAttribute retValue = (MRegistrationAttribute)_cache[key];    // .get(key);

            if (retValue == null)
            {
                retValue = new MRegistrationAttribute(ctx, A_RegistrationAttribute_ID, trxName);
                _cache.Add(key, retValue);
            }
            return(retValue);
        }       //	getAll
示例#3
0
 /// <summary>
 /// Get Registration Attribute
 /// </summary>
 /// <returns>name of registration attribute</returns>
 public String GetRegistrationAttribute()
 {
     if (_registrationAttribute == null)
     {
         int A_RegistrationAttribute_ID = GetA_RegistrationAttribute_ID();
         MRegistrationAttribute att     = MRegistrationAttribute.Get(GetCtx(), A_RegistrationAttribute_ID, Get_TrxName());
         _registrationAttribute            = att.GetName();
         _registrationAttributeDescription = att.GetDescription();
         _seqNo = att.GetSeqNo();
     }
     return(_registrationAttribute);
 }       //	getRegistrationAttribute
示例#4
0
        /// <summary>
        ///  Get All Asset Registration Attributes (not cached).	Refreshes Cache for direct addess
        /// </summary>
        /// <param name="ctx">context</param>
        /// <returns>array of Registration Attributes</returns>
        public static MRegistrationAttribute[] GetAll(Ctx ctx)
        {
            //	Store/Refresh Cache and add to List
            List <MRegistrationAttribute> list = new List <MRegistrationAttribute>();
            String sql = "SELECT * FROM A_RegistrationAttribute "
                         + "WHERE AD_Client_ID=@param "
                         + "ORDER BY SeqNo";
            int AD_Client_ID = ctx.GetAD_Client_ID();

            SqlParameter[] param = new SqlParameter[1];
            IDataReader    idr   = null;

            try
            {
                //pstmt = DataBase.prepareStatement(sql, null);
                //pstmt.setInt(1, AD_Client_ID);
                param[0] = new SqlParameter("@param", AD_Client_ID);
                idr      = DataBase.DB.ExecuteReader(sql, param, null);
                while (idr.Read())
                {
                    MRegistrationAttribute value = new MRegistrationAttribute(ctx, idr, null);
                    int key = Utility.Util.GetValueOfInt(value.GetA_RegistrationAttribute_ID());
                    //s_cache.put(key, value);
                    _cache.Add(key, value);
                    list.Add(value);
                }
                idr.Close();
            }
            catch (Exception e)
            {
                if (idr != null)
                {
                    idr.Close();
                }
                _log.Log(Level.SEVERE, sql, e);
            }

            //
            MRegistrationAttribute[] retValue = new MRegistrationAttribute[list.Count];
            retValue = list.ToArray();
            return(retValue);
        }       //	getAll