Esempio n. 1
0
 public bool Allow(Card card)
 {
     if (DataBase.Check(card.ID.ToString()))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Building dvoyka = new Building("Кремлёвская 35", new Tourniquet());
            Student petya = new Student("Петя");
            Card card = new Card(1, petya.Name);

            if (petya.EnterBuilding(dvoyka, card))
            {
                Console.WriteLine("{0} успешно ушёл вошёл в здание по адресу: {1}", petya.Name, dvoyka.Address);
            }
            else
            {
                Console.WriteLine("{0} не смог войти в здание по адресу: {1}", petya.Name, dvoyka.Address);
            }
        }
Esempio n. 3
0
 public bool EnterBuilding(Building building, Card card)
 {
     return UseCard(card, building.Tourniquet);
 }
Esempio n. 4
0
 public bool UseCard(Card card, Tourniquet tourniquet)
 {
     return tourniquet.Allow(card);
 }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Building uv = new Building("Universiade Village", new Tourniquet());
            Student student1 = new Student("Alsy");
            Card card1 = new Card(1, student1.Name);
            Student student2 = new Student("Andrey");
            Card card2 = new Card(2, student2.Name);

            student1.Print(uv, card1);
            student2.Print(uv, card2);

            Console.ReadLine();
        }
Esempio n. 6
0
 public bool Allow(Card card)
 {
     if (DataBase.Check(card.ID))
         return true;
     else
         return false;
 }
Esempio n. 7
0
 public void Print(Building building, Card card)
 {
     if (Enter(building, card))
     {
         Console.WriteLine(Name + " yспешно вошёл в здание по адресу: " + building.Address);
     }
     else
     {
         Console.WriteLine(Name + " не смогла войти в здание по адресу: " + building.Address);
     }
 }
Esempio n. 8
0
 public void VerifyCard(Card card)
 {
     if (card.ID % 2 != 0) {
         _state = true;
         _onGoodCard();
     } else {
         _state = false;
         _onBadCard();
     }
 }
Esempio n. 9
0
 public Student(string name)
 {
     _name = name;
     _card = new Card();
 }