private void buttonAjout_Click(object sender, EventArgs e) { if (comboSelectVehicule.SelectedItem == null || textQuantite.Text == "" || comboSelectPiece.SelectedItem == null ) { MessageBox.Show("Veuillez renseigner tous les champs"); } else { //Pour remplir la listeView piecesManager pieceManage = new piecesManager(); tvaManager tvaManage = new tvaManager(); piece unePiece = pieceManage.unePiece(comboSelectPiece.SelectedItem.ToString()); tva uneTva = tvaManage.uneTva(); double prixTTC = (float)unePiece.getPrixHT() * (1 + (float)uneTva.getTaux() / 100); prixTTC = Math.Round(prixTTC, 2); double prixTotal = Convert.ToInt32(textQuantite.Text) * prixTTC; ListViewItem item = new ListViewItem(unePiece.getLibelle().ToString()); item.SubItems.Add(textQuantite.Text); item.SubItems.Add(unePiece.getPrixHT().ToString()); item.SubItems.Add(prixTTC.ToString()); item.SubItems.Add(prixTotal.ToString()); listPiece.Items.Add(item); textQuantite.Clear(); comboSelectPiece.SelectedIndex = -1; } labelPrixTTC.Text = compteTotalTTC().ToString() + " €"; }
private void ajoutPieces_Load(object sender, EventArgs e) { tvaManager tvaManage = new tvaManager(); tva uneTva = tvaManage.uneTva(); item item = new item(uneTva.getTaux().ToString(), uneTva.getId()); comboTva.Items.Add(item); }
private void feuilleDevis_Load(object sender, EventArgs e) { //On recupère les infos client clientManager clientManage = new clientManager(); client leClient = clientManage.getUnclient(idDevis); //On récupère la date devisManager devisManage = new devisManager(); DateTime laDate = devisManage.getDate(idDevis); //On récupere l'immatriculation vehiculesManager vehiculeManage = new vehiculesManager(); string immat = vehiculeManage.getImmat(idDevis); //On récupère la TVA tvaManager tvaManage = new tvaManager(); tva laTva = tvaManage.uneTva(); //On affiche les informartion du client labelNomClient.Text = leClient.getNom(); labelPrenomClient.Text = leClient.getPrenom(); labelAdresse1.Text = leClient.getAdr1(); labelAdresse2.Text = leClient.getAdr2(); labelCP.Text = leClient.getCP().ToString(); labelVille.Text = leClient.getVille(); //On affiche la date labelDate.Text = laDate.ToString(); //on affiche l'immatriculation labelImmat.Text = immat; //On affiche la tva labelTauxTva.Text = laTva.getTaux().ToString() + "%"; //On affiche la liste des pieces repareManager repareManage = new repareManager(); List<repare> listeRepare = repareManage.getListeRepare(idDevis); foreach (repare uneReparation in listeRepare) { piecesManager pieceManage = new piecesManager(); int idPiece = uneReparation.getPieceId(); piece unePiece = pieceManage.getPiece(idPiece); double prixTTC = (float)unePiece.getPrixHT() * (1 + (float)laTva.getTaux() / 100); prixTTC = Math.Round(prixTTC, 2); double totalTTC = prixTTC * uneReparation.getQuantite(); ListViewItem item = new ListViewItem(unePiece.getId().ToString()); item.SubItems.Add(unePiece.getLibelle()); item.SubItems.Add(uneReparation.getQuantite().ToString()); item.SubItems.Add(unePiece.getPrixHT().ToString()); item.SubItems.Add(prixTTC.ToString()); item.SubItems.Add(totalTTC.ToString()); listViewPiece.Items.Add(item); } labelTotalTTC.Text = calculTotalTTC().ToString() + " €"; }
private void CreationDevis_Load(object sender, EventArgs e) { //Pour remplir le combobox des véhicules à réparer vehiculesManager vehiculeManage = new vehiculesManager(); List<vehicules> lesVehicules = new List<vehicules>(); lesVehicules = vehiculeManage.listeVehicules(); tvaManager tvaManage = new tvaManager(); tva laTva = tvaManage.uneTva(); labelTauxTva.Text = laTva.getTaux() + " %"; foreach (vehicules unVehicule in lesVehicules) { comboSelectVehicule.Items.Add(unVehicule.getImmat()); } //Pour remplir le combobox des pieces piecesManager pieceManage = new piecesManager(); List<piece> lesPieces = new List<piece>(); lesPieces = pieceManage.listePiece(); foreach (piece unePiece in lesPieces) { comboSelectPiece.Items.Add(unePiece.getLibelle()); } }