Example #1
0
        /// <summary>
        ///   Gets the <see cref="Fan"/> by FanID.
        /// </summary>
        /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
        /// <returns>Fan as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string GetFanByID(FanKey aFanKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of GetFanByID");
            }
            Fan vFan = new Fan();

            vFan = XmlUtils.Deserialize <Fan>(aXmlArgument);
            FanBusiness.LoadByID(vFan, vFan);
            return(XmlUtils.Serialize <Fan>(vFan, true));
        }
Example #2
0
        //The following body of code is commented out as this is a public system. Once Admin interface is built
        //we will return to a regular broadcast.

        /// <summary>
        /// Initializes the session with the Session token file located
        /// </summary>
        /// <returns></returns>
        //private static UserKey InitializeSession(UserToken aUserToken)
        //{
        //    var vUserKey = new UserKey();

        //    //The following body of code is commented out as this is a public system. Once PublicInterface is built
        //    //we will return to a regular broadcast.

        //    var vUser = new User() { UsrID = aUserToken.UserID };
        //    UserBusiness.LoadByID(vUserKey, vUser);
        //    if (String.Compare(vUser.UsrPassword, aUserToken.Password, false) != 0)
        //    {
        //        throw new Exception("User Authentication Exception");
        //    }
        //    vUserKey.UsrKey = vUser.UsrKey;

        //    return vUserKey;
        //}

        // ***********************

        // Overload for InitializeSession to accommodate FanKey as opposed to UserKey...
        /// <summary>
        /// Initializes the session with the Session token file located
        /// </summary>
        /// <returns></returns>
        private static FanKey InitializeSession(FanToken aFanToken)
        {
            var vFanKey = new FanKey();

            var vFan = new Fan()
            {
                FanID = aFanToken.FanID
            };

            FanBusiness.LoadByID(vFanKey, vFan);
            if (String.Compare(vFan.FanPassword, aFanToken.Password, false) != 0)
            {
                throw new Exception("User Authentication Exception");
            }
            vFanKey.FannKey = vFan.FannKey;

            return(vFanKey);
        }