public void SetACLs(PurchaseLine _PurchaseLine, Services.Packages.Security.PurchaseLineAccessControlListCollection _ACLs, string SessionToken)
        {
            _PurchaseLine.Reload();

            //*
            if (!Services.Packages.Security.PurchaseLineSecureService.CheckAccessImp(_PurchaseLine, SessionToken, "Traverse"))
                throw new UnauthorizedAccessException("Access Denied");
            //*/

            /*
            _ACLs.Reload();
            if (_ACLs.Exists && !Services.Packages.Security.Security.PurchaseLineAccessControlListSecureService.CheckAccessImp(_ACLs, SessionToken, "Update"))
                throw new UnauthorizedAccessException("Access Denied");
            else if (!_ACLs.Exists && !Services.Packages.Security.PurchaseLineSecureService.CheckAccessImp(_PurchaseLine, SessionToken, "Create ACLs"))
                throw new UnauthorizedAccessException("Access Denied");
            //*/

            _PurchaseLine.ACLs = _ACLs;
            _PurchaseLine.Update();
        }
        public PurchaseLine Reload(PurchaseLine _PurchaseLine, string SessionToken)
        {
            _PurchaseLine.Reload();

            if (!PurchaseLineSecureService.CheckAccessImp(_PurchaseLine, SessionToken, "Read"))
                throw new UnauthorizedAccessException("Access Denied");

            return _PurchaseLine;
        }
        public Services.Packages.Purchase GetPurchaseOrder(PurchaseLine _PurchaseLine, string SessionToken)
        {
            _PurchaseLine.Reload();

            //*
            if (!Services.Packages.Security.PurchaseLineSecureService.CheckAccessImp(_PurchaseLine, SessionToken, "Traverse"))
                throw new UnauthorizedAccessException("Access Denied");
            //*/

            //*
            if (!Services.Packages.Security.PurchaseSecureService.CheckAccessImp(_PurchaseLine.PurchaseOrder, SessionToken, "Read"))
                throw new UnauthorizedAccessException("Access Denied");
            //*/

            return _PurchaseLine.PurchaseOrder;
        }
        public Services.Packages.Security.PurchaseLineAccessControlListCollection GetACLs(PurchaseLine _PurchaseLine, string SessionToken)
        {
            _PurchaseLine.Reload();

            //*
            if (!Services.Packages.Security.PurchaseLineSecureService.CheckAccessImp(_PurchaseLine, SessionToken, "Traverse"))
                throw new UnauthorizedAccessException("Access Denied");
            //*/

            /*
            if (!Services.Packages.Security.Security.PurchaseLineAccessControlListSecureService.CheckAccessImp(_PurchaseLine.ACLs, SessionToken, "Read"))
                throw new UnauthorizedAccessException("Access Denied");
            //*/

            return _PurchaseLine.ACLs;
        }
        public void CreateObjectFromPurchaseOrder(PurchaseLine _PurchaseLine, Services.Packages.Purchase _PurchaseOrder, string SessionToken)
        {
            ModelSession session = PurchaseLineSecureService.CheckSessionImp(SessionToken);

            //if (!Services.Packages.Security.PurchaseSecureService.CheckAccessImp(_PurchaseOrder, SessionToken, "Create OrderLines"))
            //	throw new UnauthorizedAccessException("Access Denied");

            _PurchaseLine.Reload();

            if (!_PurchaseLine.Exists && !Services.Packages.Security.PurchaseSecureService.CheckAccessImp(_PurchaseOrder, SessionToken, "Create OrderLines"))
                throw new UnauthorizedAccessException("Access Denied");
            else if (_PurchaseLine.Exists && !PurchaseLineSecureService.CheckAccessImp(_PurchaseLine, SessionToken, "Update"))
                throw new UnauthorizedAccessException("Access Denied");

            _PurchaseLine.Owner = session.User;
            _PurchaseLine.PurchaseOrder = _PurchaseOrder;
            _PurchaseLine.Create();
        }
            public void SetOwner(PurchaseLine _PurchaseLine, Services.Packages.Security.ModelUser _Owner, string SessionToken)
            {
                _PurchaseLine.Reload();

                //*
                if (!Services.Packages.Security.PurchaseLineSecureService.CheckAccessImp(_PurchaseLine, SessionToken, "Traverse"))
                throw new UnauthorizedAccessException("Access Denied");
                //*/

                //*
                _Owner.Reload();
                if (_Owner.Exists && !Services.Packages.Security.Security.ModelUserSecureService.CheckAccessImp(_Owner, SessionToken, "Update"))
                throw new UnauthorizedAccessException("Access Denied");
                else if (!_Owner.Exists && !Services.Packages.Security.PurchaseLineSecureService.CheckAccessImp(_PurchaseLine, SessionToken, "Create PurchaseLineOwning"))
                throw new UnauthorizedAccessException("Access Denied");
                //*/

                _PurchaseLine.Owner = _Owner;
                _PurchaseLine.Update();
            }