private void UpdateAll() { Achetables.UpdateDispos(); CommandesEnCours.UpdateDispos(); DepensesEnCours.UpdateDispos(); itemsRecettes.ItemsSource = new List <Marchandise>(Achetables.listM); itemsVenteEnCours.ItemsSource = new List <Marchandise>(CommandesEnCours.listM); itemsDepenseEnCours.ItemsSource = new List <Marchandise>(DepensesEnCours.listM); itemsDepenses.ItemsSource = new List <Marchandise>(Achetables.listM); itemsAjoute.ItemsSource = new List <Marchandise>(Achetables.listM); SoldeCaisse.Text = C.caisse.ToString(); SoldeBanque.Text = C.banque.ToString(); }
private void DoLogs(string destination, bool achat = false) { if (achat) { string prixachat = (PrixDepenseEnCours.Text.Length != 0) ? PrixDepenseEnCours.Text : "0"; string logApp = "\n---------------------\n" + "dépense le " + DateTime.Now.ToString() + "\n" + DepensesEnCours.log(achat, true) + "\nplus " + AutresDepense.Text + "€" + "\nCommentaire : " + CommentairesDepense.Text + "\nTotal : " + prixachat + "€ à " + destination + "\n\n"; logs.Text += logApp; string log = DateTime.Now.ToString() + ":" + "achat" + ":" + AutresDepense.Text + ":" + CommentairesDepense.Text + ":" + prixachat + ":" + destination + ":" + DepensesEnCours.log(achat); LogFile.WriteLine(log); LogFile.Flush(); } else { string prixvente = (PrixVenteEnCours.Text.Length != 0) ? PrixVenteEnCours.Text : "0"; string logApp = "\n---------------------\n" + "vente le " + DateTime.Now.ToString() + "\n" + CommandesEnCours.log(achat, true) + "\nplus " + AutresVente.Text + "€" + "\nCommentaire : " + CommentairesVente.Text + "\nTotal : " + (prixvente + " € à " + destination + "\n\n"); logs.Text += logApp; string log = DateTime.Now.ToString() + ":" + "vente" + AutresVente.Text + ":" + CommentairesVente.Text + ":" + prixvente + ":" + destination + ":" + CommandesEnCours.log(achat); LogFile.WriteLine(log); LogFile.Flush(); } }