Beispiel #1
0
        private void cherch_Click(object sender, EventArgs e)
        {
            DashboardServiceWCFClient d  = new DashboardServiceWCFClient();
            ProduitServiceWCFClient   pr = new ProduitServiceWCFClient();
            var l = new[]
            {
                new { mn = 1, m = "Janvier" },
                new { mn = 2, m = "Février" },
                new { mn = 3, m = "Mars" },
                new { mn = 4, m = "Avril" },
                new { mn = 5, m = "Mai" },
                new { mn = 6, m = "Juin" },
                new { mn = 7, m = "Juillet" },
                new { mn = 8, m = "Aout" },
                new { mn = 9, m = "Septembre" },
                new { mn = 10, m = "Octobre" },
                new { mn = 11, m = "Novembre" },
                new { mn = 12, m = "Décembre" },
            }.ToList();

            foreach (var item in l)
            {
                if (comboBox1.Text == item.m)
                {
                    int n = d.nb_venteByMonth(item.mn, Convert.ToInt32(comboBoxYears.Text));
                    if (n != 0)
                    {
                        foreach (var c in chart_nb_vente.Series)
                        {
                            c.Points.Clear();
                        }

                        foreach (var v in pr.findAll())
                        {
                            chart_nb_vente.Series["ventes"].Points.AddXY(d.name_prod(Convert.ToInt32(v.id_produit)), d.q_v_m(Convert.ToInt32(v.id_produit), item.mn, Convert.ToInt32(comboBoxYears.Text)));
                        }


                        int g = d.gain_month(item.mn, Convert.ToInt32(comboBoxYears.Text));

                        int p = d.perte_mois(item.mn, Convert.ToInt32(comboBoxYears.Text));
                        nb.Text    = Convert.ToString(n);
                        gain.Text  = Convert.ToString(g);
                        perte.Text = Convert.ToString(p);
                    }
                    else
                    {
                        MessageBox.Show("Aucun vente  n'a été effectuer en ce mois!!");
                    }
                }
            }
        }
Beispiel #2
0
        private void btnJour_Click(object sender, EventArgs e)
        {
            chart_nb_vente.Visible = true;
            nb.Visible             = true;
            gain.Visible           = true;
            perte.Visible          = true;
            des.Visible            = true;
            label1.Visible         = true;
            label2.Visible         = true;
            label3.Visible         = true;
            label5.Visible         = true;
            //String date = dateTimePicker1.Value.ToShortDateString();

            DashboardServiceWCFClient d     = new DashboardServiceWCFClient();
            ProduitServiceWCFClient   pr    = new ProduitServiceWCFClient();
            VenteServiceWCFClient     vente = new VenteServiceWCFClient();
            int v = vente.nbVente(dateTimePicker1.Value.Date);

            if (v != 0)
            {
                int n = d.nb_ventes(dateTimePicker1.Value.Date);

                int g = d.gain_tout(dateTimePicker1.Value.Date);

                int p = d.perte(dateTimePicker1.Value.Date);
                int a = d.nbr_achat(dateTimePicker1.Value.Date);
                nb.Text    = Convert.ToString(n);
                gain.Text  = Convert.ToString(g);
                perte.Text = Convert.ToString(p);
                achat.Text = Convert.ToString(a);
                List <VenteService.Vente> l = new List <VenteService.Vente>();
                d.findnow(dateTimePicker1.Value.Date);

                foreach (var item in chart_nb_vente.Series)
                {
                    item.Points.Clear();
                }

                foreach (var item in pr.findAll())
                {
                    chart_nb_vente.Series["ventes"].Points.AddXY(d.name_prod(Convert.ToInt32(item.id_produit)), d.qu(Convert.ToInt32(item.id_produit), dateTimePicker1.Value.Date));
                }
            }
            else
            {
                MessageBox.Show("Aucun vente  n'a été effectuer en cette date!!");
            }
        }
Beispiel #3
0
        private void Stat_mois_Load(object sender, EventArgs e)
        {
            DashboardServiceWCFClient d = new DashboardServiceWCFClient();

            chart_nb_vente.Visible = true;
        }