Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (_phone != null ? _phone.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DriverIdNum != null ? DriverIdNum.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (_name != null ? _name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)_status;
         hashCode = (hashCode * 397) ^ (int)GenderType;
         hashCode = (hashCode * 397) ^ (AbonementCurent != null ? AbonementCurent.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (string.IsNullOrEmpty(IdString) ? 0 : IdString.GetHashCode());
         hashCode = (hashCode * 397) ^ BirthDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (Passport != null ? Passport.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PathToPhoto != null ? PathToPhoto.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SpecialNotes != null ? SpecialNotes.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        //FIXME  Попробовать тут использовать не AbonementCurent, а _abonementCurent чтобы не вызывать лишний раз событие изменения абон

        public void StatusDirector()
        {
            if (Status == StatusPerson.Запрещён)
            {
                // AbonementCurent = null;
                return;
            }

            if (Status == StatusPerson.Гостевой)
            {
                _abonementCurent = AbonementController.GetInstance().GetFirstValid(Name);

                if (AbonementCurent == null)
                {
                    return;
                }
            }

            // Нет Карты
            if (AbonementCurent == null)
            {
                Status = StatusPerson.Нет_Карты;
            }
            else // Активный
            {
                var isValid = AbonementCurent.IsValid();
                if (isValid)
                {
                    Status = AbonementCurent.Freeze != null && AbonementCurent.Freeze.IsFreezedNow() ? StatusPerson.Заморожен : StatusPerson.Активный;
                }
                else
                {
                    Status          = StatusPerson.Нет_Карты;
                    AbonementCurent = null;
                }
            }
        }