/**
         *  Create Lot
         *  @param M_Product_ID product used if new
         *	@return lot info
         */
        public KeyNamePair CreateLot(int M_Product_ID)
        {
            KeyNamePair retValue    = null;
            int         M_LotCtl_ID = GetMAttributeSet().GetM_LotCtl_ID();

            if (M_LotCtl_ID != 0)
            {
                MLotCtl ctl = new MLotCtl(GetCtx(), M_LotCtl_ID, null);
                MLot    lot = ctl.CreateLot(M_Product_ID);
                SetM_Lot_ID(lot.GetM_Lot_ID());
                SetLot(lot.GetName());
                retValue = new KeyNamePair(lot.GetM_Lot_ID(), lot.GetName());
            }
            return(retValue);
        }
        /**
         *  To to find lot and set Lot/ID
         *	@param Lot lot
         *	@param M_Product_ID product
         */
        public void SetLot(String Lot, int M_Product_ID)
        {
            //	Try to find it
            MLot mLot = MLot.GetProductLot(GetCtx(), M_Product_ID, Lot, Get_TrxName());

            if (mLot != null)
            {
                SetM_Lot_ID(mLot.GetM_Lot_ID());
            }
            SetLot(Lot);
        }