private void FillStandingReservations()
    {
        H2Title.InnerText = "Pending Standing Reservation Requests";
        ClubBAIST cb = new ClubBAIST();
        //gets reservations that are not approved(0), but active(1)
        List <StandingReservation> sr = cb.ReadStandingReservations(0, 1);

        ListStandingReservations(sr);
    }
    protected void PendingReservations_Click(object sender, EventArgs e)
    {
        H2Title.InnerText = "Pending Standing Reservation Requests";
        ClubBAIST cb = new ClubBAIST();
        List <StandingReservation> sr = cb.ReadStandingReservations(0, 1); //gets standing reservations that are not approved(0), but active(1)

        ListStandingReservations(sr);
        PendingReservationsButton.Visible  = false;
        PendingReservationsButton.Enabled  = false;
        ApprovedReservationsButton.Visible = true;
        ApprovedReservationsButton.Enabled = true;
    }
Пример #3
0
    protected void DaySelected(object sender, EventArgs e)
    {
        DateTime selectedDay = Calendar.SelectedDate;

        if (selectedDay < DateTime.Today)
        {
            msg.Text = "you can't book in the past";
            Calendar.SelectedDate = DateTime.Today;
        }
        ClubBAIST                  cb                   = new ClubBAIST();
        List <Reservation>         TeeTimesForDay       = cb.ReadReservationBatchByTimeFrame(selectedDay, selectedDay.AddDays(1));
        List <StandingReservation> StandingReservations = cb.ReadStandingReservations(1, 1);//get approved and active reservations

        TeeTimesDD.Items.Clear();
        DateTime bufferDateTime = selectedDay.AddHours(7.00);
        bool     offset         = true;

        while (bufferDateTime <= selectedDay.AddHours(18))
        {
            ListItem li = new ListItem();
            li.Text  = bufferDateTime.TimeOfDay.ToString();
            li.Value = MakeFormattedDate(bufferDateTime);

            foreach (Reservation r in TeeTimesForDay)
            {
                if (r.ReservedTime == bufferDateTime)
                {
                    li.Attributes.Add("disabled", "true");
                }
            }
            foreach (StandingReservation sr in StandingReservations)
            {
                if (sr.ReservedTime.DayOfWeek.ToString() == bufferDateTime.DayOfWeek.ToString() && sr.ReservedTime.TimeOfDay.ToString() == bufferDateTime.TimeOfDay.ToString())
                {
                    li.Attributes.Add("disabled", "true");
                }
            }
            TeeTimesDD.Items.Add(li);
            if (offset)
            {
                bufferDateTime = bufferDateTime.AddMinutes(7.00);
                offset         = false;
            }
            else
            {
                bufferDateTime = bufferDateTime.AddMinutes(8.00);
                offset         = true;
            }
        }
    }