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; } }
public MenuFrom(WaiterFrom wf, string post) { InitializeComponent(); this.wf = wf; this.post = post; }
public ViewCategory(WaiterFrom waiterFrom, string post) { InitializeComponent(); this.waiterFrom = waiterFrom; this.post = post; }
public OrderFrom(WaiterFrom waiterFrom, string post) { InitializeComponent(); this.waiterFrom = waiterFrom; this.post = post; }