예제 #1
0
        protected void Appointment_Deleting(object sender, ObjectDataSourceMethodEventArgs e)
        {
            IDictionary paramsFromPage = e.InputParameters;

            paramsFromPage.Remove("Appointment");

            AppointmentServiceRef.Appointment app = new AppointmentServiceRef.Appointment();
            app.id = (int)paramsFromPage["id"];
            app.doctor = new AppointmentServiceRef.Doctor();
            app.patient = new AppointmentServiceRef.Patient();

            paramsFromPage.Add("Appointment",app);
            paramsFromPage.Remove("id");
        }
예제 #2
0
        private void MakeAppointment()
        {
            AppointmentServiceRef.Appointment appointment = new AppointmentServiceRef.Appointment();
            appointment.doctor = new AppointmentServiceRef.Doctor();
            appointment.doctor.id = DoctorId;
            PatientServiceRef.Patient pat = (PatientServiceRef.Patient)Session["patientObj"];
            appointment.patient = new AppointmentServiceRef.Patient();
            appointment.patient.id = pat.id;
            appointment.serviceType = doctorService.GetDoctor(DoctorId).specialty;

            appointment.time = FinalDate;
            string message = "";
            var client = new AppointmentServiceRef.AppointmentServiceClient();
            Calendar1.Visible = false;
            Panel1.Visible = false;
            DropDownList1.Visible = false;
            Label2.Visible = false;
            Label1.Visible = true;
            try { client.SaveAppointment(ref appointment, ref message);
            Label1.Text = "You have made an appointent on: " + FinalDate.ToShortDateString();
            }

            catch (FaultException )
            {

                Label1.Text = "An error occured while saving the appointment. " ;
            }
        }