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); }
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); }
/// <summary> /// Call WCF GetUser function /// </summary> /// <param name="login"></param> /// <returns></returns> public User GetUser(string login) { return(_service.GetUser(login)); }
public static User GetUser(string login) { ServiceUserClient serviceUser = new ServiceUserClient(); try { return serviceUser.GetUser(login); } catch (Exception) { return null; } }