public static ObservableCollection <Model.User> GetAllUsers() { ObservableCollection <Model.User> result = new ObservableCollection <Model.User>(); ServiceUserClient serviceUser = new ServiceUserClient(); try { var users = serviceUser.GetListUser(); foreach (var user in users) { Model.User Muser = new Model.User() { login = user.Login, pwd = user.Pwd, name = user.Name, firstname = user.Firstname, picture = user.Picture, connected = user.Connected, role = user.Role }; result.Add(Muser); } } catch (Exception) { } finally { serviceUser.Close(); } return(result); }
public static User[] GetListUser() { ServiceUserClient serviceUser = new ServiceUserClient(); try { return serviceUser.GetListUser(); } catch (Exception) { return new User[0]; } }
/// <summary> /// Call WCF GetListUser function /// </summary> /// <returns></returns> public User[] GetListUser() { return(_service.GetListUser()); }