public void CalculerHeure(Boolean Propager = true) { Montant = Qte * Poste.Chantier.TauxHoraire; if (Propager) { Poste.CalculerHeure(); } }
private void Atteindre_Click(object sender, RoutedEventArgs e) { ListBox V = ((sender as MenuItem).Parent as ContextMenu).PlacementTarget as ListBox; Poste L = (Poste)V.SelectedItem; if (L != null) { xComptabilite.Focus(); xListeChantier.ScrollIntoView(L.Chantier); xListeChantier.SelectedItem = L.Chantier; } }
public override bool Supprimer() { if (!EstCharge) { return(false); } Poste.ListeHeure.Remove(this); Bdd2.Supprimer(this); Poste.CalculerHeure(); return(true); }
private void ButtonImporter_Click(object sender, RoutedEventArgs e) { Button B = sender as Button; if (B == null) { return; } Chantier chantier = B.DataContext as Chantier; if (chantier == null) { return; } System.Windows.Forms.OpenFileDialog pDialogue = new System.Windows.Forms.OpenFileDialog { Title = "Format du fichier .csv : " + "Reference;Description;Montant", Filter = "Fichier csv (*.csv)|*.csv", Multiselect = false, InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop), RestoreDirectory = true }; String pChemin = ""; if (pDialogue.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pChemin = pDialogue.FileName; } if (pChemin != "" && File.Exists(pChemin)) { try { using (StreamReader sr = new StreamReader(pChemin, System.Text.Encoding.GetEncoding(1252))) { while (sr.Peek() > -1) { var l = sr.ReadLine(); var t = l.Split(new char[] { ';' }, StringSplitOptions.None); var p = new Poste(chantier); if (t.Length > 0) { p.Reference = t[0]; } if (t.Length > 1) { p.Description = t[1]; } if (t.Length > 2 && Double.TryParse(t[2].Trim(), out double r)) { p.Montant = r; } } } } catch (Exception ex) { this.LogMethode(new Object[] { ex }); } } }
public Heure(Poste poste) { Bdd2.Ajouter(this); Poste = poste; }
public void CalculerAchat() { Poste.CalculerAchat(); }
public Achat(Poste poste) { Bdd2.Ajouter(this); Poste = poste; }
public AnalysePoste(Poste poste) { _Poste = poste; }