Esempio n. 1
0
 public void ValidateIsAfter(string earlierDescription, DateTime earlierDate, ref DateTimeErrorString returnErrors)
 {
     if (returnErrors.DateError == null)
     {
         if (Date.HasValue)
         {
             if (earlierDate.Date > Date)
             {
                 returnErrors.DateError = string.Format(Strings.DateTime_Error_Date_MustComeAfter, earlierDescription);
             }
             else if (earlierDate > DateAndTime)
             {
                 returnErrors.TimeError = string.Format(Strings.DateTime_Error_Time_MustComeAfter, earlierDescription);
             }
             if (Time == null)
             {
                 returnErrors.SetTimeRequired();
             }
         }
         else if (Time.HasValue)
         {
             returnErrors.DateError = Strings.DateTime_Error_DateEmpty;
         }
     }
 }
Esempio n. 2
0
 public void ValidateIsBefore(string laterDescription, DateTime laterDate, ref DateTimeErrorString returnErrors)
 {
     if (returnErrors.DateError == null)
     {
         if (Date.HasValue)
         {
             if (laterDate < Date)
             {
                 returnErrors.DateError = string.Format(Strings.DateTime_Error_Date_MustComeBefore, laterDescription);
             }
             else if (laterDate < DateAndTime)
             {
                 returnErrors.TimeError = string.Format(Strings.DateTime_Error_Time_MustComeBefore, laterDescription);
             }
             if (Time == null)
             {
                 returnErrors.SetTimeRequired();
             }
         }
         else if (Time.HasValue)
         {
             returnErrors.DateError = Strings.DateTime_Error_DateEmpty;
         }
     }
 }
Esempio n. 3
0
        public DateTimeErrorString ValidateNotEmpty()
        {
            var returnErrors = new DateTimeErrorString();

            if (Date == null)
            {
                returnErrors.DateError = Strings.DateTime_Error_Date_DateTimeEmpty;
            }
            if (Time == null)
            {
                returnErrors.SetTimeRequired();
            }
            return(returnErrors);
        }