Ejemplo n.º 1
0
        // #3 Method updates TUTOR drop-down with available tutors
        private void CB_AvailTimes_SelectedIndexChanged(object sender, EventArgs e)
        {
            CB_AvailTutors.Items.Clear();
            TutorAccessLayer TAL = new TutorAccessLayer(Session.Database);

            _tutors = TAL.GetAvailableTutorsInstrument(_instruments[CB_Instrument.SelectedIndex], _periods[CB_AvailTimes.SelectedIndex], _terms[LB_Terms.SelectedIndex], _day);
            foreach (Tutor t in _tutors)
            {
                CB_AvailTutors.Items.Add(t.Forename + " " + t.Surname + " - " + TAL.CalculateTutorEfficiency(t, _terms[LB_Terms.SelectedIndex]) + "% booked");
            }
        }
        private void B_Logon_Click(object sender, EventArgs e)
        {
            TutorAccessLayer TAL = new TutorAccessLayer(Session.Database);

            if (TAL.Login(TB_Username.Text, TB_Password.Text))
            {
                TutorHome TutorWin = new TutorHome();
                TutorWin.Show();
            }
            else
            {
                MessageBox.Show("Your credientials are invalid.", "Invalid Login");
            }
        }
Ejemplo n.º 3
0
        private void FillLists()
        {
            InstrumentAccessLayer IAL = new InstrumentAccessLayer(Session.Database);

            _instruments = IAL.GetAllInstruments();
            TermAccessLayer TAL = new TermAccessLayer(Session.Database);

            _terms = TAL.GetAllTerms();
            DayAccessLayer DAL = new DayAccessLayer(Session.Database);

            _days = DAL.GetAllDays();
            PeriodAccessLayer PAL = new PeriodAccessLayer(Session.Database);

            _periods = PAL.GetAllPeriods();
            TutorAccessLayer TuAL = new TutorAccessLayer(Session.Database);

            _tutors = TuAL.GetAllTutors();
            RoomAccessLayer RAL = new RoomAccessLayer(Session.Database);

            _rooms = RAL.GetAllRooms();
        }