Exemplo n.º 1
0
        public void RapportEntreeMonth(string month, int year)
        {
            try
            {
                FrmImpression frm = new FrmImpression();


                if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
                {
                    ImplementeConnexion.Instance.Conn.Open();
                }
                using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
                {
                    cmd.CommandText = "GetEntreesMonth";
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@month", 50, DbType.String, month));
                    cmd.Parameters.Add(Parametre.Instance.AddParametres(cmd, "@year", 50, DbType.Int32, year));

                    DataSet        ds    = new DataSet();
                    SqlDataAdapter dscmd = new SqlDataAdapter((SqlCommand)cmd);
                    dscmd.Fill(ds, "Affichage_Finance_Entree");

                    CR_Entree entree = new CR_Entree();
                    entree.SetDataSource(ds);

                    crystalReportViewer1.ReportSource = entree;
                    crystalReportViewer1.Refresh();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("L'erreur suivant est survenue : " + ex.Message);
            }
        }
Exemplo n.º 2
0
        public void RapportEntreeToday()
        {
            try
            {
                FrmImpression frm = new FrmImpression();


                if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed)
                {
                    ImplementeConnexion.Instance.Conn.Open();
                }
                using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand())
                {
                    cmd.CommandText = "GetEntreesToday";
                    cmd.CommandType = CommandType.StoredProcedure;

                    DataSet        ds    = new DataSet();
                    SqlDataAdapter dscmd = new SqlDataAdapter((SqlCommand)cmd);
                    dscmd.Fill(ds, "Affichage_Finance_Entree");

                    CR_Entree entree = new CR_Entree();
                    entree.SetDataSource(ds);

                    frm.crystalReportViewer1.ReportSource = entree;
                    frm.crystalReportViewer1.Refresh();
                    frm.rapport = "Entrees";

                    frm.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("L'erreur suivant est survenue : " + ex.Message);
            }
        }