public void SelectCurrentWeek(string nextSaturday)
        {
            PerformProtectedOperation(() =>
            {
                var p = new TimeCardPageDriver(_ie);

                StringCollection allWeekends = p.WeekEndingList.AllContents();

                p.WeekEndingList.SelectByValue(
                    allWeekends.Contains(nextSaturday) ? nextSaturday : allWeekends[allWeekends.Count - 1]);
            });
        }
        public void EnterHoursForDay(string hours, string dayOfWeek, DayEntry entry)
        {
            var p = new TimeCardPageDriver(_ie);

            p.Hours.TypeText(hours);
            p.WeekDateList.Select(dayOfWeek);
            p.EarningCodes.Select(entry.EarningCode);
            p.ContractLines.Select(entry.ContractLine);
            p.ContractNumbers.Select(entry.ContractNumber);
            p.ActivityIDs.Select(entry.ActivityID);
            p.ProjectIDs.Select(entry.ProjectID);
            p.SaveDetailsButton.Click();
        }
        public TimeCard GetTimeCard()
        {
            return(PerformProtectedOperation(new TimeCard(), () =>
            {
                var p = new TimeCardPageDriver(_ie);

                return new TimeCard
                {
                    CurrentWeek = p.WeekEndingList.SelectedValue,
                    WeekDays = p.WeekDateList.AllContents().Cast <string>().Where(s => !s.Contains("Select")).ToList(),
                    EarningCodes = p.EarningCodes.AllContents().Cast <string>().ToList(),
                    ContractLines = p.ContractLines.AllContents().Cast <string>().ToList(),
                    ContractNumbers = p.ContractNumbers.AllContents().Cast <string>().ToList(),
                    ActivityIDs = p.ActivityIDs.AllContents().Cast <string>().ToList(),
                    ProjectIDs = p.ProjectIDs.AllContents().Cast <string>().ToList()
                };
            }));
        }