コード例 #1
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));
        }
コード例 #2
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));
        }
コード例 #3
0
ファイル: FanInterface.cs プロジェクト: heinschulie/zfit
        //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);
        }