Ejemplo n.º 1
0
        private List <Tester> GetAvailableTestersByDateTime()
        {
            if (GetTestDateAndTime() == null || GetTestDateAndTime() == new DateTime())
            {
                return(TestersList);
            }

            DateTime testDateTime = GetTestDateAndTime();

            var result = from tester in TestersList
                         where BlValidations.IsTesterFreeForTest(tester, testDateTime) == true
                         select tester;

            return(result.ToList());
        }
Ejemplo n.º 2
0
        private void ValidateTestDate()
        {
            if (testDateDp.Validator == null)
            {
                return;
            }

            Tester tester = GetTesterById(GetTesterId());

            testDateDp.Validator.Visibility = Visibility.Visible;

            if (tester == null)
            {
                testDateDp.Validator.Validate(false);
                testDateDp.Validator.ToolTip = "You must enter a tester Id first";
                return;
            }

            DateTime date = GetTestDateAndTime();

            if (testDateDp.SelectedDate == null)
            {
                testDateDp.Validator.Validate(false);
                testDateDp.Validator.ToolTip = "You must select a date for the test";
            }
            else if (BlValidations.IsTesterFreeForTest(tester, date) == false)
            {
                testDateDp.Validator.Validate(false);
                testDateDp.Validator.ToolTip = "Tester with Id " + GetTesterId() + " is not free at this date and time";
            }
            else
            {
                testDateDp.Validator.ToolTip = "Good";
                testDateDp.Validator.Validate(true);
            }

            ValidateValidators();
        }