Beispiel #1
0
        public static void FillReportFacture(string Ref)
        {
            CurrentLigneFactures = new DalFacture().GetLigneFacturesByFacture(Ref);
            string Date    = CurrentLigneFactures.Rows[0][5].ToString();
            string Montant = CurrentLigneFactures.Rows[0][3].ToString();

            CurrentLigneFactures = MiseEnforme.AdaptDataTableLigneFacture(CurrentLigneFactures);
            System.Diagnostics.Process.Start(ExportDataTableToPdf(CurrentLigneFactures, Ref, Date, Montant));
        }
Beispiel #2
0
        public List<Article> GetArticleList()
        {
            List<Article> AllArticles = new List<Article>();

            MySqlCommand = new SqlCommand("select * from [Article]");

            dt = Connexion.FunctionToRead(MySqlCommand);
            dt = MiseEnforme.AdaptDataTableArticle(dt);

            foreach (DataRow row in dt.Rows)
            {
                AllArticles.Add(ConvertRowToArticle(row));
            }

            return AllArticles;
        }
Beispiel #3
0
        private void TxtSearch_TextChanged(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtSearch.Text.Trim()))
            {
                FillDtgListeLigneFactures(Fac.RefProp);
            }
            else
            {
                List <LigneFacture> Listefacture = new List <LigneFacture>();
                Listefacture = MyFactureDal.GetLigneFacturesList(Fac.RefProp);

                var query = from o in Listefacture
                            where o.RefProp.Contains(TxtSearch.Text) || o.PrixUProp >= float.Parse(TxtSearch.Text) ||
                            o.QuantProp >= Int32.Parse(TxtSearch.Text)
                            select o;
                DtgListeLigneFacture.DataSource = MiseEnforme.AdaptDataTableLigneFacture(query.ToList());
            }
        }
Beispiel #4
0
        public void FillDtgListeLigneFactures(string RefFacture)
        {
            CurrentDataTableLigneFactures = new DalFacture().GetLigneFacturesByFacture(RefFacture);

            CurrentDataTableLigneFactures = MiseEnforme.AdaptDataTableLigneFacture(CurrentDataTableLigneFactures);
            if (CurrentDataTableLigneFactures.Rows.Count == 0)
            {
                Btn_Modifier.Enabled    = false;
                Btn_Enregistrer.Enabled = false;
                Btn_SupprimerLF.Enabled = false;
            }
            else
            {
                Btn_Modifier.Enabled    = true;
                Btn_Enregistrer.Enabled = true;
                Btn_SupprimerLF.Enabled = true;
            }
            DtgListeLigneFacture.DataSource = CurrentDataTableLigneFactures;
        }
Beispiel #5
0
        public int FillDtgListeArticle()
        {
            CurrentDataTableArticle     = new DALArticle().GetAllArticles();
            CurrentDataTableArticleInit = CurrentDataTableArticle;

            CurrentDataTableArticle  = MiseEnforme.AdaptDataTableArticle(CurrentDataTableArticle);
            dataGridView1.DataSource = CurrentDataTableArticle;
            if (CurrentDataTableArticle.Rows.Count == 0)
            {
                Btn_Modifier.Enabled  = false;
                Btn_Supprimer.Enabled = false;
            }
            else
            {
                Btn_Modifier.Enabled  = true;
                Btn_Supprimer.Enabled = true;
            }
            return(CurrentDataTableArticle.Rows.Count);
        }
Beispiel #6
0
        public int FillDtgListeFacture()
        {
            CurrentDataTableFacture     = new DalFacture().GetAllFacture();
            CurrentDataTableFactureInit = CurrentDataTableFacture;
            CurrentDataTableFacture     = MiseEnforme.AdaptDataTableFacture(CurrentDataTableFacture);

            DtgListeFactures.DataSource = CurrentDataTableFacture;

            if (CurrentDataTableFacture.Rows.Count == 0)
            {
                Btn_SuppF.Enabled     = false;
                Btn_consulter.Enabled = false;
                Btn_Imprimer.Enabled  = false;
            }
            else
            {
                Btn_SuppF.Enabled     = true;
                Btn_consulter.Enabled = true;
                Btn_Imprimer.Enabled  = true;
            }
            return(CurrentDataTableFacture.Rows.Count);
        }
Beispiel #7
0
        private void TxtSearch_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(TxtSearch.Text.Trim()))
                {
                    FillDtgListeFacture();
                }
                else
                {
                    List <Facture> Listefacture = new List <Facture>();
                    Listefacture = MyDALFacture.GetFactureList();

                    var query = from o in Listefacture
                                where o.RefProp.Contains(TxtSearch.Text) || o.MontantProp == float.Parse(TxtSearch.Text)
                                select o;
                    DtgListeFactures.DataSource = MiseEnforme.AdaptDataTableFacture(query.ToList());
                }
            } catch (Exception ex)
            {
                MessageBox.Show("Caractères invalide !!");
            }
        }
Beispiel #8
0
 private void Factures_Load(object sender, EventArgs e)
 {
     DtgListeFactures.DataSource = MiseEnforme.InitialiseDataGridFacture(CurrentDataTableFacture);
     FillDtgListeFacture();
 }
Beispiel #9
0
        private void Articles_Load(object sender, EventArgs e)
        {
            dataGridView1.DataSource = MiseEnforme.InitialiseDataGridArticle(CurrentDataTableArticle);

            FillDtgListeArticle();
        }