예제 #1
0
        private void itemsRecettes_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            int i = e.ItemIndex;

            if (Achetables.listM[i].dispo > 0)
            {
                AddToMenu(ref CommandesEnCours, Achetables.listM[i], false, true);
                UpdateAll();
                PrixVenteEnCours.Text = (CommandesEnCours.PrixTotal(false) + getAutresVentePrix()).ToString() + "€";
            }
        }
예제 #2
0
 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();
 }
예제 #3
0
 private void clean()
 {
     CommentairesVente.Text  = "";
     AutresVente.Text        = "";
     AutresDepense.Text      = "";
     PrixVenteEnCours.Text   = "";
     PrixDepenseEnCours.Text = "";
     CommandesEnCours.ResetAll();
     UpdateAll();
     CadreAutreDepense.BorderColor       = Color.Black;
     CadrePrixDepenseEnCours.BorderColor = Color.Black;
     ErreurAjout.Text       = "";
     NomProduitAjoute.Text  = "";
     PrixProduitAjoute.Text = "";
 }
예제 #4
0
        private void DoTransaction(string type, bool achat = false)
        {
            DoLogs(type, achat);
            double prixdep = (PrixDepenseEnCours.Text.Length != 0) ? Math.Round(float.Parse(PrixDepenseEnCours.Text.Replace("€", string.Empty), CultureInfo.InvariantCulture.NumberFormat), 2) : 0;

            if (achat)
            {
                switch (type)
                {
                case "Banque":
                    if (PrixDepenseEnCours.Text.Length != 0)
                    {
                        C.banque -= prixdep;
                    }
                    break;

                case "Caisse":
                    C.caisse -= prixdep;
                    break;

                case "Don":
                    break;
                }
                DepensesEnCours = new ListeMarchandises();
            }
            else
            {
                switch (type)
                {
                case "Banque":
                    C.banque += CommandesEnCours.PrixTotal(false) + getAutresVentePrix();
                    break;

                case "Caisse":
                    C.caisse += CommandesEnCours.PrixTotal(false) + getAutresVentePrix();
                    break;

                case "Don":
                    break;
                }
                CommandesEnCours = new ListeMarchandises();
            }
            Achetables.DoTransaction();
            Achetables.SaveMarchandises();
        }
예제 #5
0
 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();
     }
 }
예제 #6
0
        /// Ventes

        private void AutresVente_TextChanged(object sender, TextChangedEventArgs e)
        {
            PrixVenteEnCours.Text = (CommandesEnCours.PrixTotal(false) + getAutresVentePrix()).ToString() + "€";
        }