public void AppointmentSaveTest() { string description = GenString(_r.Next(15, 20)); OpenConnection(); Appointment a = new Appointment(patientService.FindAll()[0].Id, doctorService.FindAll()[0].Id, _r.Next(8, 18), DateTime.Now, description); Assert.IsInstanceOfType(appointmentService.Save(a), typeof(int)); CloseConnection(); }
/// <summary> /// gets all doctors using DoctorService /// and buid a Expander control with header= doctor name and content= department /// for each expander create a new row in gridDoctors /// </summary> private void PopulateDoctorGrid() { _doctorService = new DoctorService(); List <Doctor> doctors = _doctorService.FindAll(); List <Department> departments = _deptService.FindAll(); int i = 0; foreach (Doctor doctor in doctors) { //select only doctors that are active //a doctor with status 0 means that he does not work at this clinic anymore if (doctor.Status == 1) { Expander expander = new Expander(); expander.Header = doctor.FirstName + " " + doctor.LastName; StackPanel stackPanel = new StackPanel(); TextBlock txt = new TextBlock(); txt.Text = GetDepartmentName(doctor.IdDept, departments);//doctorDept.Name + ", " + doctorDept.Floor; stackPanel.Children.Add(txt); expander.Content = stackPanel; gridDoctors.RowDefinitions.Add(new RowDefinition()); gridDoctors.RowDefinitions[i].Height = new GridLength(50); Grid.SetRow(expander, i); i++; gridDoctors.Children.Add(expander); } } }
/// <summary> /// gets all doctors using DoctorService /// and buid a Expander control with header= doctor name and content= department /// for each expander create a new row in gridDoctors /// </summary> private void PopulateDoctorGrid() { _doctorService = new DoctorService(); List<Doctor> doctors = _doctorService.FindAll(); List<Department> departments = _deptService.FindAll(); int i = 0; foreach (Doctor doctor in doctors) { //select only doctors that are active //a doctor with status 0 means that he does not work at this clinic anymore if (doctor.Status == 1) { Expander expander = new Expander(); expander.Header = doctor.FirstName + " " + doctor.LastName; StackPanel stackPanel = new StackPanel(); TextBlock txt = new TextBlock(); txt.Text = GetDepartmentName(doctor.IdDept, departments);//doctorDept.Name + ", " + doctorDept.Floor; stackPanel.Children.Add(txt); expander.Content = stackPanel; gridDoctors.RowDefinitions.Add(new RowDefinition()); gridDoctors.RowDefinitions[i].Height = new GridLength(50); Grid.SetRow(expander, i); i++; gridDoctors.Children.Add(expander); } } }