54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
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;
|
|
using GestionDeCommerceInfoClasseBDDNCouches;
|
|
|
|
namespace Gestion_de_commerce_Informatique
|
|
{
|
|
public partial class DashBoard : UserControl
|
|
{
|
|
BDDAccesArticle bddArticle = new BDDAccesArticle(Settings1.Default.ChaineDeConnection);
|
|
private DataTable dtArticle;
|
|
private BindingSource bsArticle;
|
|
public DashBoard()
|
|
{
|
|
InitializeComponent();
|
|
this.BackColor = Color.Transparent;
|
|
bsArticle = new BindingSource();
|
|
RemplirDVG(dgvAlertStock);
|
|
}
|
|
|
|
private void dgvUser_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|