private void EnableDisableFields(PXCache cache, FSCloneAppointmentFilter fsCloneAppointmentFilterRow)
        {
            bool isSingleAppointment = fsCloneAppointmentFilterRow.CloningType == ID.CloningType_CloneAppointment.SINGLE;

            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.scheduledDate>(cache, fsCloneAppointmentFilterRow, isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.scheduledDate>(cache, fsCloneAppointmentFilterRow, isSingleAppointment);

            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.scheduledFromDate>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.scheduledFromDate>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetRequired <FSCloneAppointmentFilter.scheduledFromDate>(cache, !isSingleAppointment);

            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.scheduledToDate>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.scheduledToDate>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetRequired <FSCloneAppointmentFilter.scheduledToDate>(cache, !isSingleAppointment);

            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.activeOnMonday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.activeOnMonday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.activeOnThursday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.activeOnThursday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.activeOnWednesday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.activeOnWednesday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.activeOnTuesday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.activeOnTuesday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.activeOnFriday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.activeOnFriday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.activeOnSaturday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.activeOnSaturday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetEnabled <FSCloneAppointmentFilter.activeOnSunday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
            PXUIFieldAttribute.SetVisible <FSCloneAppointmentFilter.activeOnSunday>(cache, fsCloneAppointmentFilterRow, !isSingleAppointment);
        }
        protected void FSCloneAppointmentFilter_ScheduledEndTime_Time_FieldUpdating(PXCache cache, PXFieldUpdatingEventArgs e)
        {
            if (e.Row == null || e.NewValue == null)
            {
                return;
            }

            FSCloneAppointmentFilter fsCloneAppointmentFilterRow = (FSCloneAppointmentFilter)e.Row;

            fsCloneAppointmentFilterRow.ScheduledEndTime = SharedFunctions.TryParseHandlingDateTime(cache, e.NewValue);
            fsCloneAppointmentFilterRow.ScheduledEndTime = SharedFunctions.GetCustomDateTime(AppointmentSelected.Current.ScheduledDateTimeEnd, fsCloneAppointmentFilterRow.ScheduledEndTime);
        }
        protected void FSCloneAppointmentFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSCloneAppointmentFilter fsCloneAppointmentFilterRow = (FSCloneAppointmentFilter)e.Row;

            HideRooms();
            EnableDisableFields(cache, fsCloneAppointmentFilterRow);
        }
コード例 #4
0
        protected virtual void _(Events.RowSelected <FSCloneAppointmentFilter> e)
        {
            if (e.Row == null)
            {
                return;
            }

            FSCloneAppointmentFilter fsCloneAppointmentFilterRow = (FSCloneAppointmentFilter)e.Row;

            HideRooms();
            EnableDisableFields(e.Cache, fsCloneAppointmentFilterRow);
        }
        protected void FSCloneAppointmentFilter_ScheduledStartTime_Time_FieldUpdating(PXCache cache, PXFieldUpdatingEventArgs e)
        {
            if (e.Row == null || e.NewValue == null)
            {
                return;
            }

            FSCloneAppointmentFilter fsCloneAppointmentFilterRow = (FSCloneAppointmentFilter)e.Row;

            fsCloneAppointmentFilterRow.ScheduledStartTime = SharedFunctions.TryParseHandlingDateTime(cache, e.NewValue);

            DateTime EndTimeValue = fsCloneAppointmentFilterRow.ScheduledStartTime.Value.AddMinutes((double)fsCloneAppointmentFilterRow.OriginalDuration);

            fsCloneAppointmentFilterRow.ScheduledEndTime = SharedFunctions.GetCustomDateTime(AppointmentSelected.Current.ScheduledDateTimeEnd, EndTimeValue);
        }