Ejemplo n.º 1
0
        private void ViewAllSubjects_FormClosed(object sender, FormClosedEventArgs e)
        {
            bool subjSelected = false;
            //Get list of all student workers who tutor the selected subjects
            List <string> tutorList = new List <string>();

            for (int i = 0; i < subjectListView.Items.Count; i++)
            {
                if (subjectListView.Items[i].Checked)
                {
                    subjSelected = true;
                    tutorList.AddRange(subjectList[i].GetTutorIDs());
                }
            }
            tutorList = tutorList.Distinct().ToList();

            //Update properties
            if (subjSelected)
            {
                Properties.Settings.Default.SelectedWorkers.Clear();
                Properties.Settings.Default.SelectedWorkers.AddRange(tutorList.ToArray());
                Properties.Settings.Default.Save();
                RefreshCalendars.Refresh();
            }
        }
Ejemplo n.º 2
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            this.MinimumSize = new Size(800, 600);

            // scroll down until 7am is at the top of the panel when the form is first shown
            calendarPanel.AutoScrollPosition = new Point(0, 592);

            // update the Form title
            string scheduleName = DatabaseManager.GetCurrentScheduleName();

            if (scheduleName == "")
            {
                Text = "Tutor Scheduler";
            }
            else
            {
                Text = "Tutor Scheduler - " + scheduleName;
            }

            // load events into the calendar
            RefreshCalendars.Refresh();

            // show the day label panel after day labels are sized properly
            dayLabelPanel.Show();
        }
        private void StudentWorkerInfoForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            //Save name, position, color
            int color = colorButton.BackColor.ToArgb() & 0x00FFFFFF;

            selectedStudentWorker.UpdateInformation(nameTextBox.Text, positionComboBox.Text, color);
            RefreshCalendars.Refresh();
        }
Ejemplo n.º 4
0
        private void CreateButton_Click(object sender, EventArgs e)
        {
            DatabaseManager.CreateSchedule(nameTextBox.Text);

            // refresh the calendar and close this form
            RefreshCalendars.Refresh();
            this.Close();
        }
Ejemplo n.º 5
0
 private void ViewAllWorkers_FormClosed(object sender, FormClosedEventArgs e)
 {
     Properties.Settings.Default.SelectedWorkers.Clear();
     for (int i = 0; i < studentWorkerListView.Items.Count; i++)
     {
         bool itemChecked = studentWorkerListView.Items[i].Checked;
         if (itemChecked)
         {
             Properties.Settings.Default.SelectedWorkers.Add(StudentWorker.allStudentWorkers[i].StudentID.ToString());
         }
         StudentWorker.allStudentWorkers[i].Selected = itemChecked;
     }
     Properties.Settings.Default.Save();
     RefreshCalendars.Refresh();
 }
Ejemplo n.º 6
0
        private void OpenButton_Click(object sender, EventArgs e)
        {
            if (scheduleListBox.SelectedItems.Count == 0)
            {
                new AlertDialog("Select a schedule to open.").ShowDialog();
            }
            else
            {
                // open the selected schedule
                string idString = FullSchedules[scheduleListBox.SelectedIndex][0];
                Console.WriteLine(idString);
                DatabaseManager.OpenSchedule(idString);

                // refresh the calendar views and close
                RefreshCalendars.Refresh();
                this.Close();
            }
        }
Ejemplo n.º 7
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            base.OnMouseClick(e);

            CalendarEvent hitEvent = EventAt(e.Location);

            // perform actions on event that was clicked
            if (hitEvent != null)
            {
                // if work event, edit it; otherwise, do nothing
                if (hitEvent.type == CalendarEvent.WORK)
                {
                    hitEvent.OnClick();
                }
            }
            else
            {
                new CreateWorkEventForm().ShowDialog();
                //Refresh the schedule
                RefreshCalendars.Refresh();
            }
        }
Ejemplo n.º 8
0
 private void CreateWorkEventForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     RefreshCalendars.Refresh();
 }
Ejemplo n.º 9
0
 private void ClassesToolStripMenuItem_Click(object sender, EventArgs e)
 {
     showClasses = !showClasses;
     RefreshCalendars.Refresh();
 }
Ejemplo n.º 10
0
 private void AvailabilityToolStripMenuItem_Click(object sender, EventArgs e)
 {
     showAvailability = !showAvailability;
     RefreshCalendars.Refresh();
 }
Ejemplo n.º 11
0
 private void CalendarDayView1_Click(object sender, EventArgs e)
 {
     // Refresh the schedule
     RefreshCalendars.Refresh();
 }