private void button_Click(object sender, RoutedEventArgs e)
        {
            ManagerForm re = new ManagerForm();

            this.Hide();
            re.Show();
        }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ManagerForm cur = new ManagerForm();

            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("Вы заполнили не все поля");
            }
        }