2018-06-07 12:34:14 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
2018-06-07 17:35:27 +02:00
|
|
|
|
using GestionDeCommerceInfoClasseBDDNCouches;
|
|
|
|
|
using GestionDeCommerceInfoClasseBDDNCouches.DataLayer;
|
2018-06-07 12:34:14 +02:00
|
|
|
|
|
|
|
|
|
namespace Gestion_de_commerce_Informatique
|
|
|
|
|
{
|
|
|
|
|
public partial class ConfigCommande : Form
|
|
|
|
|
{
|
2018-06-07 17:35:27 +02:00
|
|
|
|
BDDAccesArticle bbdArt = new BDDAccesArticle(Settings1.Default.ChaineDeConnection);
|
|
|
|
|
BDDAccesPanier bddPanier = new BDDAccesPanier(Settings1.Default.ChaineDeConnection);
|
|
|
|
|
BDDAccesUtilisateur bddUser = new BDDAccesUtilisateur(Settings1.Default.ChaineDeConnection);
|
|
|
|
|
|
|
|
|
|
private DataTable dtLSTArticle;
|
|
|
|
|
private BindingSource bsLSTArticle;
|
|
|
|
|
Panier panier;
|
2018-06-07 12:34:14 +02:00
|
|
|
|
public ConfigCommande()
|
|
|
|
|
{
|
2018-06-07 17:35:27 +02:00
|
|
|
|
panier = new Panier();
|
2018-06-07 12:34:14 +02:00
|
|
|
|
InitializeComponent();
|
2018-06-07 17:35:27 +02:00
|
|
|
|
List<Utilisateur> users = bddUser.ListUtilisateurs(Utilisateur.Tri_E.NONE);
|
|
|
|
|
foreach(Utilisateur user in users)
|
|
|
|
|
{
|
|
|
|
|
cbUser.Items.Add(user);
|
|
|
|
|
}
|
|
|
|
|
cbTypeCommande.Items.Add(Panier.Type_E.Vente);
|
|
|
|
|
cbTypeCommande.Items.Add(Panier.Type_E.Achat);
|
|
|
|
|
cbStatus.Items.Add(Panier.Status_E.NULL);
|
|
|
|
|
cbStatus.Items.Add(Panier.Status_E.Commander);
|
|
|
|
|
cbStatus.Items.Add(Panier.Status_E.Envoyer);
|
|
|
|
|
cbStatus.Items.Add(Panier.Status_E.Recu);
|
|
|
|
|
bsLSTArticle = new BindingSource();
|
|
|
|
|
dtLSTArticle = new DataTable();
|
|
|
|
|
dtLSTArticle.Columns.Add(new DataColumn("idLSTART", System.Type.GetType("System.Int32")));
|
|
|
|
|
dtLSTArticle.Columns.Add("Designation", typeof(Panier.LSTArticle));
|
|
|
|
|
dtLSTArticle.Columns.Add("prixHTVAPc");
|
|
|
|
|
dtLSTArticle.Columns.Add("Quantitee");
|
|
|
|
|
dtLSTArticle.Columns.Add("PrixTotHTVA");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void visualComboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void bunifuFlatButton1_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
private void RemplirDVG(DataGridView dgv)
|
|
|
|
|
{
|
|
|
|
|
dtLSTArticle = new DataTable();
|
|
|
|
|
dtLSTArticle.Columns.Add(new DataColumn("idLSTART", System.Type.GetType("System.Int32")));
|
|
|
|
|
dtLSTArticle.Columns.Add("Designation", typeof(Panier.LSTArticle));
|
|
|
|
|
dtLSTArticle.Columns.Add("prixHTVAPc");
|
|
|
|
|
dtLSTArticle.Columns.Add("Quantitee");
|
|
|
|
|
dtLSTArticle.Columns.Add("PrixTotHTVA");
|
|
|
|
|
List<Panier.LSTArticle> larticles;
|
|
|
|
|
larticles = bddPanier.listeArticlePanier(panier.idPanier);
|
|
|
|
|
foreach (Panier.LSTArticle Tmp in larticles)
|
|
|
|
|
dtLSTArticle.Rows.Add(Tmp.id, Tmp, $"{Math.Round(Tmp.prixHTVAPC, 2)}€",Tmp.quantitee, Tmp.prixHTVATot);
|
|
|
|
|
|
|
|
|
|
bsLSTArticle.DataSource = dtLSTArticle;
|
|
|
|
|
dgv.DataSource = bsLSTArticle;
|
|
|
|
|
}
|
|
|
|
|
public void RemplirDVG()
|
|
|
|
|
{
|
|
|
|
|
RemplirDVG(dgvLSTArt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void pbAdd_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ConfigLSTArt win = new ConfigLSTArt(dtLSTArticle);
|
|
|
|
|
bsLSTArticle.DataSource = dtLSTArticle;
|
|
|
|
|
dgvLSTArt.DataSource = bsLSTArticle;
|
|
|
|
|
win.ShowDialog();
|
2018-06-07 12:34:14 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|