public bool AppointmentBooking(string patientName, string doctorName, DateTime appointmentTime, string clinicName) { string[] patientNames = patientName.Split(' '); string[] doctorNames = doctorName.Split(' '); if (patientNames.Length != 2 || doctorNames.Length != 2) { return false; } Patient patient = GetPatientInfo(patientNames[0], patientNames[1]); Doctor doctor = GetDoctorInfo(doctorNames[0], doctorNames[1]); AppointmentData appointment = new AppointmentData() { HealthInsuranceNo = patient.HealthInsuranceNo, MedicalRegistrationNo = doctor.MedicalRegistrationNo, AppointmentTime = appointmentTime, ClinicName = clinicName }; db.AppointmentDatas.InsertOnSubmit(appointment); try { db.SubmitChanges(); } catch (Exception e) { throw new FaultException(e.Message); } return true; }
private void detach_AppointmentDatas(AppointmentData entity) { this.SendPropertyChanging(); entity.DoctorData = null; }
partial void DeleteAppointmentData(AppointmentData instance);
partial void UpdateAppointmentData(AppointmentData instance);
partial void InsertAppointmentData(AppointmentData instance);
private void attach_AppointmentDatas(AppointmentData entity) { this.SendPropertyChanging(); entity.PatientData = this; }