Esempio n. 1
0
        private void logInButton_Click(object sender, EventArgs e)
        {
            LoginService loginService = new LoginService();
            bool         result       = loginService.Login(userNameTextBox.Text, passwordTextBox.Text);

            if (result)
            {
                if (loginService.GetPost(userNameTextBox.Text).Equals("Admin"))
                {
                    MessageBox.Show("Login Successfully");
                    string post = "Admin";
                    adminFrom = new AdminFrom(this, userNameTextBox.Text, post);
                    adminFrom.Show();
                    this.Hide();
                }
                else if (loginService.GetPost(userNameTextBox.Text).Equals("Manager"))
                {
                    MessageBox.Show("Login Successfully");
                    string post = "Manager";
                    mf = new ManagerFrom(this, userNameTextBox.Text, post);
                    mf.Show();
                    this.Hide();
                }
                else if (loginService.GetPost(userNameTextBox.Text).Equals("Waiter"))
                {
                    string post = "Waiter";
                    MessageBox.Show("Login Successfully");
                    wf = new WaiterFrom(this, userNameTextBox.Text, post);
                    wf.Show();
                    this.Hide();
                }
            }
            else
            {
                checkLabel.Visible = true;
                return;
            }
        }
Esempio n. 2
0
 public FoodCategory(AdminFrom adminFrom)
 {
     InitializeComponent();
     this.adminFrom = adminFrom;
 }
Esempio n. 3
0
 public MenuFrom(AdminFrom adminFrom, string post)
 {
     InitializeComponent();
     this.adminFrom = adminFrom;
     this.post      = post;
 }
 public AddEmployee(AdminFrom adminFrom)
 {
     InitializeComponent();
     this.adminFrom = adminFrom;
 }
 public ManageEmployeeFrom(AdminFrom adminFrom, string post)
 {
     InitializeComponent();
     this.adminFrom = adminFrom;
     this.post      = post;
 }