public void Delete(string user)
        {
            UkrzaliznutsaDBEntities ukrzaliznutsaDBEntities = new UkrzaliznutsaDBEntities();
            List <UsersSet>         users;
            UsersSet userinfo = ukrzaliznutsaDBEntities.UsersSet.Where(x => x.Name == user).FirstOrDefault();

            users = ukrzaliznutsaDBEntities.UsersSet.ToList();
            ukrzaliznutsaDBEntities.UsersSet.Remove(userinfo);
            ukrzaliznutsaDBEntities.SaveChanges();
        }
        private void DeleteUser_Click(object sender, RoutedEventArgs e)
        {
            UkrzaliznutsaDBEntities ukrzaliznutsaDBEntities = new UkrzaliznutsaDBEntities();
            List <UsersSet>         users;
            UsersSet user = ukrzaliznutsaDBEntities.UsersSet.Where(x => x.Name == ListUsers.SelectedItem.ToString()).FirstOrDefault();

            users = ukrzaliznutsaDBEntities.UsersSet.ToList();
            ukrzaliznutsaDBEntities.UsersSet.Remove(user);
            ukrzaliznutsaDBEntities.SaveChanges();
        }
        public void setUserLogin(string login, string pass)
        {
            UkrzaliznutsaDBEntities ukrzaliznutsaDBEntities = new UkrzaliznutsaDBEntities();
            UsersSet users = new UsersSet
            {
                Name     = login,
                Password = pass
            };

            ukrzaliznutsaDBEntities.UsersSet.Add(users);
            ukrzaliznutsaDBEntities.SaveChanges();
        }
 public void Login(string pass)
 {
     UsersSet   user       = ukrzaliznutsaDBEntities.UsersSet.Where(x => x.Password == pass).First();
     MainWindow mainWindow = new MainWindow();
 }