Esempio n. 1
0
        protected override void Validate(HRPaidTimeOffDataContext db, ref ENTValidationErrors validationErrors)
        {
            if (HolidayName.Trim() == "")
            {
                validationErrors.Add("The name is required.");
            }

            if (HolidayDate == DateTime.MinValue)
            {
                validationErrors.Add("The date is required.");
            }
            else
            {
                if (new HolidayData().IsDuplicateHolidayDate(db, ID, HolidayDate))
                {
                    validationErrors.Add("The date must be unique.");
                }
            }
        }
Esempio n. 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (head_ != null)
            {
                hash ^= Head.GetHashCode();
            }
            if (HolidayName.Length != 0)
            {
                hash ^= HolidayName.GetHashCode();
            }
            if (StartDate.Length != 0)
            {
                hash ^= StartDate.GetHashCode();
            }
            if (EndDate.Length != 0)
            {
                hash ^= EndDate.GetHashCode();
            }
            return(hash);
        }