Esempio n. 1
0
        public static void CalculateStartEndTime(PXGraph graph, string calendarID, DateTime date, out DateTime startDate, out DateTime endDate)
        {
            CSCalendar calendar = PXSelect <CSCalendar> .Search <CSCalendar.calendarID>(graph, calendarID);

            if (calendar == null)
            {
                throw new InvalidOperationException(Messages.FailedToSelectCalenderId);
            }

            CSCalendarExceptions cse = PXSelect <CSCalendarExceptions> .
                                       Search <CSCalendarExceptions.calendarID, CSCalendarExceptions.date>(graph, calendarID, date);

            CalendarHelper helper = new CalendarHelper(calendar, cse, date);

            helper.CalculateStartEndTime(out startDate, out endDate);
        }
Esempio n. 2
0
		public static void CalculateStartEndTime(PXGraph graph, string calendarID, DateTime date, out DateTime startDate, out DateTime endDate)
		{
			CSCalendar calendar = PXSelect<CSCalendar>.Search<CSCalendar.calendarID>(graph, calendarID);

			if (calendar == null)
				throw new InvalidOperationException(Messages.FailedToSelectCalenderId);

			CSCalendarExceptions cse = PXSelect<CSCalendarExceptions>.
				Search<CSCalendarExceptions.calendarID, CSCalendarExceptions.date>(graph, calendarID, date);
			CalendarHelper helper = new CalendarHelper(calendar, cse, date);
			helper.CalculateStartEndTime(out startDate, out endDate);
		}