/**
  * Constructor assings values to fields and prepares the view
  *
  * @param date
  * @param time
  * @param staffName name of the staff member
  * @param typeOfAppointment appointmentType
  * @param parent appointmentBox object
  */
 public CancelAppointmentConfirmation(string date, string time, string staffName, string typeOfAppointment, appointmentBox parent)
 {
     InitializeComponent();
     this.parent            = parent;
     this.date              = date;
     this.time              = time;
     this.staffName         = staffName;
     this.typeOfAppointment = typeOfAppointment;
     fillInAppointmentInformation();
     this.CenterToScreen();
 }
Example #2
0
        /** Method generates appointment boxes */
        public void getAppointmentBoxes()
        {
            pastAppointmentsContainer.Controls.Clear();
            BookingController controller         = new BookingController();
            List <IModel>     bookedAppointments = controller.getPastAppointmentsPerUser();

            foreach (BookingModel booking in bookedAppointments)
            {
                string         time = this.getTimeInDisplayableFormat(booking.getStartTime(), booking.getEndTime());
                appointmentBox box  = new appointmentBox(this, booking, time);
                box.hideCancelButton();
                box.disableRescheduleButton();
                pastAppointmentsContainer.Controls.Add(box);
            }
        }
Example #3
0
        /** Method generates appointment boxes */
        public void getAppointmentBoxes()
        {
            appointmentsContainer.Controls.Clear();
            BookingController controller = new BookingController();
            List <IModel>     bookedAppointments;

            if (!ApplicationState.userType.Equals("admin"))
            {
                bookedAppointments = controller.getAllUpcomingAppointments();
            }
            else
            {
                bookedAppointments = controller.getBookedAppointmentsForNextMonth();
            }
            if (bookedAppointments != null)
            {
                foreach (BookingModel booking in bookedAppointments)
                {
                    string         time = booking.getStartTime().Substring(0, 5) + " - " + booking.getEndTime().Substring(0, 5);
                    appointmentBox box  = new appointmentBox(this, booking, time);
                    appointmentsContainer.Controls.Add(box);
                }
            }
        }
Example #4
0
 /**
  * Constructor initializes fields and build the view up
  *
  * @param date
  * @param time
  * @param staffName
  * @param typeOfAppointment
  * @param parent appointmentBox objects
  */
 public PrintConfirmationWindow(string date, string time, string staffName, string typeOfAppointment, appointmentBox parent = null)
 {
     InitializeComponent();
     this.date              = date;
     this.time              = time;
     this.staffName         = staffName;
     this.typeOfAppointment = typeOfAppointment;
     fillInData();
     this.CenterToScreen();
 }