public AppointmentResponse GetDocSchedule(AppointmentRequest request)
    {
        AppointmentResponse response = new AppointmentResponse();

        // Set correlation Id
        response.CorrelationId = request.RequestId;

        try
        {

            // Get customer list via Customer Facade.
            AppointmentFacade facade = new AppointmentFacade();
            response.ds= facade.GetDocSchedule(request.date,request.docID);

        }
        catch (Exception ex)
        {
            response.Acknowledge = AcknowledgeType.Failure;
            response.Message = "Request cannot be handled at this time."+ex.Message;
        }

        return response;
    }
    public PersistAppointmentResponse PersistAppt(PersistAppointmentRequest request)
    {
        PersistAppointmentResponse response = new PersistAppointmentResponse();

        // Set correlation Id

        response.CorrelationId = request.RequestId;

        try
        {
            // Call persistence request via Customer Facade.
            AppointmentFacade facade = new AppointmentFacade();

            switch (request.PersistAction)
            {
                case PersistType.Insert:
                    {
                        facade.AddStudentAppointment(request.patientID, request.DoctorID, request.Date, request.strSet, request.TimeID);

                        response.Acknowledge = AcknowledgeType.Success;
                        //facade.AddDoctor(doctor);

                        //response.Doctor = request.Doctor;
                        //response.Doctor.docID = doctor.DoctorID;

                        break;
                    }
                case PersistType.Update:
                    {
                        Appointment appt = new Appointment();

                        appt.DoctorID = request.Appt.doctorID;
                        appt.AM8 = request.Appt.AM0800;
                        appt.AM830 = request.Appt.AM0830;
                        appt.AM9 = request.Appt.AM0900;
                        appt.AM930 = request.Appt.AM0930;
                        appt.AM10 = request.Appt.AM1000;
                        appt.AM1030 = request.Appt.AM1030;
                        appt.AM11 = request.Appt.AM1100;
                        appt.AM1130 = request.Appt.AM1130;
                        appt.PM12 = request.Appt.PM1200;
                        appt.PM1230 = request.Appt.PM1230;
                        appt.PM0100 = request.Appt.PM0100;
                        appt.PM0130 = request.Appt.PM0130;
                        appt.PM0200 = request.Appt.PM0200;
                        appt.PM0230 = request.Appt.PM0230;
                        appt.PM0300 = request.Appt.PM0300;
                        appt.PM0330 = request.Appt.PM0330;
                        appt.PM0400 = request.Appt.PM0400;
                        appt.PM0430 = request.Appt.PM0430;
                        appt.PM0500 = request.Appt.PM0500;
                        int dayID=request.Appt.dayID;

                        facade.UpdateDoctorAppointment(appt,dayID);

                       // response.Customer = request.Customer;
                        break;
                    }
                //case PersistType.Delete:
                //    {
                //        int customerId = DecryptId(request.Customer.CustomerId);
                //        int rowsAffected = facade.DeleteCustomer(customerId);
                //        if (rowsAffected == 0)
                //            throw new Exception("Customer has orders and therefore cannot be deleted. ");

                //        break;
                //    }
            }

        }
        catch (Exception ex)
        {
            response.Acknowledge = AcknowledgeType.Failure;
            response.Message = ex.Message;
        }

        return response;
    }