-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppointmentDetails.cs
65 lines (57 loc) · 2.65 KB
/
AppointmentDetails.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace Hospital_Management_System_1
{
public partial class AppointmentDetails : Form
{
public AppointmentDetails()
{
InitializeComponent();
}
Appointments app = new Appointments();
private void AppointmentDetails_Load(object sender, EventArgs e)
{
// populate the datagridview with Appointment data
MySqlCommand command = new MySqlCommand("SELECT * FROM `appointment`");
dataGridView2.ReadOnly = true;
DataGridViewImageColumn piCol = new DataGridViewImageColumn();
dataGridView2.RowTemplate.Height = 70;
dataGridView2.DataSource = app.getAppointment(command);
dataGridView2.AllowUserToAddRows = false;
}
private void buttonRefresh_Click(object sender, EventArgs e)
{
// refresh the datagridview data
MySqlCommand command = new MySqlCommand("SELECT * FROM `appointment`");
dataGridView2.ReadOnly = true;
DataGridViewImageColumn piCol = new DataGridViewImageColumn();
dataGridView2.RowTemplate.Height = 70;
dataGridView2.DataSource = app.getAppointment(command);
dataGridView2.AllowUserToAddRows = false;
}
private void dataGridView2_DoubleClick(object sender, EventArgs e)
{
// dispalay the selected Appointment form
UpdateDelete_Appointment edit = new UpdateDelete_Appointment();
edit.textBox1.Text = dataGridView2.CurrentRow.Cells[0].Value.ToString();
edit.textBoxPatientID.Text = dataGridView2.CurrentRow.Cells[1].Value.ToString();
edit.textBoxFirstName.Text = dataGridView2.CurrentRow.Cells[2].Value.ToString();
edit.textBoxLastName.Text = dataGridView2.CurrentRow.Cells[3].Value.ToString();
edit.comboBoxCaseType.Text = dataGridView2.CurrentRow.Cells[4].Value.ToString();
edit.DateTimePicker1.Value = (DateTime)dataGridView2.CurrentRow.Cells[5].Value;
edit.ComboBoxAppointmentType.Text = dataGridView2.CurrentRow.Cells[6].Value.ToString();
edit.TextBoxDoctorsName.Text = dataGridView2.CurrentRow.Cells[7].Value.ToString();
edit.TextBoxPassport.Text = dataGridView2.CurrentRow.Cells[8].Value.ToString();
edit.Show();
}
}
}