Ejemplo n.º 1
0
        public static bool CheckPackage(ResultObject res, int packageId, DemandPackage demand)
        {
            int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive);

            if (packageCheck < 0)
            {
                res.ErrorCodes.Add(BusinessErrorCodes.ToText(packageCheck));
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public static int CheckPackage(int packageId, DemandPackage demand)
        {
            // load package
            PackageInfo package = PackageController.GetPackage(packageId);

            if (package == null)
            {
                return(BusinessErrorCodes.ERROR_PACKAGE_NOT_FOUND);
            }

            return(CheckPackage(package, demand));
        }
Ejemplo n.º 3
0
        public static int CheckPackage(PackageInfo package, DemandPackage demand)
        {
            if ((demand & DemandPackage.IsActive) == DemandPackage.IsActive)
            {
                // should make a check if the package is active
                if (package.StatusId == (int)PackageStatus.Cancelled)
                {
                    return(BusinessErrorCodes.ERROR_PACKAGE_CANCELLED);
                }
                else if (package.StatusId == (int)PackageStatus.Suspended)
                {
                    return(BusinessErrorCodes.ERROR_PACKAGE_SUSPENDED);
                }
            }

            return(0);
        }
Ejemplo n.º 4
0
        public static int CheckPackage(PackageInfo package, DemandPackage demand)
        {
            if ((demand & DemandPackage.IsActive) == DemandPackage.IsActive)
            {
                // should make a check if the package is active
                if (package.StatusId == (int)PackageStatus.Cancelled)
                    return BusinessErrorCodes.ERROR_PACKAGE_CANCELLED;
                else if (package.StatusId == (int)PackageStatus.Suspended)
                    return BusinessErrorCodes.ERROR_PACKAGE_SUSPENDED;
            }

            return 0;
        }
Ejemplo n.º 5
0
        public static int CheckPackage(int packageId, DemandPackage demand)
        {
            // load package
            PackageInfo package = PackageController.GetPackage(packageId);
            if (package == null)
                return BusinessErrorCodes.ERROR_PACKAGE_NOT_FOUND;

            return CheckPackage(package, demand);
        }
Ejemplo n.º 6
0
 public static bool CheckPackage(ResultObject res, int packageId, DemandPackage demand)
 {
     int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive);
     if (packageCheck < 0)
     {
         res.ErrorCodes.Add(BusinessErrorCodes.ToText(packageCheck));
         return false;
     }
     return true;
 }