-
Notifications
You must be signed in to change notification settings - Fork 0
/
GestionUtilisateur.cs
83 lines (74 loc) · 2.75 KB
/
GestionUtilisateur.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace GP
{
public partial class GestionUtilisateur : Form
{
public GestionUtilisateur()
{
InitializeComponent();
}
private void Recherche_Click(object sender, EventArgs e)
{
c1TrueDBGrid1.FilterBar = !c1TrueDBGrid1.FilterBar;
c1TrueDBGrid1.AllowFilter = c1TrueDBGrid1.FilterBar;
c1TrueDBGrid1.FilterActive = c1TrueDBGrid1.FilterBar;
}
private void List_Click(object sender, EventArgs e)
{
c1TrueDBGrid1.PrintInfo.UseGridColors = false;
c1TrueDBGrid1.PrintInfo.PageHeader = "TIPS Informatiaue";
c1TrueDBGrid1.PrintInfo.PrintPreview();
}
private void Supprimer_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Vous ete sure de vouloire Supprimer l'utilisateur ?", "Attention", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
int index = c1TrueDBGrid1.Row;
string Code = c1TrueDBGrid1.Columns["Login"].CellText(index);
if (Code == null)
{
MessageBox.Show("Login Vide");
return;
}
TB_User Ar = new TB_User();
Ar.FindByKey(Code);
Ar.DeleteData();
((DataTable)c1TrueDBGrid1.DataSource).Rows.Find(Code).Delete();
}
}
private void Modifier_Click(object sender, EventArgs e)
{
int index = c1TrueDBGrid1.Row;
string Code = c1TrueDBGrid1.Columns["Login"].CellText(index);
InfoUtilisateur u = new InfoUtilisateur(Code);
u.ShowDialog(this);
}
private void c1TrueDBGrid1_DoubleClick(object sender, EventArgs e)
{
int index = c1TrueDBGrid1.Row;
string Code = c1TrueDBGrid1.Columns["Login"].CellText(index);
InfoUtilisateur u = new InfoUtilisateur(Code);
u.ShowDialog(this);
}
private void GestionUtilisateur_Load(object sender, EventArgs e)
{
DB_PostgreSQL dataBase = new DB_PostgreSQL();
c1TrueDBGrid1.DataSource = dataBase.returnDataSet("SELECT * FROM \"User\"").Tables[0];
}
private void Ajouter_Click(object sender, EventArgs e)
{
InfoUtilisateur u = new InfoUtilisateur();
u.ShowDialog();
}
private void Quiter_Click(object sender, EventArgs e)
{
this.Close();
}
}
}