Exemplo n.º 1
0
        /// <summary>
        ///   The overloaded Load method that will return a <see cref="FunctionCollection"/>.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> 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(FanKey aFanKey, FunctionCollection aFunctionCollection)
        {
            if (aFunctionCollection == null)
            {
                throw new ArgumentNullException("Load Function Business");
            }

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

            FunctionData.Load(aFunctionCollection);
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Update a <see cref="Function"/> object passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> 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 Update(FanKey aFanKey, Function aFunction)
        {
            if (aFunction == null)
            {
                throw new ArgumentNullException("Update Function Business");
            }

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

            FunctionData.Update(aFunction);
        }
Exemplo n.º 3
0
        /// <summary>
        ///   Insert a <see cref="Fan"/> object passed as an argument via Stored Procedure that returns the newly inserted <i>Fan Key</i>.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aFan">A <see cref="Fan"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aFan</c> argument is <c>null</c>.</exception>
        public static void Insert(FanKey aFanKey, Fan aFan)
        {
            if (aFan == null)
            {
                throw new ArgumentNullException("Insert Fan Business");
            }

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

            FanData.Insert(aFan);
        }
Exemplo n.º 4
0
        /// <summary>
        ///   The overloaded Load method that will return a specific <see cref="FanSessionActivity"/> object, with keys in <c>aFanSessionActivity</c>.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aFanSessionActivity">A <see cref="FanSessionActivity"/>.</param>
        /// <exception cref="ArgumentNullException">If <c>aFanSessionActivity</c> is <c>null</c>.</exception>
        public static void Load(FanKey aFanKey, FanSessionActivity aFanSessionActivity)
        {
            if (aFanSessionActivity == null)
            {
                throw new ArgumentNullException("Load FanSessionActivity Business");
            }

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

            FanSessionActivityData.Load(aFanSessionActivity);
        }
Exemplo n.º 5
0
        /// <summary>
        ///   Delete 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 Delete(FanKey aFanKey, FanRole aFanRole)
        {
            if (aFanRole == null)
            {
                throw new ArgumentNullException("Delete FanRole Business");
            }

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

            FanRoleData.Delete(aFanRole);
        }
Exemplo n.º 6
0
        /// <summary>
        ///   Insert a <see cref="Role"/> object passed as an argument via Stored Procedure that returns the newly inserted <i>Role Key</i>.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aRole">A <see cref="Role"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aRole</c> argument is <c>null</c>.</exception>
        public static void Insert(FanKey aFanKey, Role aRole)
        {
            if (aRole == null)
            {
                throw new ArgumentNullException("Insert Role Business");
            }

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

            RoleData.Insert(aRole);
        }
Exemplo 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="aFanKey">A <see cref="FanKey"/> 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(FanKey aFanKey, Role aRole)
        {
            if (aRole == null)
            {
                throw new ArgumentNullException("Load Role Business");
            }

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

            RoleData.Load(aRole);
        }
Exemplo n.º 8
0
        /// <summary>
        ///   The overloaded Load method that will return a specific <see cref="CellFan"/> object, with keys in <c>aCellFan</c>.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aCellFan">A <see cref="CellFan"/>.</param>
        /// <exception cref="ArgumentNullException">If <c>aCellFan</c> is <c>null</c>.</exception>
        public static void Load(FanKey aFanKey, CellFan aCellFan)
        {
            if (aCellFan == null)
            {
                throw new ArgumentNullException("Load CellFan Business");
            }

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

            CellFanData.Load(aCellFan);
        }
Exemplo n.º 9
0
        /// <summary>
        ///   Delete a <see cref="RoleFunction"/> object passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> 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 Delete(FanKey aFanKey, RoleFunction aRoleFunction)
        {
            if (aRoleFunction == null)
            {
                throw new ArgumentNullException("Delete RoleFunction Business");
            }

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

            RoleFunctionData.Delete(aRoleFunction);
        }