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

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

            vUserRoleCollection = XmlUtils.Deserialize <UserRoleCollection>(aXmlArgument);
            UserRoleBusiness.Load(aUserKey, vUserRoleCollection);
            return(XmlUtils.Serialize <UserRoleCollection>(vUserRoleCollection, true));
        }