Exemplo n.º 1
0
        /// <summary>
        /// Copy Lines From other Commission
        /// </summary>
        /// <param name="otherCom">commission</param>
        /// <returns>number of lines copied</returns>
        public int CopyLinesFrom(MCommission otherCom)
        {
            if (otherCom == null)
            {
                return(0);
            }
            MCommissionLine[] fromLines = otherCom.GetLines();
            int count = 0;

            for (int i = 0; i < fromLines.Length; i++)
            {
                MCommissionLine line = new MCommissionLine(GetCtx(), 0, Get_TrxName());
                PO.CopyValues(fromLines[i], line, GetAD_Client_ID(), GetAD_Org_ID());
                line.Set_ValueNoCheck("C_CommissionLine_ID", null);     //	new
                line.SetC_Commission_ID(GetC_Commission_ID());
                if (line.Save())
                {
                    count++;
                }
            }
            if (fromLines.Length != count)
            {
                log.Log(Level.SEVERE, "Line difference - From=" + fromLines.Length + " <> Saved=" + count);
            }
            return(count);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Parent Constructor
 /// </summary>
 /// <param name="commission">parent</param>
 public MCommissionRun(MCommission commission)
     : this(commission.GetCtx(), 0, commission.Get_TrxName())
 {
     SetClientOrg(commission);
     SetC_Commission_ID(commission.GetC_Commission_ID());
 }