Exemple #1
0
 internal RoleBetweenValue(ExtentFiltered extent, IRoleType roleType, object first, object second)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleBetween(roleType, first, second);
     this.roleType = roleType;
     this.first    = roleType.Normalize(first);
     this.second   = roleType.Normalize(second);
 }
Exemple #2
0
 internal RoleBetweenValue(ExtentFiltered extent, IRoleType roleType, object first, object second)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleBetween(roleType, first, second);
     this.roleType = roleType;
     this.first = roleType.Normalize(first);
     this.second = roleType.Normalize(second);
 }
Exemple #3
0
 internal AllorsPredicateRoleBetweenValueSql(AllorsExtentFilteredSql extent, IRoleType roleType, Object first, Object second)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleBetween(roleType, first, second);
     this.roleType = roleType;
     this.first = roleType.ObjectType is IUnit ? roleType.Normalize(first) : first;
     this.second = roleType.ObjectType is IUnit ? roleType.Normalize(second) : second;
 }
Exemple #4
0
        internal AllorsPredicateRoleBetweenValueSql(AllorsExtentFilteredSql extent, IRoleType roleType, Object first, Object second)
        {
            extent.CheckRole(roleType);
            PredicateAssertions.ValidateRoleBetween(roleType, first, second);
            this.roleType = roleType;
            this.first    = roleType.ObjectType is IUnit?roleType.Normalize(first) : first;

            this.second = roleType.ObjectType is IUnit?roleType.Normalize(second) : second;
        }
Exemple #5
0
 internal RoleLessThanValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleLessThan(roleType, obj);
     this.roleType = roleType;
     this.obj = roleType.Normalize(obj);
 }
Exemple #6
0
 internal RoleLessThanValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleLessThan(roleType, obj);
     this.roleType = roleType;
     this.obj      = roleType.Normalize(obj);
 }
 internal AllorsPredicateRoleGreaterThanValueSql(AllorsExtentFilteredSql extent, IRoleType roleType, Object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleGreaterThan(roleType, obj);
     this.roleType = roleType;
     this.obj      = roleType.ObjectType is IUnit?roleType.Normalize(obj) : obj;
 }
 internal AllorsPredicateRoleGreaterThanValueSql(AllorsExtentFilteredSql extent, IRoleType roleType, Object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleGreaterThan(roleType, obj);
     this.roleType = roleType;
     this.obj = roleType.ObjectType is IUnit ? roleType.Normalize(obj) : obj;
 }
 public RoleGreaterThanValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     CompositePredicateAssertions.ValidateRoleGreaterThan(roleType, obj);
     this.roleType = roleType;
     this.obj      = roleType.Normalize(obj);
 }
        public void SetUnitRole(IRoleType roleType, object unit)
        {
            if (unit == null)
            {
                this.RemoveUnitRole(roleType);
                return;
            }

            this.AssertNotDeleted();

            RoleAssertions.UnitRoleChecks(this, roleType);
            unit = roleType.Normalize(unit);
            this.session.SetUnitRole(this.objectId, roleType, unit);
        }
Exemple #11
0
 internal RoleEqualsValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleEquals(roleType, obj);
     this.roleType = roleType;
     if (obj is Enum)
     {
         if (((IUnit)roleType.ObjectType).IsInteger)
         {
             this.obj = (int)obj;
         }
         else
         {
             throw new Exception("Role Object Type " + roleType.ObjectType.Name + " doesn't support enumerations.");
         }
     }
     else
     {
         this.obj = roleType.ObjectType.IsUnit ? roleType.Normalize(obj) : obj;
     }
 }
Exemple #12
0
 internal RoleEqualsValue(ExtentFiltered extent, IRoleType roleType, object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleEquals(roleType, obj);
     this.roleType = roleType;
     if (obj is Enum)
     {
         if (((IUnit)roleType.ObjectType).IsInteger)
         {
             this.obj = (Int32)obj;
         }
         else
         {
             throw new Exception("Role Object Type " + roleType.ObjectType.Name + " doesn't support enumerations.");
         }
     }
     else
     {
         this.obj = roleType.ObjectType.IsUnit ? roleType.Normalize(obj) : obj;
     }
 }
Exemple #13
0
 internal AllorsPredicateRoleUnitEqualsValueSql(AllorsExtentFilteredSql extent, IRoleType roleType, Object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleEquals(roleType, obj);
     this.roleType = roleType;
     if (obj is Enum)
     {
         var unitType = roleType.ObjectType as IUnit;
         if (unitType != null && unitType.IsInteger)
         {
             this.obj = (int)obj;
         }
         else
         {
             throw new Exception("Role Object Type " + roleType.ObjectType.SingularName + " doesn't support enumerations.");
         }
     }
     else
     {
         this.obj = roleType.ObjectType is IUnit?roleType.Normalize(obj) : obj;
     }
 }
Exemple #14
0
 internal AllorsPredicateRoleUnitEqualsValueSql(AllorsExtentFilteredSql extent, IRoleType roleType, Object obj)
 {
     extent.CheckRole(roleType);
     PredicateAssertions.ValidateRoleEquals(roleType, obj);
     this.roleType = roleType;
     if (obj is Enum)
     {
         var unitType = roleType.ObjectType as IUnit;
         if (unitType != null && unitType.IsInteger)
         {
             this.obj = (int)obj;
         }
         else
         {
             throw new Exception("Role Object Type " + roleType.ObjectType.SingularName + " doesn't support enumerations.");
         }
     }
     else
     {
         this.obj = roleType.ObjectType is IUnit ? roleType.Normalize(obj) : obj;
     }
 }
Exemple #15
0
        public void SetUnitRole(IRoleType roleType, object unit)
        {
            if (unit == null)
            {
                this.RemoveUnitRole(roleType);
                return;
            }

            this.AssertNotDeleted();

            RoleAssertions.UnitRoleChecks(this, roleType);
            unit = roleType.Normalize(unit);
            this.session.SetUnitRole(this.objectId, roleType, unit);
        }
Exemple #16
0
        public virtual void SetUnitRole(IRoleType roleType, object role)
        {
            this.AssertExist();

            RoleAssertions.UnitRoleChecks(this, roleType);

            if (role != null)
            {
                role = roleType.Normalize(role);
            }

            var oldUnit = this.GetUnitRole(roleType);
            if (!Equals(oldUnit, role))
            {
                this.Roles.SetUnitRole(roleType, role);
            }
        }