Esempio n. 1
0
        /// <summary>
        ///   Delete a <see cref="Function"/> object passed as an argument.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aFunction">A <see cref="Function"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aFunction</c> argument is <c>null</c>.</exception>
        public static void Delete(UserKey aUserKey, Function aFunction)
        {
            if (aFunction == null)
            {
                throw new ArgumentNullException("Delete Function Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "Function", AccessMode.Delete))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Delete, "Function");
            }

            FunctionData.Delete(aFunction);
        }
Esempio n. 2
0
        /// <summary>
        ///   Update a <see cref="UserRole"/> object passed as an argument.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aUserRole">A <see cref="UserRole"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aUserRole</c> argument is <c>null</c>.</exception>
        public static void Update(UserKey aUserKey, UserRole aUserRole)
        {
            if (aUserRole == null)
            {
                throw new ArgumentNullException("Update UserRole Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "UserRole", AccessMode.Update))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Update, "UserRole");
            }

            UserRoleData.Update(aUserRole);
        }
Esempio n. 3
0
        /// <summary>
        ///   The overloaded Load method that will return a <see cref="FunctionCollection"/>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aFunctionCollection">A <see cref="FunctionCollection"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aFunctionCollection</c> argument is <c>null</c>.</exception>
        public static void Load(UserKey aUserKey, FunctionCollection aFunctionCollection)
        {
            if (aFunctionCollection == null)
            {
                throw new ArgumentNullException("Load Function Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "Function", AccessMode.List))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.List, "Function");
            }

            FunctionData.Load(aFunctionCollection);
        }
Esempio n. 4
0
        /// <summary>
        ///   The overloaded Load method that will return a specific <see cref="User"/> object, with keys in <c>aUser</c>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aUser">A <see cref="User"/>.</param>
        /// <exception cref="ArgumentNullException">If <c>aUser</c> is <c>null</c>.</exception>
        public static void Load(UserKey aUserKey, User aUser)
        {
            if (aUser == null)
            {
                throw new ArgumentNullException("Load User Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "User", AccessMode.Read))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Read, "User");
            }

            UserData.Load(aUser);
        }
Esempio n. 5
0
        /// <summary>
        ///   Insert a <see cref="User"/> object passed as an argument via Stored Procedure that returns the newly inserted <i>User Key</i>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aUser">A <see cref="User"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aUser</c> argument is <c>null</c>.</exception>
        public static void Insert(UserKey aUserKey, User aUser)
        {
            if (aUser == null)
            {
                throw new ArgumentNullException("Insert User Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "User", AccessMode.Create))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Create, "User");
            }

            UserData.Insert(aUser);
        }
Esempio n. 6
0
        /// <summary>
        ///   Insert a <see cref="FanRole"/> object passed as an argument via Stored Procedure that returns the newly inserted <i>FanRole Key</i>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aFanRole">A <see cref="FanRole"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aFanRole</c> argument is <c>null</c>.</exception>
        public static void Insert(UserKey aUserKey, FanRole aFanRole)
        {
            if (aFanRole == null)
            {
                throw new ArgumentNullException("Insert FanRole Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "FanRole", AccessMode.Create))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Create, "FanRole");
            }

            FanRoleData.Insert(aFanRole);
        }
Esempio n. 7
0
        /// <summary>
        ///   The overloaded Load method that will return a specific <see cref="Role"/> object, with keys in <c>aRole</c>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aRole">A <see cref="Role"/>.</param>
        /// <exception cref="ArgumentNullException">If <c>aRole</c> is <c>null</c>.</exception>
        public static void Load(UserKey aUserKey, Role aRole)
        {
            if (aRole == null)
            {
                throw new ArgumentNullException("Load Role Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "Role", AccessMode.Read))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Read, "Role");
            }

            RoleData.Load(aRole);
        }
Esempio n. 8
0
        /// <summary>
        ///   Update a <see cref="RoleFunction"/> object passed as an argument.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aRoleFunction">A <see cref="RoleFunction"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aRoleFunction</c> argument is <c>null</c>.</exception>
        public static void Update(UserKey aUserKey, RoleFunction aRoleFunction)
        {
            if (aRoleFunction == null)
            {
                throw new ArgumentNullException("Update RoleFunction Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "RoleFunction", AccessMode.Update))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Update, "RoleFunction");
            }

            RoleFunctionData.Update(aRoleFunction);
        }