Exemple #1
0
        private void btn_toKab_Click(object sender, RoutedEventArgs e)
        {
            Kabinet kabinet = new Kabinet();

            Close();
            kabinet.ShowDialog();
        }
Exemple #2
0
        private void bt_ent_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var user1 = context.Students.ToList().
                            Where(i => log_txtbx.Text == i.login && pass_psbx.Password == i.password && i.available == 1).FirstOrDefault();
                var user2 = context.Teachers.ToList().
                            Where(i => log_txtbx.Text == i.login && pass_psbx.Password == i.password).FirstOrDefault();


                if (user1 != null && user2 == null)
                {
                    usStud = user1;
                    Kabinet studWin = new Kabinet();
                    Close();
                    studWin.ShowDialog();
                    // this.Show();
                }
                else if (user1 == null && user2 != null)
                {
                    usTeach = user2;
                    AdminWin adminWin = new AdminWin();
                    Close();
                    adminWin.ShowDialog();
                    //this.Show();
                }
                else
                {
                    MessageBox.Show("Логин или пароль введены неверно");
                }
            }
            catch (Exception msg)
            {
                MessageBox.Show(msg.Message);
            }
        }