예제 #1
0
        //Add Delete Operations - Deals with adding/deleting User's CMS level functions.
        #region "Add/Update/Delete Operations"
        public static bool UpdateUserSubState(UserRegionalAccessProfile UserSubStateRegionProfile, int UpdatedBy)
        {
            //using (TransactionScope scope = new TransactionScope(TransactionScopeOption.RequiresNew))
            //{
            //Save the Descriptors for User and then Approve.
            string ErrorMessage;

            if (UserSubStateRegionDAL.UpdateUserSubState(UserSubStateRegionProfile, UpdatedBy))
            {
                int UserId = UserSubStateRegionProfile.UserId;
                IEnumerable <int> NewDescriptorIds = UserSubStateRegionProfile.DescriptorIDList;
                int AgencyId = UserSubStateRegionProfile.RegionId;
                if (!UserBLL.SaveDescriptors(UserId, NewDescriptorIds, AgencyId, UpdatedBy, out ErrorMessage))
                {
                    return(false);
                }

                //scope.Complete();
                return(true);
            }
            else
            {
                return(false);
            }
            //}
        }
예제 #2
0
 //Get Operations
 #region "Get Operations"
 public static IEnumerable <UserRegionalAccessProfile> GetUserSubStateRegionalProfiles(int UserId, bool OnlyAdminProfiles)
 {
     if (OnlyAdminProfiles)
     {
         return(from profile in UserSubStateRegionDAL.GetUserSubStateRegionalProfiles(UserId) where profile.IsAdmin == true select profile);
     }
     else
     {
         return(UserSubStateRegionDAL.GetUserSubStateRegionalProfiles(UserId));
     }
 }
예제 #3
0
 //Deals with access to an CMS level access
 #region "Grant/Revoke Operations"
 //public static bool GrantSubStateRegionAccessToUser(int UserId, int SubStateRegionId, bool IsAdmin, int GrantedById)
 public static bool GrantSubStateRegionAccessToUser(UserRegionalAccessProfile UserSubStateProfile, int GrantedById)
 {
     return(UserSubStateRegionDAL.GrantSubStateRegionAccessToUser(UserSubStateProfile, GrantedById));
 }