Ejemplo n.º 1
0
        //get office schedule so we know when the start and end time should be for the calender view
        //calender only shows the timers in which their is a reason to, ei: scheduled appointments, open/close time, special scheduling
        public void GetOfficeSchedule()
        {
            var os = new OfficeScheduleHelper();
            List <WeeklySchedule> weeklySchedule = os.GetScheduleData();

            StartTime = os.GetEarliestStartTime(weeklySchedule);
            EndTime   = os.GetLatestEndTime(weeklySchedule);
        }
Ejemplo n.º 2
0
        public void OfficeSchedule_InvalidEarliestTime_ReturnsAreNotEqual()
        {
            TimeSpan expectedEarliest            = new TimeSpan(9, 30, 0);
            List <WeeklySchedule> weeklySchedule = ScheduleMockData();
            var      os           = new OfficeScheduleHelper();
            TimeSpan earliestTime = os.GetEarliestStartTime(weeklySchedule);

            Assert.AreNotEqual(expectedEarliest, earliestTime);
        }
Ejemplo n.º 3
0
        public void OfficeSchedule_InvalidLatestTime_ReturnsAreNotEqual()
        {
            TimeSpan expectedLatest = new TimeSpan(16, 30, 0);
            List <WeeklySchedule> weeklySchedule = ScheduleMockData();
            var      os         = new OfficeScheduleHelper();
            TimeSpan latestTime = os.GetLatestEndTime(weeklySchedule);

            Assert.AreNotEqual(expectedLatest, latestTime);
        }
        //get the weekly schedule for the office
        public DataGridView GetOfficesWeeklySchedule()
        {
            var os             = new OfficeScheduleHelper();
            var weeklySchedule = os.GetScheduleData();

            //add the schedule to the calender and return the new data grid
            SetupOfficesWeeklySchedule(weeklySchedule);
            return(DataSchedule);
        }
Ejemplo n.º 5
0
        public Tuple <bool, TimeSpan, TimeSpan> SampleDataWeeklySchedule(DayOfWeek dayOfWeek)
        {
            var os = new OfficeScheduleHelper();
            List <WeeklySchedule> weeklySchedule = os.GetScheduleData();
            TimeSpan temp = new TimeSpan(0, 0, 0);

            foreach (var d in weeklySchedule)
            {
                if (d.Day == dayOfWeek.ToString())
                {
                    return(Tuple.Create(true, d.OpenTime, d.CloseTime));
                }
            }

            return(Tuple.Create(false, temp, temp));
        }