コード例 #1
0
        public static bool IsWorkDay(PXGraph graph, string CalendarID, DateTime Date)
        {
            PXResult <CSCalendar, CSCalendarExceptions> result =
                (PXResult <CSCalendar, CSCalendarExceptions>)
                PXSelectJoin <
                    CSCalendar
                    , LeftJoin <CSCalendarExceptions
                                , On <CSCalendarExceptions.calendarID, Equal <CSCalendar.calendarID>, And <CSCalendarExceptions.date, Equal <Required <CSCalendarExceptions.date> > > >
                                >
                    , Where <CSCalendar.calendarID, Equal <Required <CSCalendar.calendarID> > >
                    > .SelectWindowed(graph, 0, 1, Date, CalendarID);

            if (result != null)
            {
                CSCalendar           calendar = result;
                CSCalendarExceptions exc      = result;
                if (exc.Date != null)
                {
                    return(exc.WorkDay == true);
                }
                else
                {
                    return(calendar.IsWorkDay(Date));
                }
            }
            return(true);
        }
コード例 #2
0
        public static bool IsWorkDay(PXGraph graph, string calendarID, DateTime date)
        {
            var select = SelectCalendar(graph, calendarID, date);

            if (select == null)
            {
                return(true);
            }

            CSCalendar           calendar = select;
            CSCalendarExceptions exc      = select;

            var result = exc.Date.HasValue ? exc.WorkDay == true : calendar.IsWorkDay(date);

            return(result);
        }