private void btn_signin_Click(object sender, EventArgs e) { if (password.Text == "") { MessageBox.Show("Please provide password!"); } else { Staff member = service.DoLogin(Convert.ToInt32(Cmb_Username.SelectedValue), password.Text); if (member is null) { MessageBox.Show("invalid username or password!"); } else { this.Hide(); switch (member.Role) { case Staff_Type.Bartender: new KitchenBar(Staff_Type.Bartender).ShowDialog(); //this.Close(); break; case Staff_Type.Chef: new KitchenBar(Staff_Type.Chef).ShowDialog(); //this.Close(); break; case Staff_Type.Waiter: new TableView(member).ShowDialog(); //this.Close(); break; case Staff_Type.Manager: default: new Overview(member).ShowDialog(); //this.Close(); break; } this.Close(); } } }