Ejemplo n.º 1
0
 public static PlanRadio CreatePlanRadio(string name, Compaign compaign)
 {
     var planRadio = new PlanRadio() { Name = name, id = Guid.NewGuid() };
     if (compaign.PlanRadios == null) compaign.PlanRadios = new List<PlanRadio>();
     compaign.PlanRadios.Add(planRadio);
     return planRadio;
 }
Ejemplo n.º 2
0
        public frmEditCompagne(Compaign compaign, bool newCampaign, string caption)
        {
            InitializeComponent();
               // ribbonStatusBar.Ribbon = ribbonAnnonceur;
            //BBIView.Enabled = false;
            if (newCampaign)
            {
                //    BBIView.Enabled = false;
                //   BBISupp.Enabled = false;
                //   BBINext.Enabled = false;
                // BBIPrev.Enabled = false;
            }

            editionCampagnePresenter = new EditionCampagnePresenter(this, new VagueRepository(), new AnnonceurRepository(), new FilterRepository(), new PlanTvRepository(), new PlanRdRepository(), new PlanPrRepository());
            editionCampagnePresenter.Display();

            SLUAnnonceur.Properties.DataSource = Annonceurs;

            SLUCible.Properties.DataSource = Filters;

            SLUVague.Properties.DataSource = Vague;

            /* GCTele.DataSource = PlanTvs;
             GVTv.Columns[0].Visible = false;
             GCRadio.DataSource = PlanRds;
             GVRadio.Columns[0].Visible = false;
             GCPresse.DataSource = PlanPresses;
             GVPresse.Columns[0].Visible = false;
             */

            // DictionaryHelper.InitDictionary(spellChecker1);
            DialogResult = DialogResult.Cancel;
            sourceCompaign = compaign;
            _isCampaignModified = newCampaign;
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Gamer gamer = new Gamer
            {
                Id         = 1,
                FirstName  = "EBRU",
                LastName   = "MERD",
                BirthYear  = "2002",
                IdentityId = "123456"
            };

            Game game = new Game
            {
                Id        = 2,
                GameName  = "Valorant",
                GamePrice = 70
            };

            Compaign compaign = new Compaign
            {
                Id               = 3,
                CampaignName     = "3 al 1 öde",
                CampaignDiscount = 1
            };

            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(gamer);
            SalesManager salesManager = new SalesManager();

            salesManager.Add(gamer, game, compaign);
        }
Ejemplo n.º 4
0
 public static PlanTV CreatePlanTv(String name, Compaign compaign)
 {
     var planTv=new PlanTV() { Name = name, id = Guid.NewGuid() };
     if (compaign.PlanTvs == null) compaign.PlanTvs=new List<PlanTV>();
     compaign.PlanTvs.Add(planTv);
     return planTv;
 }
Ejemplo n.º 5
0
        public static Compaign CreateCompaign(Annonceur annonceur, TypeCompaign typeCompaign, Vague vague, Marque marque = null)
        {
            var comp= new Compaign(){Annonceur = annonceur,Marque = marque,id = Guid.NewGuid(),TypeCompaign = typeCompaign,Vague = vague};
            comp.Signalitiques = vague.Signalitique;

            return comp;
        }
Ejemplo n.º 6
0
        public int Register(Compaign campaign)
        {
            campaign.DateCreated = DateTime.Now;
            _SMContext.Compaigns.Add(campaign);
            var data = _SMContext.SaveChanges();

            return(data);
        }
Ejemplo n.º 7
0
        public static PlanPresse CreatePlanPresse(string name, Compaign compaign)
        {
            var planPresse = new PlanPresse() { Name = name, id = Guid.NewGuid()};
            if (compaign.PlanPresses == null) compaign.PlanPresses = new List<PlanPresse>();

            compaign.PlanPresses.Add(planPresse);
            return planPresse;
        }
Ejemplo n.º 8
0
 public ActionResult <int> Post([FromBody] Compaign compaign)
 {
     try
     {
         return(_IDeleteCampaign.Delete(compaign));
     }
     catch (Exception ex)
     {
         return(BadRequest("{\"error\":\"" + ex.Message + ""));
     }
 }
        public async Task <IActionResult> Create([Bind("Id,Name,Budget,Goal,CountryId,CategoryId,CreateDate")] Compaign compaign)
        {
            if (ModelState.IsValid)
            {
                if (compaign.CategoryId == null)
                {
                    try
                    {
                        HttpResponseMessage response = await client.GetAsync("https://ngkc0vhbrl.execute-api.eu-west-1.amazonaws.com/api/?url=https%3A%2F%2Farabic.cnn.com%2F&fbclid=IwAR3ArFDjdUo6yu8sWU0e-maw8livyF9LCO8BANQOr1j3Dihc5AkY-mYv94M");

                        response.EnsureSuccessStatusCode();
                        if (response.IsSuccessStatusCode)
                        {
                            var readTask = await response.Content.ReadAsAsync <Response>();

                            var itemsIsExist = await context.Category.Where(e => e.RelatedId == readTask.Category.Id).FirstOrDefaultAsync();

                            if (itemsIsExist == null)
                            {
                                var category = new CategoryCompaign
                                {
                                    RelatedId  = readTask.Category.Id,
                                    CreateDate = DateTime.UtcNow.ToUniversalTime(),
                                    Name       = readTask.Category.Name
                                };
                                context.Add(category);
                                await context.SaveChangesAsync();

                                compaign.CategoryId = category.Id;
                            }
                            else
                            {
                                compaign.CategoryId = itemsIsExist.Id;
                            }
                        }
                    }
                    catch (Exception)
                    {
                        return(Ok("error"));
                    }
                }
                var compains = await context.Compaign.Where(e => e.CategoryId == compaign.CategoryId && e.CountryId == compaign.CountryId).AnyAsync();

                if (compains)
                {
                    return(Ok("exist"));
                }
                context.Add(compaign);
                await context.SaveChangesAsync();

                return(Ok("success"));
            }
            return(Ok("error"));
        }
Ejemplo n.º 10
0
        public static PlanTV CreatePlanTv(String name, Compaign compaign)
        {
            var planTv = new PlanTV()
            {
                Name = name, id = new Guid()
            };

            if (compaign.PlanTvs == null)
            {
                compaign.PlanTvs = new List <PlanTV>();
            }
            compaign.PlanTvs.Add(planTv);
            return(planTv);
        }
Ejemplo n.º 11
0
        public static PlanRadio CreatePlanRadio(string name, Compaign compaign)
        {
            var planRadio = new PlanRadio()
            {
                Name = name, id = new Guid()
            };

            if (compaign.PlanRadios == null)
            {
                compaign.PlanRadios = new List <PlanRadio>();
            }
            compaign.PlanRadios.Add(planRadio);
            return(planRadio);
        }
Ejemplo n.º 12
0
        public static PlanPresse  CreatePlanPresse(string name, Compaign compaign)
        {
            var planPresse = new PlanPresse()
            {
                Name = name, id = new Guid()
            };

            if (compaign.PlanPresses == null)
            {
                compaign.PlanPresses = new List <PlanPresse>();
            }
            compaign.PlanPresses.Add(planPresse);
            return(planPresse);
        }
Ejemplo n.º 13
0
 public static Compaign MapCampaign(XpoCompaign xpoCompaign)
 {
     var campagne = new Compaign
         {
             id = xpoCompaign.Oid,
             Vague = MapVague(xpoCompaign.Vague),
             Annonceur = MapAnnonceur(xpoCompaign.Annonceur),
             Marque = MapMarque(xpoCompaign.Marque)
         };
     campagne.Filtre = MapFilter(xpoCompaign.Filter);
     campagne.PlanPresses = MapPlanPresse(xpoCompaign.PlanPresses);
     //campagne.PlanRadios = MapPlanRd(xpoCompaign.PlanRadios);
     //campagne.PlanTvs = MapPlanTv(xpoCompaign.PlanTvs);
     return null;
 }
Ejemplo n.º 14
0
        public int Delete(Compaign campaign)
        {
            var item = _SMContext.Compaigns.Where(x => x.IdCompaign == campaign.IdCompaign).FirstOrDefault();

            if (item != null)
            {
                item.Status = false;
                _SMContext.Compaigns.Update(item);
                var data = _SMContext.SaveChanges();
                return(data);
            }
            else
            {
                return(0);
            }
        }
        public void Test1()
        {
            CreateService();

            var compaing = new Compaign
            {
                IdUser             = "******",
                NumberOfRecipients = 2,
                Status             = true,
                Subject            = "Asunto",
                DateCreated        = DateTime.Now
            };

            var value = _ICampaign.Register(compaing);

            Assert.True(value > 0, "The value greater than 0");
        }
Ejemplo n.º 16
0
        public frmEditCompagne(Compaign compaign, bool newCampaign, string caption)
        {
            InitializeComponent();
            if (newCampaign)
            {
                //    BBIView.Enabled = false;
                //   BBISupp.Enabled = false;
                //   BBINext.Enabled = false;
                // BBIPrev.Enabled = false;
            }

            editionCampagnePresenter = new EditionCampagnePresenter(this, new VagueRepository(), new AnnonceurRepository(), new FilterRepository(), new PlanTvRepository(), new PlanRdRepository(), new PlanPrRepository());
            editionCampagnePresenter.Display();
            SLUAnnonceur.Properties.DataSource = Annonceurs;
            var b = SLUAnnonceur.EditValue;
            if (!Annonceurs.Any() || Annonceurs == null || SLUAnnonceur.EditValue == null) SLUMarque.Properties.DataSource = new List<Marque>();
            else
            {
                var listeMarques = Annonceurs.First(a => a.id.ToString() == SLUAnnonceur.EditValue).Marques;
                SLUMarque.Properties.DataSource = listeMarques.Any() ? listeMarques : new List<Marque>();
            }
            SLUCible.Properties.DataSource = Filters;

            SLUVague.Properties.DataSource = Vague;

            /* GCTele.DataSource = PlanTvs;
             GVTv.Columns[0].Visible = false;
             GCRadio.DataSource = PlanRds;
             GVRadio.Columns[0].Visible = false;
             GCPresse.DataSource = PlanPresses;
             GVPresse.Columns[0].Visible = false;
             */

            // DictionaryHelper.InitDictionary(spellChecker1);
            DialogResult = DialogResult.Cancel;
            sourceCompaign = compaign;
            _isCampaignModified = newCampaign;
        }
Ejemplo n.º 17
0
 public void Add(Gamer gamer, Game game, Compaign compaign)
 {
     Console.WriteLine("'{0}' oyuncu eklendi. '{1}' oyun eklendi. '{2}' kampanya eklendi. ", gamer.FirstName, game.GameName, compaign.CampaignName);
 }
Ejemplo n.º 18
0
 public void Delete(Gamer gamer, Game game, Compaign compaign)
 {
     Console.WriteLine("'{0}' oyuncu silindi. '{1}' oyun silindi. '{2}' kampanya silindi. ", gamer.FirstName, game.GameName, compaign.CampaignName);
 }
Ejemplo n.º 19
0
        public static object MapCompaign(Compaign entity, UnitOfWork uow)
        {
            var compagne = new XpoCompaign(uow);
            compagne.Annonceur = MapAnnonceur(entity.Annonceur,uow);
            compagne.Marque = MapMarque(entity.Marque,uow);
            compagne.Oid = entity.id;
            compagne.Filter = MapFiltre(entity.Filtre,uow);
            /*foreach (var planPresse in entity.PlanPresses)
            {
                compagne.PlanPresses.Add(MapPlanPresse(planPresse,uow));
            }

            foreach (var planTv in entity.PlanTvs)
            {
                compagne.PlanTvs.Add(MapplanTv(planTv, uow));
            }

            foreach (var planRadio in entity.PlanRadios)
            {
                compagne.PlanRadios.Add(MapplanRadio(planRadio, uow));
            }*/
            return compagne;
        }
Ejemplo n.º 20
0
 public static Compaign CreateCompaign(Annonceur annonceur, TypeCompaign typeCompaign, Filter filtre, Vague vague, Marque marque = null)
 {
     var comp= new Compaign() { Annonceur = annonceur, Marque = marque, id = Guid.NewGuid(), TypeCompaign = typeCompaign,Filtre = filtre,Vague = vague};
     comp.Signalitiques = (comp.GetSignalitique()).ToList();
     return comp;
 }
Ejemplo n.º 21
0
 public void ApplyCompaign(Compaign compaign, Game game)
 {
     _gamePrice  = game.Price;
     game.Price -= game.Price * (compaign.Discount / 100);
     Console.WriteLine(game.Name + " oyunu " + _gamePrice + " yerine " + game.Price + " TL");
 }
Ejemplo n.º 22
0
        static void Main(string[] args)
        {
            //Oyuncu Ekleme
            IGamerService      gamerService      = new GamerManager(new GamerCheckManager());
            IGamerCheckService gamerCheckService = new GamerCheckManager();
            Gamer gamer1 = new Gamer()
            {
                Id            = 1,
                FirstName     = "Melike",
                LastName      = "Işık",
                BirthYear     = 1996,
                NationalityId = "12345678910"
            };
            Gamer gamer2 = new Gamer()
            {
                Id            = 2,
                FirstName     = "Müge",
                LastName      = "Işık",
                BirthYear     = 2000,
                NationalityId = "12345678910"
            };

            gamerService.Add(gamer1);
            gamerService.Add(gamer2);


            gamerService.Delete(gamer1);  //Oyuncu Silme
            gamer2.FirstName = "Nimet Müge";
            gamerService.Update(gamer2);

            IGameService gameService = new GameManager();
            Game         game1       = new Game()
            {
                Id          = 1,
                Name        = "Grand Theft Auto 5",
                Price       = 152.10,
                Detail      = "Grand Theft Auto serisinin beşinci oyunudur. Tüm GTAV hikayesi, GTA Online ve mevcut içerik ve yükseltmelerin tümünün yanı sıra GTA Online’da kendi suç imparatorluğunu kurmanın en kısa yolu Criminal Enterprise Başlangıç Paketi de bulunuyor.",
                UnitInStock = 1,
            };

            Game game2 = new Game()
            {
                Id          = 2,
                Name        = "The Sims 4",
                Price       = 265,
                Detail      = "The Sims 4, serinin önceki oyunları gibi yaşam simülasyonu oyunudur. Oyuncular bir Sim karakteri yaratırlar ve oyunda farklı Sim kişiliklerini keşfederek oyuna yön verirler. Simler daha önceki oyunlardan farklı olarak aynı anda iki fiziksel eylemi gerçekleştirebilir. Ayrıca Simlerin modları da oyun akışını değiştirebilir. Örneğin kızgın ya da heyecanlı bir Sim, verilen bir görevi daha hızlı yapar.",
                UnitInStock = 2,
            };

            //Kampanya ekleme

            ICompaignService compaignService = new CompaignManager();
            Compaign         compaign1       = new Compaign()
            {
                Id       = 1,
                Name     = "Black Friday Compaign",
                Discount = 10,
            };

            Compaign compaign2 = new Compaign()
            {
                Id       = 2,
                Name     = "Happy New Year Compaign",
                Discount = 20,
            };

            compaignService.Add(compaign1);
            compaignService.Add(compaign2);

            gameService.ApplyCompaign(compaign1, game1);
            gameService.ApplyCompaign(compaign1, game2);

            gameService.SellGame(game1, gamer2);
            gameService.SellGame(game2, gamer2);
            gameService.SellGame(game1, gamer1);
        }
Ejemplo n.º 23
0
 public void Delete(Compaign compaign)
 {
     Console.WriteLine("kampanya silindi..");
 }
Ejemplo n.º 24
0
 void CreateNewCampagne()
 {
     var campagne = new Compaign();
     //message.MailType = MailType.Draft;
     EditMessage(campagne, true, null);
 }
Ejemplo n.º 25
0
 public void GameBuy(Product product, Compaign compaign, Player player)
 {
     product.Price = product.Price - (product.Price * compaign.CampaignRatio);
     Console.WriteLine(player.Ad + " adlı oyuncu " + product.Price + "Tl'ye " + product.Name + " isimli oyunu satın aldı");
 }
Ejemplo n.º 26
0
 public void Add(Compaign compaign)
 {
     Console.WriteLine("kampanya eklendi..");
 }
Ejemplo n.º 27
0
 public void Update(Compaign compaign)
 {
     Console.WriteLine(compaign.Name + "  güncellendi.");
 }
Ejemplo n.º 28
0
 public void Delete(Compaign compaign)
 {
     Console.WriteLine(compaign.Name + "  sistemden silindi.");
 }
Ejemplo n.º 29
0
 public void WriteChanges(Compaign compaign)
 {
     campagneRepository.Save(compaign);
 }
Ejemplo n.º 30
0
 public void Update(Gamer gamer, Game game, Compaign compaign)
 {
     Console.WriteLine("'{0}' oyuncu güncellendi. '{1}' oyun güncellendi. '{2}' kampanya güncellendi. ", gamer.FirstName, game.GameName, compaign.CampaignName);
 }
Ejemplo n.º 31
0
 public void Update(Compaign compaign)
 {
     Console.WriteLine("kampanya güncellendi..");
 }
Ejemplo n.º 32
0
 public void CompaigUpdate(Compaign compaign)
 {
     Console.WriteLine(compaign.CampaignName + " Adlı Kampanya Güncellendi");
 }
Ejemplo n.º 33
0
 public void CompaignDeleted(Compaign compaign)
 {
     Console.WriteLine(compaign.CampaignName + " Adlı Kampanya Silindi");
 }
Ejemplo n.º 34
0
 public void CompaignAdd(Compaign compaign)
 {
     Console.WriteLine(compaign.CampaignName + " Adlı Kampanya Basladı");
 }
Ejemplo n.º 35
0
 public void Add(Compaign compaign)
 {
     Console.WriteLine(compaign.Name + "  sisteme eklendi.");
 }
Ejemplo n.º 36
0
 void EditMessage(Compaign campagne, bool newMessage, string caption)
 {
     Cursor.Current = Cursors.WaitCursor;
        var form = new frmEditCompagne(campagne, newMessage, caption);
     //form.Load += OnEditMailFormLoad;
     //form.FormClosed += OnEditMailFormClosed;
     form.Location = new Point(OwnerForm.Left + (OwnerForm.Width - form.Width) / 2, OwnerForm.Top + (OwnerForm.Height - form.Height) / 2);
     form.Show();
     Cursor.Current = Cursors.Default;
 }
Ejemplo n.º 37
0
        static void Main(string[] args)
        {
            Player player = new Player()
            {
                TcNo  = "221412",
                Ad    = "Kağan",
                Soyad = "COŞAR"
            };

            Player player2 = new Player()
            {
                TcNo  = "221412",
                Ad    = "Hatice",
                Soyad = "COŞAR"
            };

            PlayerManager playerManager = new PlayerManager();

            playerManager.Add(player);
            playerManager.Update(player2);
            playerManager.Delete(player);

            Console.WriteLine("*************");

            IUsersService[] usersService = new IUsersService[2] {
                new MySqlUserService(), new OracleUserService()
            };
            ILoggerService[] loggersService = new ILoggerService[2] {
                new MySqlUserService(), new OracleUserService()
            };

            foreach (var item in usersService)
            {
                item.CheckUser();
            }

            foreach (var item in loggersService)
            {
                item.LoggerService();
            }

            Console.WriteLine("**********");

            Compaign compaign1 = new Compaign();

            compaign1.CampaignType = "İndirim";
            compaign1.CampaignName = "Black Friday";

            Compaign compaign2 = new Compaign();

            compaign2.CampaignType = "İndirim";
            compaign2.CampaignName = "Şahane Aralık";

            ////Compaign[] compoigns = new Compaign[2] { compaign1, compaign2 };
            List <Compaign> compoigns = new List <Compaign>()
            {
                compaign1, compaign2
            };

            var compaignmanager = new CompaignManager();

            foreach (var item in compoigns)
            {
                compaignmanager.CompaignAdd(item);
                compaignmanager.CompaignDeleted(item);
                compaignmanager.CompaigUpdate(item);
            }

            Console.WriteLine("*********");

            Product product1 = new Product();

            product1.Name  = "Valaront";
            product1.Price = 200;

            Product product2 = new Product()
            {
                Name = "Cs Go", Price = 77
            };

            GameManager gameManager = new GameManager();

            gameManager.GameBuy(product1, compaign1, player);
            gameManager.GameBuy(product2, compaign2, player2);
        }