Ejemplo n.º 1
0
        public static webObject editFan(Fan aFan)
        {
            FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session);
            FanKey   vFanKey   = ServerSession.GetObject <FanKey>(HttpContext.Current.Session);

            aFan.FannKey = vFanKey.FannKey;

            ServerSession.ClearSessionBusiness(HttpContext.Current.Session);
            ServerSession.PutObject <FanKey>(HttpContext.Current.Session, vFanKey); // Review this element of pattern
            webObject vWebObject = new webObject();

            vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session);
            try
            {
                FanServiceConsumer.EditFan(vFanToken, aFan);
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK;
                vWebObject.aTransactionStatus.Message           = "Fan Edited";
                ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus);
                vWebObject.AnObject = aFan;
            }
            catch (TransactionStatusException tx)
            {
                vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus);
                return(vWebObject);
            }
            catch (Exception ex)
            {
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException;
                vWebObject.aTransactionStatus.Message           = "Edit of Fan unsuccesful" + ex.Message;
                vWebObject.aTransactionStatus.InnerMessage      = ex.InnerException == null ? String.Empty : ex.InnerException.Message;
                return(vWebObject);
            }
            return(vWebObject);
        }
Ejemplo n.º 2
0
        public static webObject addFanSession(FanSession aFanSession)
        {
            FanToken  vFanToken  = ServerSession.GetFanToken(HttpContext.Current.Session);
            FanKey    vFanKey    = ServerSession.GetObject <FanKey>(HttpContext.Current.Session);
            webObject vWebObject = new webObject();

            vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session);

            try
            {
                FanServiceConsumer.AddFanSession(vFanToken, aFanSession);
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK;
                vWebObject.aTransactionStatus.Message           = "FanSession Added";
                ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus);
                vWebObject.AnObject = aFanSession;
            }
            catch (TransactionStatusException tx)
            {
                vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus);
                return(vWebObject);
            }
            catch (Exception ex)
            {
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException;
                vWebObject.aTransactionStatus.Message           = "Addition of FanSession unsuccesful" + ex.Message;
                vWebObject.aTransactionStatus.InnerMessage      = ex.InnerException == null ? String.Empty : ex.InnerException.Message;
                return(vWebObject);
            }
            return(vWebObject);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Save a <see cref="FanWorkout" /> list passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey" /> object.</param>
        /// <param name="aFanWorkoutCollection">A cell fan collection.</param>
        /// <exception cref="Zephry.ZpAccessException">Access Denied; FanWorkout</exception>
        /// <exception cref="ArgumentNullException">If <c>aFanWorkout</c> argument is <c>null</c>.</exception>
        public static void Save(FanKey aFanKey, FanWorkoutCollection aFanWorkoutCollection)
        {
            if (aFanWorkoutCollection == null)
            {
                throw new ArgumentNullException("Update FanWorkoutCollection Business");
            }

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

            //Set Dates of new fanworkouts
            DateTime x;

            foreach (FanWorkout aFw in aFanWorkoutCollection.FanWorkoutList)
            {
                if (!(DateTime.TryParse(aFw.FanWorkoutDateCreated, out x)))
                {
                    aFw.FanWorkoutDateCreated = DateTime.Now.ToLongDateString();;
                }
            }

            FanWorkoutData.Save(aFanWorkoutCollection);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Save a <see cref="Friend" /> list passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey" /> object.</param>
        /// <param name="aFriendCollection">A fan fed collection.</param>
        /// <exception cref="Zephry.ZpAccessException">Access Denied; Friend</exception>
        /// <exception cref="ArgumentNullException">If <c>aFriend</c> argument is <c>null</c>.</exception>
        public static void Save(FanKey aFanKey, FriendCollection aFriendCollection)
        {
            if (aFriendCollection == null)
            {
                throw new ArgumentNullException("Update FriendCollection Business");
            }

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

            FriendCollection vExisting = new FriendCollection();

            vExisting.IsFiltered = true;
            vExisting.FriendFilter.AssignFromSource(aFriendCollection.FriendFilter);
            FriendData.Load(vExisting);
            FriendCollection vFresh = new FriendCollection();

            vFresh.IsFiltered = true;
            vFresh.FriendFilter.AssignFromSource(aFriendCollection.FriendFilter);

            foreach (Friend vFriend in aFriendCollection.FriendList)
            {
                bool exists         = false;
                bool bonafide       = true;
                int  instancenumber = 0;

                foreach (Friend oldFriend in vExisting.FriendList)
                {
                    if (vFriend.Fan1Key == oldFriend.Fan1Key && vFriend.Fan2Key == oldFriend.Fan2Key)
                    {
                        exists   = true;
                        bonafide = false;
                        instancenumber++;
                        break;
                    }
                    else if (vFriend.Fan1Key == oldFriend.Fan2Key && vFriend.Fan2Key == oldFriend.Fan1Key)
                    {
                        bonafide = false;
                        break;
                    }
                }
                if (bonafide)
                {
                    vFriend.FriendDateEstablished = DateTime.Now.ToLongDateString();
                }
                if ((exists || bonafide) && instancenumber < 2)
                {
                    vFresh.FriendList.Add(vFriend);
                }
            }

            FriendData.Save(vFresh);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets a specific access for a user.
        /// </summary>
        /// <param name="aFanKey">A user key composite.</param>
        /// <param name="aFunction">A function.</param>
        /// <returns></returns>
        public static Access GetAccess(FanKey aFanKey, string aFunction)
        {
            FanFunctionAccess vFanFunctionAccess = new FanFunctionAccess()
            {
                FannKey = aFanKey.FannKey
            };

            vFanFunctionAccess.FunctionAccess.Function = aFunction;
            Load(vFanFunctionAccess);
            return(vFanFunctionAccess.FunctionAccess.Access);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///   The <c>EditFunction</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="Function"/> object.
        ///   It invokes the <c>Update</c> method of <see cref="FunctionBusiness"/> with the newly deserialized <see cref="Function"/> object.
        ///   Finally, it returns the updated object unchanged as a serialized <see cref="string"/> of XML.
        /// </summary>
        /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
        /// <returns><see cref="Function"/> as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string EditFunction(FanKey aFanKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of EditFunction");
            }
            Function vFunction = new Function();

            vFunction = XmlUtils.Deserialize <Function>(aXmlArgument);
            FunctionBusiness.Update(aFanKey, vFunction);
            return(XmlUtils.Serialize <Function>(vFunction, true));
        }
Ejemplo n.º 7
0
        /// <summary>
        ///   The <c>DeleteFan</c> implementation method deserializes an incoming XML Argument as a new <see cref="Fan"/> object.
        ///   It invokes the <c>Delete</c> method of <see cref="FanBusiness"/> with the newly deserialized <see cref="Fan"/> object.
        ///   Finally, it returns the Deleted object unchanged as a serialized <c>string</c> of XML.
        /// </summary>
        /// <param name="aXmlArgument">A XML Argument <see cref="string"/>.</param>
        /// <returns><see cref="Fan"/> as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string DeleteFan(FanKey aFanKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of DeleteFan");
            }
            Fan vFan = new Fan();

            vFan = XmlUtils.Deserialize <Fan>(aXmlArgument);
            FanBusiness.Delete(aFanKey, vFan);
            return(XmlUtils.Serialize <Fan>(vFan, true));
        }
Ejemplo n.º 8
0
        /// <summary>
        ///   The <c>GetFanCollection</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="FanCollection"/> object.
        ///   It invokes the <c>Insert</c> method of <see cref="FanBusiness"/> with the newly deserialized <see cref="FanCollection"/> object.
        ///   Finally, it returns the collection object as a serialized <see cref="string"/> of XML.
        /// </summary>
        /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
        /// <returns><see cref="FanCollection"/> as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string GetFanCollection(FanKey aFanKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of GetFanCollection");
            }
            FanCollection vFanCollection = new FanCollection();

            vFanCollection = XmlUtils.Deserialize <FanCollection>(aXmlArgument);
            FanBusiness.Load(aFanKey, vFanCollection);
            return(XmlUtils.Serialize <FanCollection>(vFanCollection, true));
        }
Ejemplo n.º 9
0
        /// <summary>
        ///   The <c>DeleteFanRole</c> implementation method deserializes an incoming XML Argument as a new <see cref="FanRole"/> object.
        ///   It invokes the <c>Delete</c> method of <see cref="FanRoleBusiness"/> with the newly deserialized <see cref="FanRole"/> object.
        ///   Finally, it returns the Deleted object unchanged as a serialized <c>string</c> of XML.
        /// </summary>
        /// <param name="aXmlArgument">A XML Argument <see cref="string"/>.</param>
        /// <returns><see cref="FanRole"/> as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string DeleteFanRole(FanKey aFanKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of DeleteFanRole");
            }
            FanRole vFanRole = new FanRole();

            vFanRole = XmlUtils.Deserialize <FanRole>(aXmlArgument);
            FanRoleBusiness.Delete(aFanKey, vFanRole);
            return(XmlUtils.Serialize <FanRole>(vFanRole, true));
        }
Ejemplo n.º 10
0
        /// <summary>
        ///   The <c>EditRole</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="Role"/> object.
        ///   It invokes the <c>Update</c> method of <see cref="RoleBusiness"/> with the newly deserialized <see cref="Role"/> object.
        ///   Finally, it returns the updated object unchanged as a serialized <see cref="string"/> of XML.
        /// </summary>
        /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
        /// <returns><see cref="Role"/> as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string EditRole(FanKey aFanKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of EditRole");
            }
            Role vRole = new Role();

            vRole = XmlUtils.Deserialize <Role>(aXmlArgument);
            RoleBusiness.Update(aFanKey, vRole);
            return(XmlUtils.Serialize <Role>(vRole, true));
        }
Ejemplo n.º 11
0
        /// <summary>
        ///   The <c>DeleteRoleFunction</c> implementation method deserializes an incoming XML Argument as a new <see cref="RoleFunction"/> object.
        ///   It invokes the <c>Delete</c> method of <see cref="RoleFunctionBusiness"/> with the newly deserialized <see cref="RoleFunction"/> object.
        ///   Finally, it returns the Deleted object unchanged as a serialized <c>string</c> of XML.
        /// </summary>
        /// <param name="aXmlArgument">A XML Argument <see cref="string"/>.</param>
        /// <returns><see cref="RoleFunction"/> as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string DeleteRoleFunction(FanKey aFanKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of DeleteRoleFunction");
            }
            RoleFunction vRoleFunction = new RoleFunction();

            vRoleFunction = XmlUtils.Deserialize <RoleFunction>(aXmlArgument);
            RoleFunctionBusiness.Delete(aFanKey, vRoleFunction);
            return(XmlUtils.Serialize <RoleFunction>(vRoleFunction, true));
        }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Fan vFan = new Fan();

            vFan.FanUserID   = "*****@*****.**";
            vFan.FanPassword = "******";
            ServerSession.Logon(HttpContext.Current.Session, vFan);
            FanKey vFanKey = new FanKey();

            vFanKey.FannKey = vFan.FannKey;
            ServerSession.PutObject <FanKey>(HttpContext.Current.Session, vFanKey);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Gets a specific access of a Specific mode for a user.
        /// </summary>
        /// <param name="aFanKey">A user key composite.</param>
        /// <param name="aFunction">A function.</param>
        /// <param name="aAccessMode">A access mode.</param>
        /// <returns></returns>
        public static bool HasModeAccess(FanKey aFanKey, string aFunction, AccessMode aAccessMode)
        {
            FanFunctionAccess vFanFunctionAccess = new FanFunctionAccess()
            {
                FannKey = aFanKey.FannKey
            };

            vFanFunctionAccess.FunctionAccess.Function = aFunction;
            Load(vFanFunctionAccess);
            bool vAccess = false;

            switch (aAccessMode)
            {
            case AccessMode.List:
            {
                vAccess = vFanFunctionAccess.FunctionAccess.Access.List;
                break;
            }

            case AccessMode.Read:
            {
                vAccess = vFanFunctionAccess.FunctionAccess.Access.Read;
                break;
            }

            case AccessMode.Create:
            {
                vAccess = vFanFunctionAccess.FunctionAccess.Access.Create;
                break;
            }

            case AccessMode.Update:
            {
                vAccess = vFanFunctionAccess.FunctionAccess.Access.Update;
                break;
            }

            case AccessMode.Delete:
            {
                vAccess = vFanFunctionAccess.FunctionAccess.Access.Delete;
                break;
            }

            default:
            {
                vAccess = false;
                break;
            }
            }
            return(vAccess);
        }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
0
        /// <summary>
        ///   Update a <see cref="Activity"/> object passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aActivity">A <see cref="Activity"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aActivity</c> argument is <c>null</c>.</exception>
        public static void Update(FanKey aFanKey, Activity aActivity)
        {
            if (aActivity == null)
            {
                throw new ArgumentNullException("Update Activity Business");
            }

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

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

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

            ActivityData.Load(aActivityCollection);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Save a <see cref="FanFed" /> list passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey" /> object.</param>
        /// <param name="aFanFedCollection">A fan fed collection.</param>
        /// <exception cref="Zephry.ZpAccessException">Access Denied; FanFed</exception>
        /// <exception cref="ArgumentNullException">If <c>aFanFed</c> argument is <c>null</c>.</exception>
        public static void Save(FanKey aFanKey, FanFedCollection aFanFedCollection)
        {
            if (aFanFedCollection == null)
            {
                throw new ArgumentNullException("Update FanFedCollection Business");
            }

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

            FanFedData.Save(aFanFedCollection);
        }
Ejemplo n.º 18
0
        /// <summary>
        ///   The overloaded Load method that will return a specific <see cref="FanFed"/> object, with keys in <c>aFanFed</c>.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aFanFed">A <see cref="FanFed"/>.</param>
        /// <exception cref="ArgumentNullException">If <c>aFanFed</c> is <c>null</c>.</exception>
        public static void Load(FanKey aFanKey, FanFed aFanFed)
        {
            if (aFanFed == null)
            {
                throw new ArgumentNullException("Load FanFed Business");
            }

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

            FanFedData.Load(aFanFed);
        }
Ejemplo n.º 19
0
        /// <summary>
        ///   The overloaded Load method that will return a <see cref="CellFedCollection"/>.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aCellFedCollection">A <see cref="CellFedCollection"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aCellFedCollection</c> argument is <c>null</c>.</exception>
        public static void Load(FanKey aFanKey, CellFedCollection aCellFedCollection)
        {
            if (aCellFedCollection == null)
            {
                throw new ArgumentNullException("Load CellFed Business");
            }

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

            CellFedData.Load(aCellFedCollection);
        }
Ejemplo n.º 20
0
        /// <summary>
        ///   Update a <see cref="Fed"/> object passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aFed">A <see cref="Fed"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aFed</c> argument is <c>null</c>.</exception>
        public static void Update(FanKey aFanKey, Fed aFed)
        {
            if (aFed == null)
            {
                throw new ArgumentNullException("Update Fed Business");
            }

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

            FedData.Update(aFed);
        }
Ejemplo n.º 21
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);
        }
Ejemplo n.º 22
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);
        }
Ejemplo n.º 23
0
        /// <summary>
        ///   Delete a <see cref="Fan"/> object passed as an argument.
        /// </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 Delete(FanKey aFanKey, Fan aFan)
        {
            if (aFan == null)
            {
                throw new ArgumentNullException("Delete Fan Business");
            }

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

            FanData.Delete(aFan);
        }
Ejemplo n.º 24
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);
        }
Ejemplo n.º 25
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);
        }
Ejemplo n.º 26
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);
        }
Ejemplo n.º 27
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);
        }
Ejemplo n.º 28
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);
        }
Ejemplo n.º 29
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);
        }
Ejemplo n.º 30
0
        /// <summary>
        ///   Update a <see cref="Cell"/> object passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey"/> object.</param>
        /// <param name="aCell">A <see cref="Cell"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aCell</c> argument is <c>null</c>.</exception>
        public static void Update(FanKey aFanKey, Cell aCell)
        {
            if (aCell == null)
            {
                throw new ArgumentNullException("Update Cell Business");
            }

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

            CellData.Update(aCell);
        }