コード例 #1
0
        public List <AppointmentView> GetAppointmentsByPractitionerId(int id)
        {
            lock (_lockingObject)
            {
                List <AppointmentView> appointments = new List <AppointmentView>();
                foreach (Appointment appointment in _appointments)
                {
                    foreach (User person in appointment.Participants)
                    {
                        if (person.Id == id)
                        {
                            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);
                            }
                            RoomView        roomView = new RoomView(appointment.Location.Id, appointment.Location.Name);
                            AppointmentView appView  = new AppointmentView(appointment.Id, appointment.DateAndTime, userViews,
                                                                           new AppointmentTypeView(appointment.AppointmentType.Id, appointment.AppointmentType.Name,
                                                                                                   appointment.AppointmentType.Duration, appointment.AppointmentType.StandardPrice), roomView, appointment.Note, appointment.Price, appointment.NotificationTime, appointment.EmailNotification, appointment.SmsNotification);

                            appointments.Add(appView);
                        }
                    }
                }

                return(appointments);
            }
        }
コード例 #2
0
        internal RoomView GetRoomByAppointmentId(int appointmentId, string departmentName)
        {
            Department tempDepartment = _departments.Find(depart => depart.Name == departmentName);
            Room       tempRoom       = tempDepartment.GetRoomByAppointmnetId(appointmentId);
            RoomView   roomView       = new RoomView(tempRoom.Id, tempRoom.Name);

            return(roomView);
        }
コード例 #3
0
 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;
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        public RoomView GetRoomByAppointmentId(int appointmentId, string departmentName)
        {
            RoomView roomView = _departmentRepo.GetRoomByAppointmentId(appointmentId, departmentName);

            return(roomView);
        }