Click here to Skip to main content
15,896,557 members
Articles / Desktop Programming / Windows Forms

Visual Application Launcher

Rate me:
Please Sign up or sign in to vote.
4.91/5 (37 votes)
23 Jan 2012CPOL23 min read 108.1K   3.7K   116  
A WinForms UI using WCF services, Entity Framework, repository data access, repository caching, Unit of Work, Dependency Injection, and every other buzz work you can think of!
namespace VAL.Contracts
{
    using System;
    using System.ServiceModel;
    using VAL.Contracts.ServiceFaults;
    using VAL.Model;

    /// <summary>
    /// Defines the contract for operations available to a standard user
    /// </summary>
    public interface IUserService
    {
        /// <summary>
        /// Gets a user object based on the windows identity name
        /// </summary>
        /// <param name="userName">The users windows identity name</param>
        /// <returns>A <see cref="User"/> object</returns>
        /// <exception cref="UserInactiveException">The user is currently set to inactive</exception>
        /// <exception cref="UserNotFoundException">The specified user name was not found in the database</exception>
        User GetUser(string userName);

        /// <summary>
        /// Gets a user object based on the specified unique identifier
        /// </summary>
        /// <param name="id">The id of the VAL user record</param>
        /// <returns>A <see cref="User"/> object</returns>
        User GetUser(int id);

        /// <summary>
        /// Deletes a user from the database that matches the specified ID
        /// </summary>
        /// <param name="userId">The unique ID of the user</param>
        void DeleteUser(int userId);

        /// <summary>
        /// Either inserts or updates a <see cref="User"/> instance
        /// </summary>
        /// <param name="file">The <see cref="User"/> to persist to the database</param>
        User SaveUser(User user);

        /// <summary>
        /// Gets a list of all active <see cref="User"/>s that are defined within a particular <see cref="Group"/>
        /// </summary>
        /// <param name="groupId">The unique ID of the group</param>
        /// <returns>List of users defined within a group</returns>
        User[] GetGroupUsers(int groupId);

        /// <summary>
        /// Gets a list of all <see cref="User"/>s that are defined in the database
        /// </summary>
        /// <returns>List of Users</returns>
        User[] GetUsers();

        /// <summary>
        /// Gets a list of all active <see cref="User"/>s that are defined in the database
        /// </summary>
        /// <returns>List of active Users</returns>
        User[] GetActiveUsers();

        /// <summary>
        /// Clones a set of permissions from one user to another
        /// </summary>
        /// <param name="groups">A user object that defines a new user to save to the database</param>
        /// <param name="targetUserId">An array of groups identifiers to apply to the user</param>
        void CloneUserPermissions(User user, int targetUserId);
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions