-
Notifications
You must be signed in to change notification settings - Fork 0
/
GestionStock.cs
104 lines (87 loc) · 3.04 KB
/
GestionStock.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using MySql.Data.MySqlClient;
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;
using WindowsFormsApplication1;
namespace PTOuatelse
{
public partial class GestionStock : Form
{
private string server;
private string database;
private string uid;
private string password;
private MySqlConnection connection;
private MySqlDataAdapter mySqlDataAdapter;
public GestionStock()
{
InitializeComponent();
}
private void modifierProduit_Click(object sender, EventArgs e)
{
ModifierProduit modifier = new ModifierProduit();
modifier.Show();
}
private void nouveauProduit_Click(object sender, EventArgs e)
{
NouveauProduit prod = new NouveauProduit();
prod.Show();
this.Hide();
}
private void reaprovisionnerProduit_Click(object sender, EventArgs e)
{
}
private void destockerProduit_Click(object sender, EventArgs e)
{
int var = int.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString());
Console.Write(var);
DBConect db = new DBConect();
db.Initialize();
db.destockerProduit(var);
this.Hide();
}
private void supprimerProduit_Click(object sender, EventArgs e)
{
int var = int.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString());
Console.Write(var);
DBConect db = new DBConect();
db.Initialize();
db.supprimerProduit(var);
this.Hide();
}
private void rechercher_TextChanged(object sender, EventArgs e)
{
rechercher.ResetText();
}
private void recherche_Click(object sender, EventArgs e)
{
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void GestionStock_Load(object sender, EventArgs e)
{
server = "info-viviane.iut.bx1";
database = "pt_ouatelse1";
uid = "pt_ouatelse1";
password = "DYwBqVhnNL5SPddK";
string connectionString;
connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
connection = new MySqlConnection(connectionString);
mySqlDataAdapter = new MySqlDataAdapter("select nom,prix_achat,prix_vente,quantite,tva,code_ean from produits inner join mouvement_stock where produits.id = produits_id", connection);
DataSet ds = new DataSet();
mySqlDataAdapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void pictureBox1_Click(object sender, EventArgs e)
{
this.Hide();
}
}
}