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; }
public bool validateAppointmentForm(f_ScheduleAppointment app, string mrntext, string daytext, string monthtext, string yeartext, string hourtext, string mintext, string amorpmtext)//appointment form validation { if (mrntext == "" || daytext == "DD" || monthtext == "MM" || yeartext == "YYYY" || hourtext == "Hr" || mintext == "Min") { return(false); } else { dbAppointment db = new dbAppointment(); bool flag = db.checkMrn(mrntext); if (flag == true) { app.Hide(); bAppointment appoint = new bAppointment(mrntext, daytext, monthtext, yeartext, hourtext, mintext, amorpmtext); if (appoint.scheduleAppointment()) { MessageBox.Show("Appointment fixed"); f_ReceptionHome rec = new f_ReceptionHome(); rec.Show(); } else { MessageBox.Show("Time slot already booked! Try again!"); f_ReceptionHome rec = new f_ReceptionHome(); rec.Show(); } return(true); } else { MessageBox.Show("The MRN entered is not valid! Please enter a valid number"); return(true); } } }