public static StandardAppointmentDto ToStandardAppointmentDto(this StandardAppointment from)
        {
            StandardAppointmentDto to = from.ConvertTo <StandardAppointmentDto>();

            //to.StandardAppointmentExceptions = from.StandardAppointmentExceptions.ToList().ConvertAll(x => x.ConvertTo<StandardAppointmentExceptionDto>());
            return(to);
        }
        SchedulerDragData GetDragData(GridView gridView)
        {
            Appointment appointment = null;

            try
            {
                int[] selection = gridView.GetSelectedRows();
                if (selection == null)
                {
                    return(null);
                }

                if (gridView != null && gridView.FocusedRowHandle > -1)
                {
                    if (gridView.GetRow(gridView.FocusedRowHandle) is JarsDefaultAppointment)
                    {
                        JarsDefaultAppointment defAppt = gridView.GetRow(gridView.FocusedRowHandle) as JarsDefaultAppointment;
                        appointment             = schedulerDataStorage.CreateAppointment(AppointmentType.Normal); //create a devexpress appointment
                        appointment.Subject     = defAppt.Subject;
                        appointment.Description = defAppt.Description;
                        if (defAppt.IsAllDay)
                        {
                            appointment.AllDay = true;
                        }
                        else
                        {
                            appointment.Duration = TimeSpan.FromHours(defAppt.DefaultDuration);
                        }

                        //appointment that will be wrapped by the devexpress appt.
                        StandardAppointment stdAppointment = new StandardAppointment();

                        //convert to standard appointment that can be saved
                        stdAppointment = appointment.ConvertTo <StandardAppointment>();
                        appointment.SetId(stdAppointment.GuidValue);
                        appointment.CustomFields["ENTITY"] = stdAppointment;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message, ex);
#if DEBUG
                throw new Exception("DefaultStandardAppointmentControl_GetDridData", ex);
#endif
            }
            return(new SchedulerDragData(appointment));
        }
Esempio n. 3
0
        /// <summary>
        /// Update or create a single StandardAppointment.
        /// </summary>
        /// <param name="request">The request containing the StandardAppointment that needs to be created or updated</param>
        /// <returns>The updated StandardAppointment will be returned.</returns>
        public virtual StandardAppointmentResponse Any(StoreStandardAppointment request)
        {
            //return ExecuteFaultHandledMethod(() =>
            //{

            StandardAppointmentResponse response = new StandardAppointmentResponse();
            var _repository = _DataRepositoryFactory.GetDataRepository <IGenericEntityRepositoryBase <StandardAppointment, IDataContextNhJars> >();

            //this fixes the references in case an appointment has exceptions ??
            //foreach (var apptEx in request.Appointment.StandardAppointmentExceptions)
            //{
            //    apptEx.StandardAppointment = request.Appointment;
            //}
            StandardAppointment appt = request.Appointment.FromStandardAppointmentDto();

            response.Appointment = _repository.CreateUpdate(appt, CurrentSessionUsername).ToStandardAppointmentDto();

            return(response);
            //});
        }
Esempio n. 4
0
        public void Generate_generic_parameter_type_from_type()
        {
            IEntityBase ent = new StandardAppointment()
            {
                Id = 10
            };

            IProcessor processor = _factory.GetJarsProcessor <IProcessor>(ent.GetType().Name);

            if (processor is IProcessorForShowAppointmentForm)
            {
                Assert.IsTrue(true);
            }

            if (processor is IProcessorForAppointmentEvents)
            {
                Assert.IsTrue(true);
            }

            if (processor is IProcessorForEventServiceCommandReceived)
            {
                Assert.IsTrue(true);
            }
        }