Beispiel #1
0
        //Fournisseurs

        private void pictureBox10_Click(object sender, EventArgs e)
        {
            UserLine.Hide();
            UnitesLine.Hide();
            VentesLine.Hide();
            StatLine.Hide();
            DisLine.Show();
            AchatsLine.Hide();
            ProduitLine.Hide();
            Fournisseurs.BringToFront();
        }
Beispiel #2
0
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     WelcomePage.BringToFront();
     About.SendToBack();
     Contact.SendToBack();
     Header.BringToFront();
     UserLine.Hide();
     UnitesLine.Hide();
     VentesLine.Hide();
     StatLine.Hide();
     DisLine.Hide();
     AchatsLine.Hide();
     ProduitLine.Hide();
     AboutLine.Hide();
     ContactLine.Hide();
 }
Beispiel #3
0
 private void logout_Click_1(object sender, EventArgs e)
 {
     Login.Show();
     About.SendToBack();
     Contact.SendToBack();
     Header.Show();
     UserLine.Hide();
     UnitesLine.Hide();
     VentesLine.Hide();
     StatLine.Hide();
     DisLine.Hide();
     AchatsLine.Hide();
     ProduitLine.Hide();
     AboutLine.Hide();
     ContactLine.Hide();
 }
Beispiel #4
0
        //Statistiques

        private void pictureBox11_Click(object sender, EventArgs e)
        {
            int      i     = 0;
            DateTime today = DateTime.Today;

            TODAYDATE.Text = today.ToString("yyyy-MM-dd");
            //  TODAYDATE.Text = DateTime.Now.ToLongDateString();

            UserLine.Hide();
            UnitesLine.Hide();
            VentesLine.Hide();
            StatLine.Show();
            DisLine.Hide();
            AchatsLine.Hide();
            ProduitLine.Hide();
            Statistiques.BringToFront();


            //==> TOP 5 PRODUCTS

            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select top(5) product, SUM(Total)  from Commande GROUP BY  product  order by SUM(Total) desc";
            cmd.ExecuteNonQuery();
            DataTable      dt9 = new DataTable();
            SqlDataAdapter da9 = new SqlDataAdapter(cmd);

            da9.Fill(dt9);
            dataGridView5.DataSource = dt9;


            //==> NUMBER OF ORDERS DONE TODAY


            SqlCommand cmd1 = con.CreateCommand();

            cmd1.CommandType = CommandType.Text;
            cmd1.CommandText = "SELECT COUNT( DISTINCT id), COUNT(DISTINCT product), COUNT( DISTINCT order_id), SUM(Total)  FROM Commande  WHERE ComDate ='" + TODAYDATE.Text + "'";
            cmd1.ExecuteNonQuery();
            DataTable      dt11 = new DataTable();
            SqlDataAdapter da11 = new SqlDataAdapter(cmd1);

            da11.Fill(dt11);
            // dataGridView6.DataSource = dt11;
            NumCommande.Text      = dt11.Rows[0][0].ToString();
            NumProducts.Text      = dt11.Rows[0][1].ToString();
            ClientsToday.Text     = dt11.Rows[0][2].ToString();
            TotalAmountToday.Text = dt11.Rows[0][3].ToString();

            //==> NUMBER OF CLIENTS AND PRODUCTS MONTH


            SqlCommand cmd2 = con.CreateCommand();

            cmd2.CommandType = CommandType.Text;
            cmd2.CommandText = "SELECT COUNT(DISTINCT product), COUNT( DISTINCT order_id)  FROM Commande  WHERE month(ComDate) ='" + DateTime.Now.Month + "'";
            cmd2.ExecuteNonQuery();
            DataTable      dt3 = new DataTable();
            SqlDataAdapter da3 = new SqlDataAdapter(cmd2);

            da3.Fill(dt3);
            NumProdMonth.Text   = dt3.Rows[0][0].ToString();
            NumClientMonth.Text = dt3.Rows[0][1].ToString();

            //==> Linear Chart datatable

            /*  SqlCommand cmd3 = con.CreateCommand();
             * cmd3.CommandType = CommandType.Text;
             * cmd3.CommandText = "select Distinct ComDate, SUM(Total) from Commande group by ComDate";
             * cmd3.ExecuteNonQuery();
             * DataTable dt4 = new DataTable();
             * SqlDataAdapter da4 = new SqlDataAdapter(cmd3);
             * da4.Fill(dt4);*/
            /*chart2.DataSource = v_SalesTableAdapter;
             *
             *
             *
             * chart2.Series["Series1"].XValueMember= "ComDate";
             * chart2.Series["Series1"].YValueMembers =" Total";
             *
             *
             * chart2.DataBind();*/


            //==>

            /*    SqlCommand cmd2 = con.CreateCommand();
             *  cmd2.CommandType = CommandType.Text;
             *  cmd2.CommandText = "SELECT COUNT(product) FROM Commande WHERE ComDate ='" + TODAYDATE.Text + "'";
             *  cmd2.ExecuteNonQuery();
             *  DataTable dt10 = new DataTable();
             *  SqlDataAdapter da10 = new SqlDataAdapter(cmd2);
             *  da11.Fill(dt10);
             * // dataGridView6.DataSource = dt10;*/
            //  NumCommande.Text = dataGridView6.Rows[0].Cells[0].Value.ToString();


            MonthNow1.Text = DateTime.Now.ToString("MMMM");
            MonthNow2.Text = DateTime.Now.ToString("MMMM");



            //==> CHART


/*            SqlCommand cmd4 = con.CreateCommand();
 *          cmd4.CommandType = CommandType.Text;
 *          cmd4.CommandText = "SELECT Total FROM Commande ";
 *          cmd4.ExecuteNonQuery();
 *          DataTable dt4 = new DataTable();
 *          SqlDataAdapter da4 = new SqlDataAdapter(cmd4);
 *          da4.Fill(dt4);*/
        }