Esempio n. 1
0
        /**
         * Method to set customer tender hours for a given day.
         */
        public SettingsPage SetTenderHours(string dayOfWeek, string startTime, string endTime)
        {
            TenderHoursTable tenderHoursTable = new TenderHoursTable()
                                                .SetTenderHours(dayOfWeek, startTime, endTime);

            return(this);
        }
Esempio n. 2
0
        /**
         * Method to set random customer tender hours for a week. Always sets current day to open.
         */
        public SettingsPage SetRandomTenderHours()
        {
            Random           rnd              = new Random();
            string           startTime        = rnd.Next(4, 10).ToString().PadLeft(2, '0') + ":" + rnd.Next(1, 59).ToString().PadLeft(2, '0');
            string           endTime          = rnd.Next(13, 23).ToString() + ":" + rnd.Next(1, 59).ToString().PadLeft(2, '0');
            string           today            = GetDayOfWeek();
            TenderHoursTable tenderHoursTable = new TenderHoursTable();

            foreach (string dayOfWeek in GetDaysOfWeek())
            {
                bool isOpen = (rnd.Next(100) < 50);
                if (today.Equals(dayOfWeek) || isOpen)
                {
                    tenderHoursTable.SetTenderHours(dayOfWeek, startTime, endTime);
                }
                else
                {
                    tenderHoursTable.SetClosed(dayOfWeek);
                }
            }
            return(this);
        }