コード例 #1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ClientForn re = new ClientForn();

            this.Hide();
            re.Show();
        }
コード例 #2
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     if (SecurityContext.avtovxod == 1)
     {
         ClientForn cur = new ClientForn();
         this.Hide();
         cur.Show();
     }
     if (SecurityContext.avtovxod == 2)
     {
         MainWindow cur = new MainWindow();
         this.Hide();
         cur.Show();
     }
 }
コード例 #3
0
        private void aut_Click(object sender, RoutedEventArgs e)
        {
            if (Login.Text != "" && Password.Password != "")
            {
                try
                {
                    rentcarEntities db  = new rentcarEntities();
                    var             rol = db.Users.Where(us => us.Login == Login.Text && us.Password == Password.Password).FirstOrDefault().Role; //
                    var             f   = db.Users.Where(us => us.Login == Login.Text && us.Password == Password.Password).FirstOrDefault().IdUser;

                    if (rol == "Client")
                    {
                        ClientForn re = new ClientForn();
                        this.Hide();
                        SecurityContext.idClient = f;
                        re.Show();
                        SecurityContext.avtovxod = 1;
                    }
                    else if (rol == "Manager")
                    {
                        ManagerForm re = new ManagerForm();
                        this.Hide();
                        re.Show();
                        SecurityContext.avtovxod = 3;
                    }
                }
                catch
                {
                    MessageBox.Show("Вы ввели неправильно логин или пароль");
                }
            }
            else
            {
                MessageBox.Show("Вы заполнили не все поля");
            }
        }