public AddDoctorAppointmentViewModel(AddDoctorAppointment addDoctorAppointmentOpen, vwDoctorAppointment doctorAppointmentToEdit) { doctorAppointment = doctorAppointmentToEdit; addDoctorAppointment = addDoctorAppointmentOpen; using (Service1Client wcf = new Service1Client()) { PatientsList = wcf.GetAllPatients().ToList(); MedicalDepartmentsList = wcf.GetAllMedicalDepartments().ToList(); } }
private void AddNewDoctorAppointmentExecute() { try { AddDoctorAppointment addDoctorAppointment = new AddDoctorAppointment(); addDoctorAppointment.ShowDialog(); // ovo koristimo da bi posle dodavanja DoctorAppointments-a u gridu bili // prikazani novi rezultati, refresovani! using (Service1Client wcf = new Service1Client()) { DoctorAppointmentList = wcf.GetAllDoctorAppointment().ToList(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void EditDoctorAppointmentExecute() { try { if (editDoctorAppointment != null) { AddDoctorAppointment addDoctorAppointment = new AddDoctorAppointment(DoctorAppointment); addDoctorAppointment.ShowDialog(); using (Service1Client wcf = new Service1Client()) { DoctorAppointmentList = wcf.GetAllDoctorAppointment().ToList(); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }