Ejemplo n.º 1
0
        /// <summary>
        ///   Delete a <see cref="FanRole"/> object passed as an argument.
        /// </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 Delete(UserKey aUserKey, FanRole aFanRole)
        {
            if (aFanRole == null)
            {
                throw new ArgumentNullException("Delete FanRole Business");
            }

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

            FanRoleData.Delete(aFanRole);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Update a <see cref="FanRole"/> object passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> 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 Update(FanKey aFanKey, FanRole aFanRole)
        {
            if (aFanRole == null)
            {
                throw new ArgumentNullException("Update FanRole Business");
            }

            if (!FanFunctionAccessData.HasModeAccess(aFanKey, "FanRole", AccessMode.Update))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aFanKey.FannKey), AccessMode.Update, "FanRole");
            }

            FanRoleData.Update(aFanRole);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///   The overloaded Load method that will return a <see cref="FanRoleCollection"/>.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aFanRoleCollection">A <see cref="FanRoleCollection"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aFanRoleCollection</c> argument is <c>null</c>.</exception>
        public static void Load(FanKey aFanKey, FanRoleCollection aFanRoleCollection)
        {
            if (aFanRoleCollection == null)
            {
                throw new ArgumentNullException("Load FanRole Business");
            }

            if (!FanFunctionAccessData.HasModeAccess(aFanKey, "FanRole", AccessMode.List))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aFanKey.FannKey), AccessMode.List, "FanRole");
            }

            FanRoleData.Load(aFanRoleCollection);
        }