/// <summary> /// Parent Constructor /// </summary> /// <param name="rfq"></param> /// <param name="subscriber"></param> public MRfQResponse(MRfQ rfq, MRfQTopicSubscriber subscriber) : this(rfq, subscriber, subscriber.GetC_BPartner_ID(), subscriber.GetC_BPartner_Location_ID(), subscriber.GetAD_User_ID()) { }
/// <summary> /// Get Current Topic Subscribers /// </summary> /// <returns>array subscribers</returns> public MRfQTopicSubscriber[] GetSubscribers() { List <MRfQTopicSubscriber> list = new List <MRfQTopicSubscriber>(); String sql = "SELECT * FROM C_RfQ_TopicSubscriber " + "WHERE C_RfQ_Topic_ID=" + GetC_RfQ_Topic_ID() + " AND IsActive='Y'"; DataTable dt = null; IDataReader idr = null; try { idr = DataBase.DB.ExecuteReader(sql, null, Get_TrxName()); dt = new DataTable(); dt.Load(idr); idr.Close(); foreach (DataRow dr in dt.Rows) { list.Add(new MRfQTopicSubscriber(GetCtx(), dr, Get_TrxName())); } } catch (Exception e) { if (idr != null) { idr.Close(); } log.Log(Level.SEVERE, "getSubscribers", e); } finally { dt = null; if (idr != null) { idr.Close(); } } MRfQTopicSubscriber[] retValue = new MRfQTopicSubscriber[list.Count]; retValue = list.ToArray(); return(retValue); }
/// <summary> /// Parent Constructor. /// Automatically saved if lines were created /// Saved automatically /// @param rfq /// </summary> /// <param name="rfq">rfq</param> /// <param name="subscriber">optional subscriber</param> /// <param name="C_BPartner_ID">bpartner</param> /// <param name="C_BPartner_Location_ID">bpartner location</param> /// <param name="AD_User_ID">bpartner user</param> public MRfQResponse(MRfQ rfq, MRfQTopicSubscriber subscriber, int C_BPartner_ID, int C_BPartner_Location_ID, int AD_User_ID) : this(rfq.GetCtx(), 0, rfq.Get_TrxName()) { SetClientOrg(rfq); SetC_RfQ_ID(rfq.GetC_RfQ_ID()); SetC_Currency_ID(rfq.GetC_Currency_ID()); SetName(rfq.GetName()); _rfq = rfq; // Subscriber info SetC_BPartner_ID(C_BPartner_ID); SetC_BPartner_Location_ID(C_BPartner_Location_ID); SetAD_User_ID(AD_User_ID); // Create Lines MRfQLine[] lines = rfq.GetLines(); for (int i = 0; i < lines.Length; i++) { if (!lines[i].IsActive()) { continue; } // Product on "Only" list if (subscriber != null && !subscriber.IsIncluded(lines[i].GetM_Product_ID())) { continue; } // if (Get_ID() == 0) // save Response { Save(); } MRfQResponseLine line = new MRfQResponseLine(this, lines[i]); // line is not saved (dumped) if there are no Qtys } }