コード例 #1
0
ファイル: Users.cs プロジェクト: J0bba/WPF-Medecine
        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);
        }
コード例 #2
0
        public static User[] GetListUser()
        {
            ServiceUserClient serviceUser = new ServiceUserClient();

            try
            {
                return serviceUser.GetListUser();
            }
            catch (Exception)
            {
                return new User[0];
            }
        }
コード例 #3
0
 /// <summary>
 /// Call WCF GetListUser function
 /// </summary>
 /// <returns></returns>
 public User[] GetListUser()
 {
     return(_service.GetListUser());
 }