Ejemplo n.º 1
0
 public User GetUser(bool isAdmin, string username)
 {
     try
     {
         return(serviceUser.GetUser(isAdmin, username));
     }
     catch
     {
         Console.ForegroundColor = ConsoleColor.Red;
         Console.WriteLine("Connection Error! Database Server Manager Unreacheable!");
         Console.ForegroundColor = ConsoleColor.DarkCyan;
     }
     return(null);
 }
Ejemplo n.º 2
0
        public static Model.User GetUser(string login)
        {
            Model.User        user        = new Model.User();
            ServiceUserClient serviceUser = new ServiceUserClient();

            try
            {
                var userS = serviceUser.GetUser(login);
                user.login     = userS.Login;
                user.pwd       = userS.Pwd;
                user.role      = userS.Role;
                user.name      = userS.Name;
                user.picture   = userS.Picture;
                user.firstname = userS.Firstname;
                return(user);
            }
            catch (Exception) { }
            finally { serviceUser.Close(); }
            return(user);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Call WCF GetUser function
 /// </summary>
 /// <param name="login"></param>
 /// <returns></returns>
 public User GetUser(string login)
 {
     return(_service.GetUser(login));
 }
Ejemplo n.º 4
0
        public static User GetUser(string login)
        {
            ServiceUserClient serviceUser = new ServiceUserClient();

            try
            {
                return serviceUser.GetUser(login);
            }
            catch (Exception)
            {
                return null;
            }
        }