/// <summary>
 /// Parent Constructor
 /// </summary>
 /// <param name="line"></param>
 /// <param name="qty"></param>
 public MRfQResponseLineQty(MRfQResponseLine line, MRfQLineQty qty)
     : this(line.GetCtx(), 0, line.Get_TrxName())
 {
     SetClientOrg(line);
     SetC_RfQResponseLine_ID(line.GetC_RfQResponseLine_ID());
     SetC_RfQLineQty_ID(qty.GetC_RfQLineQty_ID());
 }
 /// <summary>
 /// Get RfQ Line Qty
 /// </summary>
 /// <returns>RfQ Line Qty</returns>
 public MRfQLineQty GetRfQLineQty()
 {
     if (_rfqQty == null)
     {
         _rfqQty = MRfQLineQty.Get(GetCtx(), GetC_RfQLineQty_ID(), Get_TrxName());
     }
     return(_rfqQty);
 }
Example #3
0
        /// <summary>
        /// Get Quantities
        /// </summary>
        /// <param name="requery">requery</param>
        /// <returns>array of quantities</returns>
        public MRfQLineQty[] GetQtys(bool requery)
        {
            if (_qtys != null && !requery)
            {
                return(_qtys);
            }
            List <MRfQLineQty> list = new List <MRfQLineQty>();
            String             sql  = "SELECT * FROM C_RfQLineQty "
                                      + "WHERE C_RfQLine_ID=@param1 AND IsActive='Y' "
                                      + "ORDER BY Qty";
            DataTable   dt  = null;
            IDataReader idr = null;

            SqlParameter[] param = null;
            try
            {
                param    = new SqlParameter[1];
                param[0] = new SqlParameter("@param1", GetC_RfQLine_ID());
                idr      = DataBase.DB.ExecuteReader(sql, param, Get_TrxName());
                dt       = new DataTable();
                dt.Load(idr);
                idr.Close();
                foreach (DataRow dr in dt.Rows)// while (dr.next())
                {
                    list.Add(new MRfQLineQty(GetCtx(), dr, Get_TrxName()));
                }
            }
            catch (Exception e)
            {
                if (idr != null)
                {
                    idr.Close();
                }
                log.Log(Level.SEVERE, sql, e);
            }
            finally
            {
                dt = null;
                if (idr != null)
                {
                    idr.Close();
                }
            }

            //	Create Default (1)
            if (list.Count == 0)
            {
                MRfQLineQty qty = new MRfQLineQty(this);
                qty.Save();
                list.Add(qty);
            }

            _qtys = new MRfQLineQty[list.Count];
            _qtys = list.ToArray();
            return(_qtys);
        }
Example #4
0
        /// <summary>
        /// Get MRfQLineQty from Cache
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="C_RfQLineQty_ID">ID</param>
        /// <param name="trxName">Transaction</param>
        /// <returns>MRfQLineQty</returns>
        public static MRfQLineQty Get(Ctx ctx, int C_RfQLineQty_ID, Trx trxName)
        {
            int         key      = C_RfQLineQty_ID;
            MRfQLineQty retValue = (MRfQLineQty)s_cache[key];

            if (retValue != null)
            {
                return(retValue);
            }
            retValue = new MRfQLineQty(ctx, C_RfQLineQty_ID, trxName);
            if (retValue.Get_ID() != 0)
            {
                s_cache.Add(key, retValue);
            }
            return(retValue);
        }