-
Notifications
You must be signed in to change notification settings - Fork 0
/
f_ScheduleAppointment.cs
157 lines (123 loc) · 4.42 KB
/
f_ScheduleAppointment.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace login1
{
public partial class f_ScheduleAppointment : Form
{
public f_ScheduleAppointment()
{
InitializeComponent();
slots.AutoGenerateColumns = true;
}
private void bSubmit_Click_1(object sender, EventArgs e)
{
bool status=false;
f_ScheduleAppointment app = this;
validationOfForms val = new validationOfForms();
status =val.validateAppointmentForm(app,tMRN.Text, cDate.Text, cMonth.Text, cYear.Text, cHour.Text, cMinutes.Text, cAmOrPm.Text);
if (!(status))
{
manAll.Show();
manDate.Show();
manMrn.Show();
manTime.Show();
MessageBox.Show("Please fill up all the required information");
}
}
private void bCancel_Click_1(object sender, EventArgs e)
{
this.Dispose();
f_ReceptionHome rec = new f_ReceptionHome();
rec.Show();
}
private void bClear_Click_1(object sender, EventArgs e)
{
cAmOrPm.Text = "AM";
cDate.Text ="DD";
cMinutes.Text ="Min";
cMonth.Text="MM";
cYear.Text = "YYYY";
cHour.Text="Hr";
tMRN.Text = null;
}
private void linklabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.Dispose();
f_ReceptionHome rec = new f_ReceptionHome();
rec.Show();
}
private void ll_logout_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.Dispose();
f_ReceptionHome rec = new f_ReceptionHome();
rec.Show();
}
private void bReschedule_Click(object sender, EventArgs e)
{
/* DataGridViewRow row = slots.CurrentRow;
dbAppointment app = new dbAppointment();
string date = row.Cells[1].Value.ToString();
string time = row.Cells[2].Value.ToString();
int mrn = Convert.ToInt16(row.Cells[0].Value.ToString());
app.editAppointment(mrn, date, time);
slots.Hide();
bReschedule.Visible = false;
button2.Visible = false;
*/
DataGridViewRow row = slots.CurrentRow;
dbAppointment app = new dbAppointment();
try
{
string date = row.Cells[1].Value.ToString();
string time = row.Cells[2].Value.ToString();
int mrn = Convert.ToInt16(row.Cells[0].Value.ToString());
app.editAppointment(mrn, date, time);
slots.Hide();
bReschedule.Visible = false;
button3.Visible = false;
button2.Visible = false;
}
catch (NullReferenceException ex)
{
MessageBox.Show("There are no busy slots");
}
}
private void button1_Click(object sender, EventArgs e)
{
string date = cMonth.Text +'/'+ cDate.Text+'/'+cYear.Text;
bAppointment b = new bAppointment();
b.checkBusySlots(slots, date);
bReschedule.Visible = true;
button3.Visible = true;
button2.Visible = true;
}
private void button2_Click(object sender, EventArgs e)
{
DataGridViewRow dr= slots.CurrentRow;
string m = dr.Cells[0].Value.ToString();
string date = dr.Cells[1].Value.ToString();
string time = dr.Cells[2].Value.ToString();
bAppointment b = new bAppointment();
b.deleteAppointment(m,date,time);
//slots.CurrentRow.
MessageBox.Show("Appoinment Deleted!");
button2.Visible = false;
button3.Visible = false;
slots.Hide();
bReschedule.Visible = false;
}
private void button3_Click(object sender, EventArgs e)
{
slots.Hide();
button2.Visible = false;
button3.Visible = false;
bReschedule.Visible = false;
}
}
}