private void SetDeatils(DateTime date, int id) { DoctorServiceRef.IDoctorService doctorService = new DoctorServiceRef.DoctorServiceClient(); DoctorServiceRef.Doctor doc = doctorService.GetDoctor(id); doctor.Text = doc.firstName + " " + doc.lastName; appointmentDate.Text = date.ToString(); }
private void button1_Click(object sender, EventArgs e) { doctor = new DoctorServiceRef.Doctor(); string message = ""; int zip; Int32.TryParse(zipTxt.Text, out zip); int streetNr; Int32.TryParse(streetNrTxt.Text, out streetNr); doctor.firstName = firstNameTxt.Text; doctor.lastName = lastNameTxt.Text; doctor.city = cityTxt.Text; doctor.zip = zip; doctor.street = streetTxt.Text; doctor.streetNr = streetNr; doctor.phoneNr = phoneTxt.Text; doctor.specialty = specialtyTxt.Text; doctor.description = descriptionTxt.Text; doctor.login = usernameTxt.Text; doctor.pass = passwordTxt.Text; var client = new DoctorServiceRef.DoctorServiceClient(); if (client.SaveDoctor(ref doctor, ref message)) { Dispose(); } else { new Thread(() => new ErrorWindow(message).ShowDialog()).Start(); } }
private void button1_Click(object sender, EventArgs e) { string message = ""; int zipNr; Int32.TryParse(zip.Text, out zipNr); int streetNr; Int32.TryParse(streetnr.Text, out streetNr); doc.firstName = firstname.Text; doc.lastName = lastname.Text; doc.city = city.Text; doc.zip = zipNr; doc.street = street.Text; doc.streetNr = streetNr; doc.phoneNr = phonenr.Text; doc.specialty = speciality.Text; doc.description = description.Text; var doctorService = new DoctorServiceRef.DoctorServiceClient(); try { doctorService.UpdateDoctor(ref doc, ref message); new Thread(() => new ErrorWindow("The update was successful !").ShowDialog()).Start(); } catch (FaultException) { new Thread(() => new ErrorWindow("The update was unsuccessful due to inconsistent data !").ShowDialog()).Start(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { var client = new DoctorServiceRef.DoctorServiceClient(); List<DoctorServiceRef.Doctor> doctors = client.GetAllDoctors().ToList(); populateTreeView(doctors); } }
private void SetDeatils(DateTime date, int doctorId,int patientId, string serviceType) { DoctorServiceRef.IDoctorService doctorService = new DoctorServiceRef.DoctorServiceClient(); DoctorServiceRef.Doctor doc = doctorService.GetDoctor(doctorId); PatientService.IPatientService patientservice = new PatientService.PatientServiceClient(); PatientService.Patient patient = patientservice.GetPatient(patientId); doctor.Text = doc.firstName + " " + doc.lastName; patientName.Text = patient.firstName + " " + patient.lastName; appointmentDate.Text = date.ToString(); serviceTypeTXT.Text = serviceType; }
private void setDoctor(int id) { DoctorServiceRef.IDoctorService doctorService = new DoctorServiceRef.DoctorServiceClient(); DoctorServiceRef.Doctor doc = doctorService.GetDoctor(id); firstname.Text = doc.firstName; lastname.Text = doc.lastName; city.Text = doc.city; zip.Text = doc.zip.ToString(); street.Text = doc.street; streetnr.Text = doc.streetNr.ToString(); phonenr.Text = doc.phoneNr; password.Text = doc.pass; username.Text = doc.login; description.Text = doc.description; speciality.Text = doc.specialty; }
private DoctorServiceRef.Doctor GetDoctor(int id) { DoctorServiceRef.IDoctorService doctorService = new DoctorServiceRef.DoctorServiceClient(); DoctorServiceRef.Doctor doc = doctorService.GetDoctor(id); label2.Text = doc.firstName; return doc; }