private void btnAdd_Click(object sender, EventArgs e)
{
if (txtAppointmentID.Text.Length > 0 && txtAppointmentNumber.Text.Length > 0 && txtPatientID.Text.Length > 0 && txtDoctorName.Text.Length > 0 && DateTimeAppointment.Text.Length > 0 && txtAppointmentDuration.Text.Length > 0 && txtAppointmentCharges.Text.Length > 0)
if (Appointment.IsExist(txtAppointmentID.Text) || Appointment.IsExist(txtAppointmentNumber.Text) || Appointment.ISExit(txtPatientID.Text))
{
MessageBox.Show("Appointment already Exist");
}
else
{
if (Appointment.InsertAppointmentRecord(txtAppointmentID.Text , txtAppointmentNumber.Text, txtPatientID.Text, txtDoctorName.Text, DateTimeAppointment.Value, txtAppointmentDuration.Text, txtAppointmentCharges.Text))
{
MessageBox.Show("Appointment Record Inserted Successfully" , "Insertion Succeeded");
GetAppointmentTable();
}
else
{
MessageBox.Show("Appointment Record Insertion Failed" , "Insertion Failed");
}
}
else
{
MessageBox.Show( "Fill Required Field" , "Empty Fields");
Hassan khanPosted Apr 26, 2015, 4:18 AM
The condition is If AppointmentNumber or PatientID or AppointmentID is exist then it shows record already exist here.
Gowtham RajamanickamPosted Apr 24, 2015, 12:28 AM
Khargesh RajputPosted Apr 24, 2015, 12:09 AM
Khan Abrar AhmedPosted Apr 23, 2015, 9:51 AM
private void btnAdd_Click(object sender, EventArgs e)
{
if (txtAppointmentID.Text.Length > 0 && txtAppointmentNumber.Text.Length > 0 && txtPatientID.Text.Length > 0 && txtDoctorName.Text.Length > 0 && DateTimeAppointment.Text.Length > 0 && txtAppointmentDuration.Text.Length > 0 && txtAppointmentCharges.Text.Length > 0)
if (Appointment.IsExist(txtAppointmentID.Text) && Appointment.IsExist(txtAppointmentNumber.Text) && Appointment.ISExit(txtPatientID.Text) && Appointment.ISExit(DateTimeAppointment.Text))
{
MessageBox.Show("Appointment already Exist");
}
else
{
if (Appointment.InsertAppointmentRecord(txtAppointmentID.Text , txtAppointmentNumber.Text, txtPatientID.Text, txtDoctorName.Text, DateTimeAppointment.Value, txtAppointmentDuration.Text, txtAppointmentCharges.Text))
{
MessageBox.Show("Appointment Record Inserted Successfully" , "Insertion Succeeded");
GetAppointmentTable();
}
else
{
MessageBox.Show("Appointment Record Insertion Failed" , "Insertion Failed");
}
}
else
{
MessageBox.Show( "Fill Required Field" , "Empty Fields");
}
}