コード例 #1
0
 private void closeButton_Click(object sender, EventArgs e)
 {
     RecptionMenu receptionMenu = new RecptionMenu(Model);
     receptionMenu.Dock = DockStyle.Fill;
     receptionMenu.MdiParent = this.MdiParent;
     receptionMenu.Show();
     receptionMenu.WindowState = FormWindowState.Maximized;
 }
コード例 #2
0
        public void PasswordCheck()
        {
            bool validUser = Model.login(textBox1.Text, textBox2.Text);

            if (validUser)
            {
                switch (Model.getUserTypeForCurrentuser())
                {
                    case "hotelmanager":
                        MenuHotelManager form1 = new MenuHotelManager(Model); // All forms get passed the formContainer and a reference to the model object.
                        this.Text = this.Text + "-Manager";
                        form1.MdiParent = this.MdiParent;
                        form1.Show();
                        break;
                    case "barmanager":
                        BarManagerMenu barManagerFrom = new BarManagerMenu(Model); // All forms get passed the formContainer and a reference to the model object.
                        this.Text = this.Text + "-Manager";
                        barManagerFrom.MdiParent = this.MdiParent;
                        barManagerFrom.Show();
                        break;
                    case "barstaff":
                        BarStaffMenu barStaffForm = new BarStaffMenu(Model); // All forms get passed the formContainer and a reference to the model object.
                        this.Text = this.Text + "-Manager";
                        barStaffForm.MdiParent = this.MdiParent;
                        barStaffForm.Show();
                        break;
                    case "restaurantmanager":
                        RestaurantManagerMenu r = new RestaurantManagerMenu(Model); // All forms get passed the formContainer and a reference to the model object.
                        this.Text = this.Text + "-Manager";
                        r.MdiParent = this.MdiParent;
                        r.Show();
                        break;
                    case "restaurantstaff":
                        RestaurantStaffMenu res = new RestaurantStaffMenu(Model); // All forms get passed the formContainer and a reference to the model object.
                        this.Text = this.Text + "-Manager";
                        res.MdiParent = this.MdiParent;
                        res.Show();
                        break;
                    case "receptionist":
                        RecptionMenu reception = new RecptionMenu(Model); // All forms get passed the formContainer and a reference to the model object.
                        this.Text = this.Text + "-Manager";
                        reception.MdiParent = this.MdiParent;
                        reception.Show();
                        break;
                    case "housekeepingstaff":
                        MenuHousekeepingStaff b = new MenuHousekeepingStaff(Model); // All forms get passed the formContainer and a reference to the model object.
                        this.Text = this.Text + "-Manager";
                        b.MdiParent = this.MdiParent;
                        b.Show();
                        break;
                    case "housekeepingmanager":
                        MenuHousekeepingManager hm = new MenuHousekeepingManager(Model); // All forms get passed the formContainer and a reference to the model object.
                        this.Text = this.Text + "-Manager";
                        hm.MdiParent = this.MdiParent;
                        hm.Show();
                        break;
                }
                Close();
            }
            else
            {
                MessageBox.Show("Invalid name or password");
                textBox1.Text = "";
                textBox2.Text = "";
                textBox1.Select();
            }
        }