public AppointmentTypeView GetAppointmentTypeByName(string typeName, string practitionerName) { AppointmentType tempType = _practitionerRepo.GetTreatmentByTreatmentName(typeName, practitionerName); AppointmentTypeView appoTypeView = new AppointmentTypeView(tempType.Id, tempType.Name, tempType.Duration, tempType.StandardPrice); return(appoTypeView); }
public AppointmentView(int id, DateTime dateAndTime, List <UserView> users, AppointmentTypeView appointmentType, RoomView room, string note, double price, TimeSpan notificationTime, bool emailNotification, bool smsNotification) { Id = id; DateAndTime = dateAndTime; Users = users; TypeView = appointmentType; RoomView = room; Note = note; Price = price; EmailNotification = emailNotification; SMSNotification = smsNotification; NotificationTime = notificationTime; }
public AppointmentView GetAppointmentById(int appointmentId) { lock (_lockingObject) { Appointment appointment = _appointments.Find(app => app.Id == appointmentId); List <UserView> userViews = new List <UserView>(); foreach (User user in appointment.Participants) { UserView view = new UserView(user.Id, user.Name, user.PhoneNumber, user.Address, user.Email); userViews.Add(view); } AppointmentTypeView typeView = new AppointmentTypeView(appointment.AppointmentType.Id, appointment.AppointmentType.Name, appointment.AppointmentType.Duration, appointment.AppointmentType.StandardPrice); RoomView roomView = new RoomView(appointment.Location.Id, appointment.Location.Name); AppointmentView appointmentView = new AppointmentView(appointment.Id, appointment.DateAndTime, userViews, typeView, roomView, appointment.Note, appointment.Price, appointment.NotificationTime, appointment.EmailNotification, appointment.SmsNotification); return(appointmentView); } }