-
Notifications
You must be signed in to change notification settings - Fork 2
/
Remove_user.cs
59 lines (52 loc) · 1.46 KB
/
Remove_user.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
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;
namespace Clinic
{
public partial class Remove_user : Form
{
char p;
DBManager db = DBManager.getInstance();
public Remove_user(char p)
{
this.p = p;
InitializeComponent();
DataTable dt= db.GetAllUsers();
if (dt != null)
{
dataGridView1.DataSource = dt;
}
}
private void Id_remove_Click(object sender, EventArgs e)
{
}
private void RemoveButton_Click(object sender, EventArgs e)
{
int ID = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value);
int r = 0;
r = db.RemoveUser(ID);
if (r == 1)
{
MessageBox.Show("User removed successfully");
}
else
{
MessageBox.Show("User removal failed");
}
}
private void homeToolStripMenuItem_Click(object sender, EventArgs e)
{
new admin(p).Show();
}
private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
{
new Login().Show();
}
}
}