Esempio n. 1
0
 public Forestilling(Movie m, Tid t, BioSal s, Billet b)
 {
     _movies   = m;
     _times    = t;
     _sale     = s;
     _billeter = b;
 }
        public Billet CreateBilletByOrderId(Billet billet)
        {
            var result = this._context.Set <Billet>().Add(billet);

            this._context.SaveChanges();

            return(result);
        }
Esempio n. 3
0
        public ActionResult Bestilling(Billet innBillet)
        {
            var db = new DB();
            if (db.settInnBestilling(innBillet))
            {
                return RedirectToAction("Index");
            }

            return View();
        }
Esempio n. 4
0
        public void MCPrisUdenRabatØresundTest()
        {
            //arrange
            Billet minbillet = new Billet();
            //act
            int minint = minbillet.MCPrisUdenRabatØresund();

            //assert
            Assert.AreEqual(125, minint);
        }
Esempio n. 5
0
        public void MCBrobizTest()
        {
            //arrange
            Billet bil = new Billet();
            //act
            int minint = bil.MCBrobiz();

            //assert
            Assert.AreEqual(bil.MCBrobiz(), minint);
        }
Esempio n. 6
0
        public void BilPrisØresundTest()
        {
            //arrange
            Billet bil = new Billet();
            //act
            int minint = bil.BilPrisØresund();

            //assert
            Assert.AreEqual(bil.BilPrisØresund(), minint);
        }
Esempio n. 7
0
        public void BilPrisUdenRabatStorebæltTest()
        {
            //arrange
            Billet minbillet = new Billet();
            //act
            int minint = minbillet.BilPrisUdenRabatStorebælt();

            //assert
            Assert.AreEqual(240, minint);
        }
Esempio n. 8
0
        public void BilprisØresundBizzTest()
        {
            //Arrange
            Billet bil = new Billet();
            //Act
            int minint = bil.BilprisØresundBizz();

            //Assert
            Assert.AreEqual(bil.BilprisØresundBizz(), minint);
        }
Esempio n. 9
0
        public void MCPrisØresunBIzzTest()
        {
            //arrange
            Billet bil = new Billet();
            //act
            int minint = bil.MCPrisØresunBIzz();

            //assert
            Assert.AreEqual(bil.MCPrisØresunBIzz(), minint);
        }
Esempio n. 10
0
        public void MCØresundTest()
        {
            //Arrange
            Billet mc = new Billet();
            //Act
            int minint = mc.MCØresund();

            //Assert
            Assert.AreEqual(mc.MCØresund(), minint);
        }
Esempio n. 11
0
        public void MCBrobizTest()
        {
            //Arrange
            Billet mc = new Billet();
            //Act
            int minint = mc.MCBrobiz();

            //Assert
            Assert.AreEqual(mc.MCBrobiz(), minint);
        }
Esempio n. 12
0
        public void BilletPris()
        {
            //Arrange
            var billet = new Billet();

            //Act


            //Assert
            Assert.AreEqual(120, billet.PrisUdenRabat);
        }
Esempio n. 13
0
        public bool settInnBestilling(Billet bestiltBillet)
        {
            using (var db = new KundeContext())
            {
                var bestilling = new Bestilling()
                {
                    Antall   = bestiltBillet.antall,
                    ReiseFra = bestiltBillet.reiseFra,
                    ReiseTil = bestiltBillet.reiseTil,
                    Dato     = bestiltBillet.dato,
                    Tid      = bestiltBillet.tid,
                    Reisende = bestiltBillet.reisende
                };

                Kunde funnetKunde = db.Kunder.FirstOrDefault(k => k.Navn == bestiltBillet.navn);

                if (funnetKunde == null)
                {
                    // opprett kunden
                    var kunde = new Kunde
                    {
                        Navn      = bestiltBillet.navn,
                        Epost     = bestiltBillet.epost,
                        Telefonnr = bestiltBillet.telefonnr,
                    };
                    // legg bestillingen inn i kunden
                    kunde.Bestillinger = new List <Bestilling>();
                    kunde.Bestillinger.Add(bestilling);
                    try
                    {
                        db.Kunder.Add(kunde);
                        db.SaveChanges();
                        return(true);
                    }
                    catch (Exception)
                    {
                        return(false);
                    }
                }
                else
                {
                    try
                    {
                        funnetKunde.Bestillinger.Add(bestilling);
                        db.SaveChanges();
                        return(true);
                    }
                    catch (Exception)
                    {
                        return(false);
                    }
                }
            }
        }
Esempio n. 14
0
        public void BilletPrisWeekend()
        {
            //Arrange
            var billet = new Billet();

            //Act


            //Assert
            Assert.AreEqual(96, billet.Pris);
        }
Esempio n. 15
0
        public void BilletPrisMedBrobizz()
        {
            //Arrange
            var billet = new Billet {
                Brobizz = true
            };

            //Act


            //Assert
            Assert.AreEqual(114, billet.PrisMedKunBrobizzRabat);
        }
Esempio n. 16
0
        public void BilletPrisMedBrobizzWeekend()
        {
            //Arrange
            var billet = new Billet {
                Brobizz = true
            };

            //Act


            //Assert
            Assert.AreEqual(91.2, billet.Pris);
        }
        public dynamic Create([FromBody] Billet obj)
        {
            try
            {
                BoletoBancario bb = new BoletoBancario();
                bb.CodigoBanco = obj.BankCode;

                Cedente c = new Cedente(obj.Assignor.DocumentNumber, obj.Assignor.Name, obj.Assignor.Agency, obj.Assignor.AccountBank);
                Boleto  b = new Boleto(DateTime.Parse(obj.DueDate), obj.Value, obj.WalletNumber, "01000000001", c);

                b.NumeroDocumento = obj.DocumentNumber;

                b.Sacado = new Sacado(obj.Payer.Document, obj.Payer.Name);
                b.Sacado.Endereco.End    = obj.Payer.Address;
                b.Sacado.Endereco.Bairro = obj.Payer.District;
                b.Sacado.Endereco.Cidade = obj.Payer.City;
                b.Sacado.Endereco.CEP    = obj.Payer.Cep;
                b.Sacado.Endereco.UF     = obj.Payer.State;

                Instrucao instr = new Instrucao(001);
                instr.Descricao = "Não receber após o vencimento.";
                b.Instrucoes.Add(instr);

                bb.Boleto = b;
                bb.Boleto.Valida();

                string billetName = string.Format("billet_{0}.pdf", Guid.NewGuid());

                UploadBoleto(bb.MontaBytesPDF(), billetName);

                return(new
                {
                    success = true,
                    url = string.Format("https://{0}.blob.core.windows.net/{1}/{2}", Environment.GetEnvironmentVariable("BLOB_AZURE_ACCOUNT_NAME"), Environment.GetEnvironmentVariable("BLOB_AZURE_CONTAINER"), billetName)
                });
            }
            catch (Exception ex)
            {
                return(new
                {
                    success = false,
                    messages = new List <string> {
                        ex.Message
                    }
                });
            }
        }
Esempio n. 18
0
        public async Task <IActionResult> AjouterCommentaire(string Texte, int BilletId, String ordrePrecedent, int?pagePrecedente)
        {
            Billet billet      = _context.Billet.SingleOrDefault(b => b.Id == BilletId);
            int?   sessionId   = HttpContext.Session.GetInt32("_Id");
            int?   sessionType = HttpContext.Session.GetInt32("_Type");
            Compte compte      = null;

            if (sessionId != null)
            {
                compte = _context.Compte.Include(c => c.Equipe).SingleOrDefault(c => c.Id == sessionId);
            }
            if (billet != null && compte != null &&
                (compte.Id == billet.CompteId ||
                 (compte.Type == 2 && compte.Equipe.DepartementId == billet.DepartementId) ||
                 (compte.Type >= 3)))
            {
                if (string.IsNullOrWhiteSpace(Texte))
                {
                    ViewData["TexteVide"] = "Le commentaire ne peut pas être vide.";
                }
                else if (ModelState.IsValid)
                {
                    Commentaire commentaire = new Commentaire();
                    commentaire.BilletId     = BilletId;
                    commentaire.Texte        = Texte;
                    commentaire.AuteurId     = HttpContext.Session.GetInt32("_Id");
                    commentaire.DateCreation = DateTime.Now;
                    _context.Add(commentaire);
                    await _context.SaveChangesAsync();

                    return(RedirectToAction("Details", new { Id = BilletId, ordrePrecedent = ordrePrecedent, pagePrecedente = pagePrecedente }));
                }
                ViewData["commentaires"] = _context.Commentaire
                                           .Include(c => c.Auteur)
                                           .Include(c => c.Billet)
                                           .Where(c => c.BilletId == BilletId)
                                           .OrderByDescending(c => c.DateCreation)
                                           .ToList();
                ViewData["ordrePrecedent"] = ordrePrecedent;
                ViewData["pagePrecedente"] = pagePrecedente ?? 1;
                return(View("Details", billet));
            }
            else
            {
                return(View("/Views/Home/Index.cshtml"));
            }
        }
Esempio n. 19
0
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 'PaymentController.Post(Billet)'
        public ActionResult <Guid> Post([FromBody] Billet billet)
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member 'PaymentController.Post(Billet)'
        {
            try
            {
                Payment payment = _paymentServices.Execute(billet);

                if (billet.Invalid)
                {
                    return(BadRequest(new { notifications = billet.GetNotification() }));
                }

                return(Ok(payment));
            }
            catch (Exception exception)
            {
                _logger.LogError(exception, exception.Message);
                return(new StatusCodeResult(500));
            }
        }
        /// <summary>
        /// Methoden tager 1 input og gemmer det i DataBasen
        /// </summary>
        /// <param name="newBillet">Tager et object af typen Billet som parameter</param>
        public static async void SaveBilleterAsJsonAsync(Billet newBillet)
        {
            const string ServerUrl = "http://localhost:3541";

            HttpClientHandler handler = new HttpClientHandler();

            handler.UseDefaultCredentials = true;

            using (var client = new HttpClient(handler))
            {
                client.BaseAddress = new Uri(ServerUrl);
                client.DefaultRequestHeaders.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                try
                {
                    var response = client.PostAsJsonAsync("api/Billeters", newBillet).Result;
                }
                catch { }
            }
        }
Esempio n. 21
0
        public PagSeguroResult BilletCheckout(Billet billet)
        {
            PagSeguroConfiguration.UrlXmlConfiguration = this.configuration;
            //bool isSandbox = true;
            EnvironmentConfiguration.ChangeEnvironment(this.isSandbox);

            // Instantiate a new checkout
            BoletoCheckout checkout = billet.MappingBilletCheckout();

            try
            {
                AccountCredentials credentials = PagSeguroConfiguration.Credentials(this.isSandbox);

                Uol.PagSeguro.Domain.Transaction transaction = TransactionService.CreateCheckout(credentials, checkout);

                if (!string.IsNullOrEmpty(transaction.Code))
                {
                    pagSeguroResult.Success           = true;
                    pagSeguroResult.Code              = transaction.Code;
                    pagSeguroResult.FeeAmount         = transaction.FeeAmount;
                    pagSeguroResult.NetAmount         = transaction.NetAmount;
                    pagSeguroResult.Reference         = transaction.Reference;
                    pagSeguroResult.TransactionStatus = transaction.TransactionStatus.ToString();
                    pagSeguroResult.PaymentLink       = transaction.PaymentLink;
                }

                return(pagSeguroResult);
            }
            catch (PagSeguroServiceException exception)
            {
                return(new PagSeguroResult()
                {
                    Success = false
                });
                //Gravar log do erro
            }
        }
Esempio n. 22
0
        private dynamic GetBilletUrl(Form form)
        {
            using (HttpClient client = new HttpClient())
            {
                Billet billet = new Billet
                {
                    BankCode       = 237,
                    WalletNumber   = "02",
                    DueDate        = form.DueDate,
                    Value          = form.Value,
                    DocumentNumber = "00000000000001",
                    Assignor       = new Assignor
                    {
                        DocumentNumber = "103.830.576-47",
                        Name           = "Lucas Costa",
                        Agency         = "2222",
                        AccountBank    = "222222"
                    },
                    Payer = new Payer
                    {
                        Name     = "Lucas Costa",
                        Document = form.Representative is RepresentativePerson ? ((RepresentativePerson)form.Representative).Cpf : ((RepresentativeCompany)form.Representative).Cnpj,
                        Address  = string.Format("{0} {1} {2} - Complemento: {3}", form.Representative.AddressKind, form.Representative.StreetAddress, form.Representative.AddressNumber, form.Representative.ComplementAddress),
                        District = "bairro",
                        City     = form.Representative.City,
                        Cep      = form.Representative.Zipcode,
                        State    = form.Representative.State
                    }
                };

                StringContent       stringContent = new StringContent(JsonConvert.SerializeObject(billet), Encoding.UTF8, "application/json");
                HttpResponseMessage response      = client.PostAsync(_configuration["BILLET_HOST"] + "api/billets", stringContent).Result;
                response.EnsureSuccessStatusCode();
                return(JsonConvert.DeserializeObject <dynamic>(response.Content.ReadAsStringAsync().Result));
            }
        }
 public BankOfAmericaBusiness()
 {
     _boleto = new Billet();
 }
 public JpMorganBusiness()
 {
     _boleto = new Billet();
 }
Esempio n. 25
0
 public override int GetHashCode()
 {
     return(PersonalNumber.GetHashCode() ^ Billet.GetHashCode() ^
            ProficiencyCard.GetHashCode() ^ Speciality.GetHashCode() ^
            TeamMode.GetHashCode());
 }
 public BankOfAmericaBusiness()
 {
     _boleto = new Billet();
 }
Esempio n. 27
0
        public async Task <IActionResult> Modification(int id, int compteId, IFormFile fichierPhoto, [Bind("Id,Titre,Description,Image,Etat,Commentaires,AuteurId,DepartementId,EquipeId")] Billet billet)
        {
            if (HttpContext.Session.GetInt32("_Id") == null)
            {
                return(RedirectToAction("Login", "Compte"));
            }

            if (id != billet.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    if (compteId > 0)
                    {
                        billet.CompteId = compteId;
                        if (billet.Etat == "Nouveau")
                        {
                            billet.Etat = "En traitement";
                        }
                    }
                    else
                    {
                        billet.CompteId = null;
                    }


                    if (fichierPhoto != null)
                    {
                        string filePath = "./images/billet" + billet.AuteurId + "-" + billet.Id;
                        System.IO.Directory.CreateDirectory("./wwwroot/images/billets"); //crée le dossier s'il n'existe pas
                        try {
                            //Copie du fichierPhoto dans notre dossier local
                            using (var stream = new FileStream(filePath, FileMode.Create))
                            {
                                await fichierPhoto.CopyToAsync(stream);
                            }

                            billet.Image = filePath; //copie du chemin d'accès du fichier dans l'attribut Image du billet
                        }
                        catch (FileNotFoundException e)
                        {
                            Console.WriteLine("Erreur : " + e.Message);
                        }
                    }

                    else
                    {
                        billet.Image = "";
                    }


                    _context.Update(billet);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BilletExists(billet.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            // Cherche la valeur des paramètres cachés dans du formulaire qui a envoyé la request post et les envoie comme paramètre à L'action Billet.Index()
            var ordrePrecedent = HttpContext.Request.Form["ordrePrecedent"];
            var pagePrecedente = HttpContext.Request.Form["pagePrecedente"];

            return(RedirectToAction("Index", new { @ordre = ordrePrecedent, @page = pagePrecedente }));
        }
Esempio n. 28
0
        public async Task <IActionResult> Creation([Bind("Id,Titre,Description,Etat,Image,Commentaires,AuteurId,DepartementId")] Billet billet, IFormFile fichierPhoto)
        {
            if (ModelState.IsValid)
            {
                // Attribut AuteurId du billet = Id de l'utilisateur en cours
                billet.AuteurId = (int)HttpContext.Session.GetInt32("_Id");
                //L'état d'un billet est initialisé à "Nouveau"
                billet.Etat     = "Nouveau";
                billet.CompteId = null;
                billet.EquipeId = null;


                if (fichierPhoto != null)
                {
                    //Le path du fichier de l'image est construit à partir de l'ID de l'auteur et de l'ID du billet
                    //Cette méthode fonctionne si on ajoute UNE SEULE photo par billet.

                    //On va chercher le ID du dernier billet, pour ajouter l'ID du billet présent dans le path.
                    Billet billetTemp = _context.Billet.LastOrDefault();
                    int    idBilletTemp;
                    //S'il n'y a pas encore de billet dans la BD, on initalise l'ID à 0
                    if (billetTemp == null)
                    {
                        idBilletTemp = 0;
                    }
                    else
                    {
                        idBilletTemp = billetTemp.Id + 1;
                    }
                    var filePath = "/images/billets/billet" + billet.AuteurId + "-" + idBilletTemp + ".jpg";
                    System.IO.Directory.CreateDirectory("./wwwroot/images/billets"); //crée le dossier s'il n'existe pas
                    try
                    {
                        //Copie du fichierPhoto dans notre dossier local
                        using (var stream = new FileStream("./wwwroot/" + filePath, FileMode.Create))
                        {
                            await fichierPhoto.CopyToAsync(stream);
                        }

                        billet.Image = filePath; //copie du chemin d'accès du fichier dans l'attribut Image du billet
                    }
                    catch (FileNotFoundException e)
                    {
                        Console.WriteLine("Erreur : " + e.Message);
                    }
                }

                else
                {
                    billet.Image = "";
                }

                //Enregistrement du billet dans la base de données
                _context.Add(billet);

                await _context.SaveChangesAsync();

                return(RedirectToAction("Index", "Billet"));
            }
            ViewData["AuteurId"]      = new SelectList(_context.Compte, "Id", "Courriel", billet.AuteurId);
            ViewData["DepartementId"] = new SelectList(_context.Departement, "Id", "Id", billet.DepartementId);
            return(View(billet));
        }
Esempio n. 29
0
        static void Main(string[] args)
        {
            int fin = 0;

            while (fin == 0)
            {
                Console.WriteLine("1- Avion");
                Console.WriteLine("2- Aeroport");
                Console.WriteLine("3- Client");
                Console.WriteLine("4- Baggage");
                Console.WriteLine("5- Billet");
                Console.WriteLine("6- Embarquement");
                Console.WriteLine("7- Employé");
                Console.WriteLine("8- Incident");
                Console.WriteLine("9- Maintenance");
                Console.WriteLine("10- Navigant");
                Console.WriteLine("11- Sol");
                Console.WriteLine("12- Tarif");
                Console.WriteLine("13- Vol");
                Console.WriteLine("14- Voyage");
                Console.WriteLine("0- Sortie");
                Console.WriteLine("Choisissez un élément dans la liste suivante :");
                string choix = Console.ReadLine();
                if (choix == "0")
                {
                    fin = 1;
                }
                if (choix == "1")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le modèle");
                        string modele = Console.ReadLine();
                        Console.WriteLine("Entrez la disponibilité (true/false)");
                        string disponible = Console.ReadLine();
                        Console.WriteLine("Entrez les places economique");
                        string Eco = Console.ReadLine();
                        Console.WriteLine("Entrez les places Premiere");
                        string Premiere = Console.ReadLine();
                        Console.WriteLine("Entrez les places Premium");
                        string Premium = Console.ReadLine();
                        Console.WriteLine("Entrez les places Business");
                        string Busi = Console.ReadLine();
                        Console.WriteLine("Entrez le nombre d'équipage");
                        string equipage = Console.ReadLine();
                        Console.WriteLine("Entrez false si il n'a pas de proprietaire sinon True");
                        string proprietaire = Console.ReadLine();
                        Console.WriteLine("Entrez le code Aita de l'aeroport lié");
                        string Aita  = Console.ReadLine();
                        Avion  avion = new Avion()
                        {
                            Modele            = modele,
                            Disponible        = Convert.ToBoolean(disponible),
                            NbPlaceEconomique = Convert.ToInt32(Eco),
                            NbPlaceBusiness   = Convert.ToInt32(Busi),
                            NbPlacePremiere   = Convert.ToInt32(Premiere),
                            NbPlacePremium    = Convert.ToInt32(Premium),
                            NbPlaceEquipege   = Convert.ToInt32(equipage),
                            Proprietaire      = Convert.ToBoolean(proprietaire),
                            CodeAeroport      = Aita
                        };
                        db.Avions.Add(avion);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "2")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le code AITA");
                        string AITA = Console.ReadLine();
                        Console.WriteLine("Entrez le nom");
                        string nom = Console.ReadLine();
                        Console.WriteLine("Entrez l'adresse");
                        string adresse = Console.ReadLine();
                        Console.WriteLine("Entrez la ville");
                        string ville = Console.ReadLine();
                        Console.WriteLine("Entrez le pays");
                        string   pays     = Console.ReadLine();
                        Aeroport aeroport = new Aeroport()
                        {
                            CodeAITA = AITA,
                            Nom      = nom,
                            Adresse  = adresse,
                            Ville    = ville,
                            Pays     = pays,
                        };
                        db.Aeroports.Add(aeroport);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "3")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez votre prénom");
                        string prenom = Console.ReadLine();
                        Console.WriteLine("Entrez votre nom");
                        string nom = Console.ReadLine();
                        Console.WriteLine("Entrez votre date de naissance sous la forme 'aaaa-mm-jj'");
                        string datenaiss = Console.ReadLine();
                        Client client    = new Client()
                        {
                            Prenom    = prenom,
                            Nom       = nom,
                            DateNaiss = datenaiss
                        };
                        db.Clients.Add(client);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "4")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le poids");
                        string poids = Console.ReadLine();
                        Console.WriteLine("Entrez le tarrif");
                        string tarif = Console.ReadLine();
                        Console.WriteLine("Entrez l'id du client");
                        string client = Console.ReadLine();
                        Console.WriteLine("Entrez l'id du voyage");
                        string voyage = Console.ReadLine();
                        Console.WriteLine("Entrez l'id du billet");
                        string billet = Console.ReadLine();

                        Baggage baggage = new Baggage()
                        {
                            Poids_Kg_ = Convert.ToDouble(poids),
                            Tarifs    = Convert.ToDecimal(tarif),
                            IdClient  = Convert.ToInt32(client),
                            IdVoyages = Convert.ToInt32(voyage),
                            IdBillet  = Convert.ToInt32(billet)
                        };
                        db.Baggages.Add(baggage);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "5")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez l'in du tarrif");
                        string tarif = Console.ReadLine();
                        Console.WriteLine("Entrez l'in du voyage");
                        string voyage = Console.ReadLine();
                        Console.WriteLine("Entrez l'id du client");
                        string client = Console.ReadLine();
                        Console.WriteLine("Entrez le prix du billet a l'achat");
                        string prix = Console.ReadLine();
                        Console.WriteLine("Entrez false ou true si il y a une réduction ou non");
                        string reduction = Console.ReadLine();

                        Billet billet = new Billet()
                        {
                            IdTarifs         = Convert.ToInt32(tarif),
                            IdVoyages        = Convert.ToInt32(voyage),
                            IdClient         = Convert.ToInt32(client),
                            PrixPendantAchat = Convert.ToInt32(prix),
                            Reduction        = Convert.ToBoolean(reduction)
                        };
                        db.Billets.Add(billet);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "6")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez l'id du client");
                        string client = Console.ReadLine();
                        Console.WriteLine("Entrez l'id du vol");
                        string vol = Console.ReadLine();


                        Embarquement embarquement = new Embarquement()
                        {
                            IdClient = Convert.ToInt32(client),
                            idVol    = Convert.ToInt32(vol),
                        };
                        db.Embarquements.Add(embarquement);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "7")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le nom");
                        string nom = Console.ReadLine();
                        Console.WriteLine("Entrez le prénom");
                        string prenom = Console.ReadLine();
                        Console.WriteLine("Entrez la date de naissance");
                        string datenaiss = Console.ReadLine();
                        Console.WriteLine("Entrez la date d'embauche");
                        string dateEmbauche = Console.ReadLine();
                        Console.WriteLine("Entrez false ou true si il possede le permis piste ou non");
                        string permis = Console.ReadLine();

                        Employe employe = new Employe()
                        {
                            Nom                 = nom,
                            Prenom              = prenom,
                            DateNaiss           = datenaiss,
                            DateEmbauche        = dateEmbauche,
                            PermisVehiculePiste = Convert.ToBoolean(permis)
                        };
                        db.Employes.Add(employe);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "8")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez l'indice de gravité (int)");
                        string gravite = Console.ReadLine();
                        Console.WriteLine("Entrez un commentaire");
                        string commentaire = Console.ReadLine();
                        Console.WriteLine("Entrez la date");
                        string date = Console.ReadLine();
                        Console.WriteLine("Entrez l'id de l'employé");
                        string employe = Console.ReadLine();
                        Console.WriteLine("Entrez l'id de l'avion");
                        string avion = Console.ReadLine();
                        Console.WriteLine("Entrez l'id de la maintenance");
                        string maintenance = Console.ReadLine();

                        Incident incident = new Incident()
                        {
                            IndiceGravite = Convert.ToInt32(gravite),
                            Commentaire   = commentaire,
                            Date          = Convert.ToDateTime(date),
                            idEmploye     = Convert.ToInt32(employe),
                            idAvion       = Convert.ToInt32(avion),
                            IdMaintenance = Convert.ToInt32(maintenance)
                        };
                        db.Incidents.Add(incident);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "9")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le nom du chef d'équipe");
                        string nom = Console.ReadLine();
                        Console.WriteLine("Entrez l'id d'un employé");
                        string employe = Console.ReadLine();
                        Console.WriteLine("Entrez la date du début prevu");
                        string debutprevu = Console.ReadLine();
                        Console.WriteLine("Entrez la date de fin prevu");
                        string finprevu = Console.ReadLine();
                        Console.WriteLine("Entrez la date du début reel");
                        string debutreel = Console.ReadLine();
                        Console.WriteLine("Entrez la date de fin reel");
                        string finreele = Console.ReadLine();


                        Maintenance maintenance = new Maintenance()
                        {
                            NomChefEquipe   = nom,
                            idEmployee      = Convert.ToInt32(employe),
                            DateDebutPrevue = Convert.ToDateTime(debutprevu),
                            DateFinPrevue   = Convert.ToDateTime(finprevu),
                            DateDebutReelle = Convert.ToDateTime(debutreel),
                            DateFinReelle   = Convert.ToDateTime(finreele),
                        };
                        db.Maintenances.Add(maintenance);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "10")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le nom du poste");
                        string nomPoste = Console.ReadLine();
                        Console.WriteLine("Entrez true/false si il y a un pilote");
                        string pilote = Console.ReadLine();
                        Console.WriteLine("Entrez true/false si il y a un co-pilote");
                        string coPilote = Console.ReadLine();
                        Console.WriteLine("Entrez true/false si il y a une hotesse");
                        string hotesse = Console.ReadLine();


                        Naviguant naviguant = new Naviguant()
                        {
                            NomPoste = nomPoste,
                            Pilote   = Convert.ToBoolean(pilote),
                            CoPilote = Convert.ToBoolean(coPilote),
                            Hotesse  = Convert.ToBoolean(hotesse),
                        };
                        db.Naviguants.Add(naviguant);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "11")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le nom du poste");
                        string nomPoste = Console.ReadLine();
                        Console.WriteLine("Entrez le code AITA de l'aeroport");
                        string Aita = Console.ReadLine();



                        Sol sol = new Sol()
                        {
                            NomPoste     = nomPoste,
                            CodeAeroport = Aita,
                        };
                        db.Sols.Add(sol);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "12")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le type de tarif");
                        string typetarif = Console.ReadLine();
                        Console.WriteLine("Entrez la classe");
                        string classe = Console.ReadLine();
                        Console.WriteLine("Entrez le prix");
                        string prix = Console.ReadLine();
                        Console.WriteLine("Entrez l'id du voyage");
                        string voyage = Console.ReadLine();



                        Tarif tarif = new Tarif()
                        {
                            TypeTarif = typetarif,
                            Classe    = classe,
                            Prix      = Convert.ToInt32(prix),
                            IdVoyages = Convert.ToInt32(voyage),
                        };
                        db.Tarifs.Add(tarif);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "13")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le code de l'aeroport de depart");
                        string aeroportdepart = Console.ReadLine();
                        Console.WriteLine("Entrez le code de l'aeroport d'arrivee prevu");
                        string aeroportarriveeprevu = Console.ReadLine();
                        Console.WriteLine("Entrez le code de l'aeroport d'arrivee reel");
                        string aeroportarriveereel = Console.ReadLine();
                        Console.WriteLine("Entrez la date de depart prevu");
                        string datedepartprevu = Console.ReadLine();
                        Console.WriteLine("Entrez la date de depart reele");
                        string departreel = Console.ReadLine();
                        Console.WriteLine("Entrez la date d'arrivee prevu");
                        string arriveeprevu = Console.ReadLine();
                        Console.WriteLine("Entrez la date d'arrivee reele");
                        string arriveereele = Console.ReadLine();
                        Console.WriteLine("Entrez la reference de la ligne");
                        string reference = Console.ReadLine();
                        Console.WriteLine("Entrez la reference du vol");
                        string referenceVol = Console.ReadLine();
                        Console.WriteLine("Entrez la distance");
                        string distance = Console.ReadLine();
                        Console.WriteLine("Entrez le temps de vol prévu");
                        string volprevu = Console.ReadLine();
                        Console.WriteLine("Entrez le temps de vol réel");
                        string volreel = Console.ReadLine();
                        Console.WriteLine("Entrez le nombre d'employé");
                        string nbemploye = Console.ReadLine();
                        Console.WriteLine("Entrez le nombre de place restante");
                        string nbplacerestante = Console.ReadLine();
                        Console.WriteLine("Entrez le nombre de place restante business");
                        string nbplacebusi = Console.ReadLine();
                        Console.WriteLine("Entrez le nombre de place restante premiere");
                        string placePremiere = Console.ReadLine();
                        Console.WriteLine("Entrez le nombre de place restante economique");
                        string placeEco = Console.ReadLine();
                        Console.WriteLine("Entrez le nombre de place restante premium");
                        string placePremium = Console.ReadLine();
                        Console.WriteLine("Entrez l'id du pilote");
                        string pilote = Console.ReadLine();
                        Console.WriteLine("Entrez l'id du co-pilote");
                        string copilote = Console.ReadLine();
                        Console.WriteLine("Entrez l'id due l'hotesse");
                        string hotesse = Console.ReadLine();


                        Vol vol = new Vol()
                        {
                            AeroportDepart        = aeroportdepart,
                            AeroportArriveePrevue = aeroportarriveeprevu,
                            AeroportArriveeReel   = aeroportarriveereel,
                            DateDepartPrevue      = Convert.ToDateTime(datedepartprevu),
                            DateDepartReel        = Convert.ToDateTime(departreel),
                            DateArriveePrevue     = Convert.ToDateTime(arriveeprevu),
                            DateArriveeReel       = Convert.ToDateTime(arriveereele),
                            ReferenceLigne        = reference,
                            ReferenceVol          = referenceVol,
                            Distance = distance,
                            TempsVolPrevue_heure_     = volprevu.ParseTime(),
                            TempsVolReel_heure_       = volreel.ParseTime(),
                            nbEmployee                = Convert.ToInt32(nbemploye),
                            NbPlaceRestante           = Convert.ToInt32(nbplacerestante),
                            NbPlaceRestanteBusiness   = Convert.ToInt32(nbplacebusi),
                            NbPlaceRestanteEconomique = Convert.ToInt32(placeEco),
                            NbPlaceRestantePremiere   = Convert.ToInt32(placePremiere),
                            NbPlaceRestantePremium    = Convert.ToInt32(placePremium),
                            idPilote   = Convert.ToInt32(pilote),
                            idCopilote = Convert.ToInt32(copilote),
                            idHotesse  = Convert.ToInt32(hotesse),
                        };
                        db.Vols.Add(vol);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
                if (choix == "14")
                {
                    using (var db = new ProjetBDD2Entities())
                    {
                        Console.WriteLine("Entrez le nom du voyage");
                        string nom = Console.ReadLine();
                        Console.WriteLine("Entrez l'id de l'avion");
                        string avion = Console.ReadLine();



                        Voyage voyage = new Voyage()
                        {
                            Nom      = nom,
                            IdAvions = Convert.ToInt32(avion)
                        };
                        db.Voyages.Add(voyage);
                        db.SaveChanges();
                        Console.WriteLine("Ajout pris en compte !");

                        Console.ReadKey();
                        Console.Clear();
                    }
                }
            }
        }
 public JpMorganBusiness()
 {
     _boleto = new Billet();
 }