Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            dataAccess data = new dataAccess();

            if (username.Text == "" || password.Password.ToString() == "")
            {
                MessageBox.Show("Enter Fields");
            }
            else
            {
                string status = data.GetLogin(username.Text, password.Password.ToString());
                user = username.Text;

                if (status.Equals("Supervisor"))
                {
                    supervisor spv = new supervisor();
                    spv.ShowDialog();
                    Window.GetWindow(this).Close();
                }
                else if (status.Equals("Admin"))
                {
                    Application.Current.Windows.OfType <MainWindow>().FirstOrDefault().Content = new AdminOptions();
                }
                else if (status.Equals("Cashier"))
                {
                    Application.Current.Windows.OfType <MainWindow>().FirstOrDefault().Content = new SalePage();
                }
                else if (status.Equals("NotFound"))
                {
                    MessageBox.Show("Unrecorgnized Username or Password !! , Contact your administrator");
                }
            }
        }
Exemplo n.º 2
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            supervisor super = new supervisor();

            super.Show();
        }