Esempio n. 1
0
		/// <summary>
		/// Creates the SEForm as a panel, with all of its widgets, and adds itself to the MasterForm
		/// </summary>
        public SelectEmployeeForm(SelectEmployeeController sectlr, MasterForm mf)
        {
            Console.WriteLine("SelectEmployeeForm created.");
            // form properties
            this.mf = mf;
            this.sectlr = sectlr;
            mf.Text += " - Select Employee";
            this.Size = new Size(375, 300);
            mf.Size = new Size(375, 300);

            //title label
            titleLabel = new Label();
            titleLabel.Size = new Size(195, 30);
            titleLabel.Location = new Point(5, 5);
            titleLabel.Text = "Select Employee";
            titleLabel.Font = new Font("Areil", 16);
            titleLabel.ForeColor = System.Drawing.Color.Orange;
            this.Controls.Add(titleLabel);

            // label and drop down menu for the list of employees
            dropDownLabel = new Label();
            dropDownLabel.Size = new Size(80, 50);
            dropDownLabel.Location = new Point(5, 40);
            dropDownLabel.Text = "Choose Employee:";
            dropDownLabel.Font = new Font("Arial", 11);
            this.Controls.Add(dropDownLabel);

            employeeList = new ComboBox();
            employeeList.DropDownStyle = ComboBoxStyle.DropDownList;
            employeeList.Size = new Size(200, 30);
            employeeList.Location = new Point(90, 50);
            employeeList.Font = new Font("Arial", 11);
            this.Controls.Add(employeeList);

            // submit button
            submit = new Button();
            submit.Size = new Size(100, 30);
            submit.Location = new Point(90, 85);
            submit.Text = "Submit";
            submit.Click += new EventHandler(submitButtonHandler);
            submit.BackColor = System.Drawing.Color.Orange;
            submit.ForeColor = System.Drawing.Color.White;
            submit.FlatStyle = FlatStyle.Flat;
            submit.Font = new Font("Arial", 11, FontStyle.Bold);
            submit.TextAlign = ContentAlignment.MiddleCenter;
            this.Controls.Add(submit);

			// add panel to MasterForm
            mf.Controls.Add(this);
            
        }//end SelectEmployeeForm constructor
        /// <summary>
        /// Creates the MainCtlr, which handles the MainMenu functionality and form
        /// </summary>
        public MainController(DBConnector dbc, User user, MasterForm mf)
        {
            Console.WriteLine("MainController created.");

            this.mf  = mf;
            this.dbc = dbc;

            curUser = user;

            sectlr = new SelectEmployeeController(dbc, this, mf);
            aactlr = new AlterAvailabilityController(dbc, this, mf);
            gsctlr = new GenerateScheduleController(dbc, this, mf);
            dsctlr = new DisplayScheduleController(dbc, this, mf);

            mmform = new MainMenuForm(curUser, this, mf);
        }//end MainController constructor