private void backToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (post.Equals("Admin"))
     {
         adminFrom.Show();
         this.Hide();
     }
     else
     {
         ManagerFrom managerFrom = new ManagerFrom();
         managerFrom.Show();
         this.Hide();
     }
 }
Esempio n. 2
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;
            }
        }
 public ViewOrder(ManagerFrom managerFrom, string post)
 {
     InitializeComponent();
     this.managerFrom = managerFrom;
     this.post        = post;
 }
Esempio n. 4
0
 public MenuFrom(ManagerFrom mf, string post)
 {
     InitializeComponent();
     this.mf   = mf;
     this.post = post;
 }
 public FinancialFrom(ManagerFrom managerFrom, string post)
 {
     InitializeComponent();
     this.managerFrom = managerFrom;
     this.post        = post;
 }
 public ManageEmployeeFrom(ManagerFrom managerFrom, string post)
 {
     InitializeComponent();
     this.managerFrom = managerFrom;
     this.post        = post;
 }