-
Notifications
You must be signed in to change notification settings - Fork 2
/
Edit_Sessions.cs
55 lines (49 loc) · 1.66 KB
/
Edit_Sessions.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
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_Management_System
{
public partial class Edit_Sessions : Form
{
DBManager DBM = new DBManager();
public Edit_Sessions()
{
InitializeComponent();
UpdateDG();
}
private void UpdateDG()
{
DataTable dt = DBM.GetAllSessions();
dataGrid.DataSource = dt;
dataGrid.Refresh();
}
private void Remove_Button_Click(object sender, EventArgs e)
{
int row = dataGrid.CurrentRow.Index;
int TypeID = Convert.ToInt32(dataGrid.Rows[row].Cells[0].Value);
string TypeName = dataGrid.Rows[row].Cells[1].Value.ToString();
int NoOfNurses = Convert.ToInt32(dataGrid.Rows[row].Cells[2].Value);
int price = Convert.ToInt32(dataGrid.Rows[row].Cells[3].Value);
int DSal = Convert.ToInt32(dataGrid.Rows[row].Cells[4].Value);
int NSal = Convert.ToInt32(dataGrid.Rows[row].Cells[5].Value);
DBM.EditSessions(TypeID, TypeName, NoOfNurses, price, DSal, NSal);
UpdateDG();
}
private void RefreshButton_Click(object sender, EventArgs e)
{
UpdateDG();
}
private void homeToolStripMenuItem_Click(object sender, EventArgs e)
{
admin admin = new admin();
admin.Show();
this.Hide();
}
}
}