Пример #1
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            MenuDirector Window = new MenuDirector();

            Window.Show();
            this.Close();
        }
 private void Authorization1_Click(object sender, RoutedEventArgs e)
 {
     ServiceReference1.Service1Client Service = new ServiceReference1.Service1Client();
     if (Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).role_id == 1 && Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).error == false)
     {
         IDUser = Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).id_user;
         MenuClient Window = new MenuClient();
         Window.Show();
         this.Close();
     }
     else if (Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).role_id == 2 && Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).error == false)
     {
         IDUser = Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).id_user;
         MenuRealtor Window = new MenuRealtor();
         Window.Show();
         this.Close();
     }
     else if (Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).role_id == 3 && Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).error == false)
     {
         IDUser = Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).id_user;
         MenuDirector Window = new MenuDirector();
         Window.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show(Service.Authentication(Convert.ToString(Email.Text), Convert.ToString(Password.Password)).error_message, "Внимание");
     }
 }