Esempio n. 1
0
 /// <summary>
 /// Parent Constructor.
 /// Also creates qtys if RfQ Qty
 /// Is saved if there are qtys(!)
 /// </summary>
 /// <param name="response">response</param>
 /// <param name="line">line</param>
 public MRfQResponseLine(MRfQResponse response, MRfQLine line)
     : base(response.GetCtx(), 0, response.Get_TrxName())
 {
     SetClientOrg(response);
     SetC_RfQResponse_ID(response.GetC_RfQResponse_ID());
     //
     SetC_RfQLine_ID(line.GetC_RfQLine_ID());
     //
     SetIsSelectedWinner(false);
     SetIsSelfService(false);
     //
     MRfQLineQty[] qtys = line.GetQtys();
     for (int i = 0; i < qtys.Length; i++)
     {
         if (qtys[i].IsActive() && qtys[i].IsRfQQty())
         {
             if (Get_ID() == 0)  //	save this line
             {
                 Save();
             }
             MRfQResponseLineQty qty = new MRfQResponseLineQty(this, qtys[i]);
             qty.Save();
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// After Save
 /// </summary>
 /// <param name="newRecord"></param>
 /// <param name="success">success</param>
 /// <returns>success</returns>
 protected override bool AfterSave(bool newRecord, bool success)
 {
     if (!IsActive())
     {
         GetQtys(false);
         for (int i = 0; i < _qtys.Length; i++)
         {
             MRfQResponseLineQty qty = _qtys[i];
             if (qty.IsActive())
             {
                 qty.SetIsActive(false);
                 qty.Save();
             }
         }
     }
     return(success);
 }