/// <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
public AlterAvailabilityForm(AlterAvailabilityController aactlr, MasterForm mf, User user) { Console.WriteLine("AlterAvailabilityForm created."); // form properties this.mf = mf; this.aactlr = aactlr; this.user = user; mf.Text += " - Alter Availability"; this.Size = new Size(375, 300); mf.Size = new Size(375, 300); //title label titleLabel = new Label(); titleLabel.Size = new Size(165, 30); titleLabel.Location = new Point(5, 5); titleLabel.Text = "Alter Availabilty"; titleLabel.Font = new Font("Areil", 16); titleLabel.ForeColor = System.Drawing.Color.Orange; this.Controls.Add(titleLabel); //monday label mondayLabel = new Label(); mondayLabel.Size = new Size(85, 20); mondayLabel.Location = new Point(90, 40); mondayLabel.Text = "Monday"; mondayLabel.Font = new Font("Arial", 11); this.Controls.Add(mondayLabel); //tuesday label tuesdayLabel = new Label(); tuesdayLabel.Size = new Size(85, 20); tuesdayLabel.Location = new Point(220, 40); tuesdayLabel.Text = "Tuesday"; tuesdayLabel.Font = new Font("Arial", 11); this.Controls.Add(tuesdayLabel); //wednesday label wednesdayLabel = new Label(); wednesdayLabel.Size = new Size(85, 20); wednesdayLabel.Location = new Point(90, 80); wednesdayLabel.Text = "Wednesday"; wednesdayLabel.Font = new Font("Arial", 11); this.Controls.Add(wednesdayLabel); //thursday label thursdayLabel = new Label(); thursdayLabel.Size = new Size(85, 20); thursdayLabel.Location = new Point(220, 80); thursdayLabel.Text = "Thursday"; thursdayLabel.Font = new Font("Arial", 11); this.Controls.Add(thursdayLabel); //friday label fridayLabel = new Label(); fridayLabel.Size = new Size(85, 20); fridayLabel.Location = new Point(90, 120); fridayLabel.Text = "Friday"; fridayLabel.Font = new Font("Arial", 11); this.Controls.Add(fridayLabel); //saturday label saturdayLabel = new Label(); saturdayLabel.Size = new Size(85, 20); saturdayLabel.Location = new Point(220, 120); saturdayLabel.Text = "Saturday"; saturdayLabel.Font = new Font("Arial", 11); this.Controls.Add(saturdayLabel); //sunday label sundayLabel = new Label(); sundayLabel.Size = new Size(85, 20); sundayLabel.Location = new Point(90, 160); sundayLabel.Text = "Sunday"; sundayLabel.Font = new Font("Arial", 11); this.Controls.Add(sundayLabel); //monday CheckBox mondayCheckBox = new CheckBox(); mondayCheckBox.Size = new Size(20, 20); mondayCheckBox.Location = new Point(65, 40); this.Controls.Add(mondayCheckBox); //tuesday CheckBox tuesdayCheckBox = new CheckBox(); tuesdayCheckBox.Size = new Size(20, 20); tuesdayCheckBox.Location = new Point(200, 40); this.Controls.Add(tuesdayCheckBox); //wednesday CheckBox wednesdayCheckBox = new CheckBox(); wednesdayCheckBox.Size = new Size(20, 20); wednesdayCheckBox.Location = new Point(65, 80); this.Controls.Add(wednesdayCheckBox); //thursday CheckBox thursdayCheckBox = new CheckBox(); thursdayCheckBox.Size = new Size(20, 20); thursdayCheckBox.Location = new Point(200, 80); this.Controls.Add(thursdayCheckBox); //friday CheckBox fridayCheckBox = new CheckBox(); fridayCheckBox.Size = new Size(20, 20); fridayCheckBox.Location = new Point(65, 120); this.Controls.Add(fridayCheckBox); //saturday CheckBox saturdayCheckBox = new CheckBox(); saturdayCheckBox.Size = new Size(20, 20); saturdayCheckBox.Location = new Point(200, 120); this.Controls.Add(saturdayCheckBox); //sunday CheckBox sundayCheckBox = new CheckBox(); sundayCheckBox.Size = new Size(20, 20); sundayCheckBox.Location = new Point(65, 160); this.Controls.Add(sundayCheckBox); // back button back = new Button(); back.Size = new Size(75, 30); back.Location = new Point(150, 195); back.Text = "Back"; this.Controls.Add(back); back.Click += new EventHandler(backButtonHandler); back.BackColor = System.Drawing.Color.Orange; back.ForeColor = System.Drawing.Color.White; back.FlatStyle = FlatStyle.Flat; back.Font = new Font("Arial", 11, FontStyle.Bold); back.TextAlign = ContentAlignment.MiddleCenter; // save button save = new Button(); save.Size = new Size(75, 30); save.Location = new Point(65, 195); save.Text = "Save"; this.Controls.Add(save); save.Click += new EventHandler(saveButtonHandler); save.BackColor = System.Drawing.Color.Orange; save.ForeColor = System.Drawing.Color.White; save.FlatStyle = FlatStyle.Flat; save.Font = new Font("Arial", 11, FontStyle.Bold); save.TextAlign = ContentAlignment.MiddleCenter; // add panel to MasterForm mf.Controls.Add(this); }//end AlterAvailabilityForm constructor