コード例 #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;
            }
        }
コード例 #2
0
 public MenuFrom(WaiterFrom wf, string post)
 {
     InitializeComponent();
     this.wf   = wf;
     this.post = post;
 }
コード例 #3
0
 public ViewCategory(WaiterFrom waiterFrom, string post)
 {
     InitializeComponent();
     this.waiterFrom = waiterFrom;
     this.post       = post;
 }
コード例 #4
0
 public OrderFrom(WaiterFrom waiterFrom, string post)
 {
     InitializeComponent();
     this.waiterFrom = waiterFrom;
     this.post       = post;
 }