Beispiel #1
0
        static void Main(string[] args)
        {
            PlayersDB player1 = new PlayersDB();

            player1.Adi    = "Burak";
            player1.Soyadi = "Elmas";
            player1.TcNo   = "11239058561";
            player1.DYili  = "1995";

            PlayersDB player2 = new PlayersDB();

            player2.Adi    = "Ahmet";
            player2.Soyadi = "Sevinç";
            player2.TcNo   = "11232658561";
            player2.DYili  = "1975";

            PlayersDB player3 = new PlayersDB();

            player3.Adi    = "Seda";
            player3.Soyadi = "Pınar";
            player3.TcNo   = "1123265851";
            player3.DYili  = "1995";

            MemberManager memberManager = new MemberManager();

            Console.WriteLine("--Üye İşlemleri--");
            Console.WriteLine(" ");
            memberManager.Add(player1);
            memberManager.Add(player3);
            memberManager.Delete(player2);
            memberManager.Update(player1);

            CampaignsDB campaign1 = new CampaignsDB();

            campaign1.CampaignId = 1;
            campaign1.Adi        = "Yılbaşı";
            campaign1.SonGunu    = "5 Ocak 2021";

            CampaignsDB campaign2 = new CampaignsDB();

            campaign2.CampaignId = 2;
            campaign2.Adi        = "Muhteşem Cuma";
            campaign2.SonGunu    = "15 Mart 2021";

            CampaignsDB campaign3 = new CampaignsDB();

            campaign3.CampaignId = 3;
            campaign3.Adi        = "Şahane Ocak";
            campaign3.SonGunu    = "30 Ocak 2021";

            CampaignManager campaignManager = new CampaignManager();

            Console.WriteLine(" ");
            Console.WriteLine("--Kampanya İşlemleri--");
            Console.WriteLine(" ");
            campaignManager.Add(campaign1);
            campaignManager.Delete(campaign2);
            campaignManager.Update(campaign3);

            GameDB game1 = new GameDB();

            game1.GameId     = 678;
            game1.OyunAdi    = "Call Of Duty";
            game1.Fiyat      = "400";
            game1.CampaignId = 2;

            GameDB game2 = new GameDB();

            game2.GameId     = 452;
            game2.OyunAdi    = "Civilizations 5";
            game2.Fiyat      = "80";
            game2.CampaignId = 1;

            GameManager gameManager = new GameManager();

            Console.WriteLine(" ");
            Console.WriteLine("--Oyun İşlemleri--");
            Console.WriteLine(" ");
            gameManager.Add(game1);
            gameManager.Delete(game2);
            gameManager.Update(game1);

            SalesManager salesManager = new SalesManager();

            Console.WriteLine(" ");
            Console.WriteLine("--Satış İşlemleri--");
            Console.WriteLine(" ");
            salesManager.Sales(player1, game1);
            salesManager.SalesCancel(player2, game2);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Member member1 = new Member();

            member1.Id          = 1;
            member1.TcNo        = "11111111111";
            member1.FirstName   = "Ali";
            member1.LastName    = "Can";
            member1.DateOfBirth = new DateTime(1996, 10, 2);

            Member member2 = new Member()
            {
                Id          = 2, TcNo = "2222222222",
                FirstName   = "Mehmet",
                LastName    = "Can",
                DateOfBirth = new DateTime(1999, 10, 29)
            };

            MemberManager memberManager = new MemberManager(new MernisServiceAdapter());

            Console.WriteLine("MemberManager");
            memberManager.Add(member1);
            memberManager.Delete(member1);
            memberManager.Update(member1);
            Console.WriteLine("------------------------------------");

            SteamMemberManager steamMemberManager = new SteamMemberManager(new MernisServiceAdapter());

            Console.WriteLine("SteamMemberManager");
            steamMemberManager.Add(member2);
            steamMemberManager.Delete(member2);
            steamMemberManager.Update(member2);
            Console.WriteLine("------------------------------------");

            EpicMemberManager epicMemberManager = new EpicMemberManager(new MernisServiceAdapter());

            Console.WriteLine("EpicMemberManager");
            epicMemberManager.Add(member2);
            epicMemberManager.Delete(member2);
            epicMemberManager.Update(member2);
            Console.WriteLine("------------------------------------");


            Game game1 = new Game()
            {
                Id = 1, GameName = "ETS2", Price = 38
            };
            GameManager gameManager = new GameManager();

            gameManager.Add(game1);
            gameManager.Delete(game1);
            gameManager.Update(game1);

            Campaign campaign1 = new Campaign()
            {
                Id = 1, CampaignName = "Yıl Başı", CampaignType = "İndirim"
            };
            CampaignManager campaignManager = new CampaignManager();

            campaignManager.Add(campaign1);
            campaignManager.Delete(campaign1);
            campaignManager.Update(campaign1);

            OrderManager orderManager = new OrderManager();

            //Kampanyasız
            orderManager.Sale(member1, game1);
            //Kampanyalı
            orderManager.Sale(member2, game1, campaign1);
        }