private void InsertAntivirus()
 {
     string antiVirus = this.software.GetAntiVirusAndProducer().Item1;
     string antiVirusProducer = this.software.GetAntiVirusAndProducer().Item2;
     CustomComputersAspEntities db = new CustomComputersAspEntities();
     var match = db.Softwares.FirstOrDefault(s => s.name == antiVirus && s.producer == antiVirusProducer && s.configId == this.configId);
     if (match == null)
     {
         db.AddToSoftwares(new Software()
         {
             name = antiVirus,
             producer = antiVirusProducer,
             type = "antiVirus",
             configId = this.configId
         });
         db.SaveChanges();
     }
 }
Exemple #2
0
        private void InsertOther()
        {
            string other                  = this.software.GetOther().Item1;
            string otherProducer          = this.software.GetOther().Item2;
            CustomComputersAspEntities db = new CustomComputersAspEntities();
            var match = db.Softwares.FirstOrDefault(s => s.name == other && s.producer == otherProducer && s.configId == this.configId);

            if (match == null)
            {
                db.AddToSoftwares(new Software()
                {
                    name     = other,
                    producer = otherProducer,
                    type     = "other",
                    configId = this.configId
                });
                db.SaveChanges();
            }
        }
Exemple #3
0
        private void InsertAntivirus()
        {
            string antiVirus              = this.software.GetAntiVirusAndProducer().Item1;
            string antiVirusProducer      = this.software.GetAntiVirusAndProducer().Item2;
            CustomComputersAspEntities db = new CustomComputersAspEntities();
            var match = db.Softwares.FirstOrDefault(s => s.name == antiVirus && s.producer == antiVirusProducer && s.configId == this.configId);

            if (match == null)
            {
                db.AddToSoftwares(new Software()
                {
                    name     = antiVirus,
                    producer = antiVirusProducer,
                    type     = "antiVirus",
                    configId = this.configId
                });
                db.SaveChanges();
            }
        }
 private void InsertGame(int gameNumber)
 {
     int newGameNumber = gameNumber - 1;
     string game = this.software.GetGameAndProducer(newGameNumber).Item1;
     string gameProducer = this.software.GetGameAndProducer(newGameNumber).Item2;
     CustomComputersAspEntities db = new CustomComputersAspEntities();
     var match = db.Softwares.FirstOrDefault(s => s.name == game && s.producer == gameProducer && s.configId == this.configId);
     if(match == null)
     {
         db.AddToSoftwares(new Software()
         {
             name = game,
             producer = gameProducer,
             type = "game",
             configId = this.configId
         });
     db.SaveChanges();
     }
 }
Exemple #5
0
        private void InsertGame(int gameNumber)
        {
            int    newGameNumber          = gameNumber - 1;
            string game                   = this.software.GetGameAndProducer(newGameNumber).Item1;
            string gameProducer           = this.software.GetGameAndProducer(newGameNumber).Item2;
            CustomComputersAspEntities db = new CustomComputersAspEntities();
            var match = db.Softwares.FirstOrDefault(s => s.name == game && s.producer == gameProducer && s.configId == this.configId);

            if (match == null)
            {
                db.AddToSoftwares(new Software()
                {
                    name     = game,
                    producer = gameProducer,
                    type     = "game",
                    configId = this.configId
                });
                db.SaveChanges();
            }
        }
 private void InsertOther()
 {
     string other = this.software.GetOther().Item1;
     string otherProducer = this.software.GetOther().Item2;
     CustomComputersAspEntities db = new CustomComputersAspEntities();
     var match = db.Softwares.FirstOrDefault(s => s.name == other && s.producer == otherProducer && s.configId == this.configId);
     if (match == null)
     {
         db.AddToSoftwares(new Software()
         {
             name = other,
             producer = otherProducer,
             type = "other",
             configId = this.configId
         });
         db.SaveChanges();
     }
 }