Ejemplo n.º 1
0
        /**
         *  Create Confirmation or return existing one
         *	@param ship shipment
         *	@param confirmType confirmation type
         *	@param checkExisting if false, new confirmation is created
         *	@return Confirmation
         */
        public static MInOutConfirm Create(MInOut ship, String confirmType, Boolean checkExisting)
        {
            if (checkExisting)
            {
                MInOutConfirm[] confirmations = ship.GetConfirmations(false);
                for (int i = 0; i < confirmations.Length; i++)
                {
                    MInOutConfirm confirm = confirmations[i];
                    if (confirm.GetConfirmType().Equals(confirmType))
                    {
                        _log.Info("create - existing: " + confirm);
                        return(confirm);
                    }
                }
            }

            MInOutConfirm confirm1 = new MInOutConfirm(ship, confirmType);

            confirm1.Save(ship.Get_TrxName());
            MInOutLine[] shipLines = ship.GetLines(false);
            for (int i = 0; i < shipLines.Length; i++)
            {
                MInOutLine        sLine = shipLines[i];
                MInOutLineConfirm cLine = new MInOutLineConfirm(confirm1);
                cLine.SetInOutLine(sLine);
                cLine.Save(ship.Get_TrxName());
            }
            _log.Info("New: " + confirm1);
            return(confirm1);
        }
 /// <summary>
 /// Parent Construvtor
 /// </summary>
 /// <param name="header">parent</param>
 public MInOutLineConfirm(MInOutConfirm header)
     : this(header.GetCtx(), 0, header.Get_TrxName())
 {
     SetClientOrg(header);
     SetM_InOutConfirm_ID(header.GetM_InOutConfirm_ID());
 }