示例#1
0
        /// <summary>
        ///   The <c>DeleteUser</c> implementation method deserializes an incoming XML Argument as a new <see cref="User"/> object.
        ///   It invokes the <c>Delete</c> method of <see cref="UserBusiness"/> with the newly deserialized <see cref="User"/> 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="User"/> as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string DeleteUser(UserKey aUserKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of DeleteUser");
            }
            User vUser = new User();

            vUser = XmlUtils.Deserialize <User>(aXmlArgument);
            UserBusiness.Delete(aUserKey, vUser);
            return(XmlUtils.Serialize <User>(vUser, true));
        }
示例#2
0
        /// <summary>
        ///   The <c>GetUserCollection</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="UserCollection"/> object.
        ///   It invokes the <c>Insert</c> method of <see cref="UserBusiness"/> with the newly deserialized <see cref="UserCollection"/> 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="UserCollection"/> as XML <see cref="string"/>.</returns>
        /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
        public static string GetUserCollection(UserKey aUserKey, string aXmlArgument)
        {
            if (aXmlArgument == null)
            {
                throw new ArgumentNullException("aXmlArgument of GetUserCollection");
            }
            UserCollection vUserCollection = new UserCollection();

            vUserCollection = XmlUtils.Deserialize <UserCollection>(aXmlArgument);
            UserBusiness.Load(aUserKey, vUserCollection);
            return(XmlUtils.Serialize <UserCollection>(vUserCollection, true));
        }
示例#3
0
        /// <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);
        }