/// <summary>
        /// Get the appointment
        /// </summary>
        /// <param name="appiontmentId">The appintment identifier.</param>
        /// <returns></returns>
        public Response <AppointmentModel> GetAppointment(long appiontmentId)
        {
            var appointmentRepository = unitOfWork.GetRepository <AppointmentModel>(SchemaName.Scheduling);

            SqlParameter        appintmentIdParam = new SqlParameter("AppointmentID", appiontmentId);
            List <SqlParameter> procParams        = new List <SqlParameter>()
            {
                appintmentIdParam
            };

            var appointment = appointmentRepository.ExecuteStoredProc("usp_GetAppointment", procParams);

            if (appointment.DataItems.Count > 0 && appointment.DataItems[0].RecurrenceID != null)
            {
                appointment.DataItems[0].Recurrence = _recurrenceDataProvider.GetRecurrence(appointment.DataItems[0].RecurrenceID);
            }

            return(appointment);
        }
Пример #2
0
        public Response <AppointmentModel> GetAppointmentByGroupID(long groupID)
        {
            var                 groupSchedulingRepository = _unitOfWork.GetRepository <AppointmentModel>(SchemaName.Scheduling);
            SqlParameter        groupHeaderIDParam        = new SqlParameter("GroupHeaderID", groupID);
            List <SqlParameter> procParams = new List <SqlParameter>()
            {
                groupHeaderIDParam
            };
            var appointment = groupSchedulingRepository.ExecuteStoredProc("usp_GetAppointmentByGroupID", procParams);

            if (appointment.DataItems.Count > 0 && appointment.DataItems[0].RecurrenceID != null)
            {
                appointment.DataItems[0].Recurrence = _recurrenceDataProvider.GetRecurrence(appointment.DataItems[0].RecurrenceID);
            }

            return(appointment);
        }