Ejemplo n.º 1
0
        public static void ChooseAuction(DatabaseOfAuctions auctions, DatabaseOfUsers users)
        {
            Console.WriteLine("Wybierz numer aukcji");
            int i = int.Parse(Console.ReadLine());

            foreach (AuctionBuilder auction in auctions.getListOfAuction())
            {
                Console.WriteLine(auction);
            }

            AuctionBuilder actuallAuction = auctions.getAuction(i);
            User           winningUser    = new User();

            foreach (User user in users.GetListOfUsers())
            {
                Console.WriteLine("Kolej na " + user.FirstName + "\n");
                actuallAuction.CheckPointsOfTrust(user, actuallAuction, winningUser);
            }
            actuallAuction.NextTour(actuallAuction, winningUser);
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            bool x     = true;
            int  i     = 0;
            User user  = new User("Pawel", "Dering", "Kolejarz", "*****@*****.**", 22);
            User user1 = new User("Mateusz", "Mazalon", "Mati", "*****@*****.**", 0);
            User user2 = new User("Marcin", "Stencel", "L3N", "*****@*****.**", 13);
            User user3 = new User("Piotr", "Brzeski", "Piord", "*****@*****.**", 11);
            User user4 = new User("Emilia", "Roszmann", "Emi", "*****@*****.**", 2);


            DatabaseOfUsers users = new DatabaseOfUsers();

            users.AddUser(user);
            users.AddUser(user1);
            users.AddUser(user2);
            users.AddUser(user3);
            users.AddUser(user4);

            int userNumber = 0;

            foreach (User allUser in users.GetListOfUsers())
            {
                Console.WriteLine(userNumber + ". " + allUser);
                userNumber++;
            }
            Console.WriteLine("Witam W Systemie aukcyjnym "
                              + "\n Wybierz numer użytkownika");
            i = int.Parse(Console.ReadLine());
            User actuallUser            = users.GetUser(i);
            DatabaseOfAuctions auctions = new DatabaseOfAuctions();

            do
            {
                Console.WriteLine("Witaj " + actuallUser.FirstName + ". Wybierz Operacje");
                Console.WriteLine("1.Tworzenie nowej aukcji" + "\n"
                                  + "2.Wybór aukcji z bazy" + "\n"
                                  + "3.Filtrowanie Aukcji" + "\n"
                                  + "4.Zmiana użytkownika" + "\n"
                                  + "5.Dodaj/odejmnij punkty zaufania" + "\n"
                                  + "6.Wyjście z programu");
                i = int.Parse(Console.ReadLine());

                switch (i)
                {
                case 1:

                    MenuCreateAuction.CreateAuction(actuallUser, auctions);
                    break;

                case 2:
                    MenuAuctionOperation.ChooseAuction(auctions, users);
                    break;

                case 3:
                    MenuFilterAuction.FilterPick(auctions, users);
                    break;

                case 4:
                    MenuChangeUser.ChangeUser(users, out actuallUser);
                    break;

                case 5:
                    MenuPointOfTrustOperation.PointOfTrust(actuallUser, users);
                    break;

                case 6:
                    x = false;
                    break;
                }
            }while (x);
            Console.WriteLine("Program zakończył działanie");
        }