GestionDeDommerceInformatique/Gestion de commerce Informa.../DashBoard.cs

54 lines
1.6 KiB
C#
Raw Permalink Normal View History

2018-06-05 12:59:35 +02:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using GestionDeCommerceInfoClasseBDDNCouches.DataLayer;
2018-06-07 12:34:14 +02:00
using GestionDeCommerceInfoClasseBDDNCouches;
2018-06-05 12:59:35 +02:00
namespace Gestion_de_commerce_Informatique
{
public partial class DashBoard : UserControl
{
2018-06-07 12:34:14 +02:00
BDDAccesArticle bddArticle = new BDDAccesArticle(Settings1.Default.ChaineDeConnection);
private DataTable dtArticle;
private BindingSource bsArticle;
2018-06-05 12:59:35 +02:00
public DashBoard()
{
InitializeComponent();
this.BackColor = Color.Transparent;
2018-06-07 12:34:14 +02:00
bsArticle = new BindingSource();
RemplirDVG(dgvAlertStock);
2018-06-05 12:59:35 +02:00
}
2018-06-05 17:20:36 +02:00
private void dgvUser_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
2018-06-07 12:34:14 +02:00
private void RemplirDVG(DataGridView dgv)
{
dtArticle = new DataTable();
dtArticle.Columns.Add(new DataColumn("id", System.Type.GetType("System.Int32")));
dtArticle.Columns.Add("Article");
dtArticle.Columns.Add("Quantite");
List<Article> larticles;
larticles = bddArticle.VerifStock(Settings1.Default.AlerteStock);
foreach (Article Tmp in larticles)
dtArticle.Rows.Add(Tmp.ID, Tmp.Designation, Tmp.Stock);
bsArticle.DataSource = dtArticle;
dgv.DataSource = bsArticle;
}
public void RemplirDVG()
{
RemplirDVG(dgvAlertStock);
}
2018-06-05 12:59:35 +02:00
}
}