protected void btnSearch_Click(object sender, EventArgs e) { try { string firstName = txtSearchFirstName.Text; string lastName = txtSearchLastName.Text; LINQDatabaseService service = new LINQDatabaseService(); Patient p = service.GetPatientInfo(firstName, lastName); if (p != null) { txtInsuranceNo.Text = p.insuranceNo; txtFirstName.Text = p.firstName; txtLastName.Text = p.lastName; txtPhoneNumber.Text = p.phoneNumber.ToString(); txtAddress.Text = p.address; txtEmail.Text = p.email; lblMessage.Text = ""; } else { txtInsuranceNo.Text = ""; txtFirstName.Text = ""; txtLastName.Text = ""; txtPhoneNumber.Text = ""; txtAddress.Text = ""; txtEmail.Text = ""; lblMessage.Text = "Not found"; } } catch (Exception ex) { lblResult.Text = ex.Message; } }
protected void btnSave_Click(object sender, EventArgs e) { try { Doctor d = new Doctor(); d.registrationNo = txtRegistrationNo.Text; d.firstName = txtFirstName.Text; d.lastName = txtLastName.Text; d.phoneNumber = Convert.ToInt32(txtPhoneNumber.Text); d.profession = txtProfession.Text; d.email = txtEmail.Text; LINQDatabaseService service = new LINQDatabaseService(); if (service.DoctorRegistration(d)) { lblResult.Text = "Saved successfully"; } else { lblResult.Text = "Exception happens"; } } catch (Exception ex) { lblResult.Text = ex.Message; } }
protected void btnSearch_Click(object sender, EventArgs e) { try { string firstName = txtSearchFirstName.Text; string lastName = txtSearchLastName.Text; LINQDatabaseService service = new LINQDatabaseService(); Doctor d = service.GetDoctorInfo(firstName, lastName); if (d != null) { txtRegistrationNo.Text = d.registrationNo; txtFirstName.Text = d.firstName; txtLastName.Text = d.lastName; txtPhoneNumber.Text = d.phoneNumber.ToString(); txtProfession.Text = d.profession; txtEmail.Text = d.email; lblMessage.Text = ""; } else { txtRegistrationNo.Text = ""; txtFirstName.Text = ""; txtLastName.Text = ""; txtPhoneNumber.Text = ""; txtProfession.Text = ""; txtEmail.Text = ""; lblMessage.Text = "Not found"; } } catch (Exception ex) { lblResult.Text = ex.Message; } }
protected void btnSearch_Click(object sender, EventArgs e) { try { LINQDatabaseService service = new LINQDatabaseService(); Appointment ap = service.GetAppointment(txtPatientFirstName.Text, txtPatientLastName.Text, txtDoctorFirstName.Text, txtDoctorLastName.Text); if (ap == null) { lblResult.Text = "Not found"; } else { txtDate.Text = ap.datetime.Date.ToShortDateString(); txtTime.Text = ap.datetime.TimeOfDay.ToString(); txtClinicName.Text = ap.clinicname; txtDoctorFirstName.ReadOnly = true; txtDoctorLastName.ReadOnly = true; txtPatientFirstName.ReadOnly = true; txtPatientLastName.ReadOnly = true; txtClinicName.ReadOnly = true; } } catch (Exception ex) { lblResult.Text = ex.Message; } }
protected void btnSave_Click(object sender, EventArgs e) { try { LINQDatabaseService service = new LINQDatabaseService(); bool success = service.AppointmentBooking(txtPatientFirstName.Text, txtPatientLastName.Text, txtDoctorFirstName.Text, txtDoctorLastName.Text, Convert.ToDateTime(txtDate.Text + " " + txtTime.Text), txtClinicName.Text); if (success) { lblResult.Text = "Save Successfully"; } } catch (Exception ex) { lblResult.Text = ex.Message; } }
protected void btnReschedule_Click(object sender, EventArgs e) { try { LINQDatabaseService service = new LINQDatabaseService(); bool success = service.AppointmentReschedule(txtPatientFirstName.Text, txtPatientLastName.Text, txtDoctorFirstName.Text, txtDoctorLastName.Text, Convert.ToDateTime(txtDate.Text + " " + txtTime.Text)); if (success) { lblResult.Text = "Updated Successfully"; } else { lblResult.Text = "Exception Happened"; } } catch (Exception ex) { lblResult.Text = ex.Message; } }
protected void btnSave_Click(object sender, EventArgs e) { try { Patient p = new Patient(); p.insuranceNo = txtInsuranceNo.Text; p.firstName = txtFirstName.Text; p.lastName = txtLastName.Text; p.phoneNumber = Convert.ToInt32(txtPhoneNumber.Text); p.address = txtAddress.Text; p.email = txtEmail.Text; LINQDatabaseService service = new LINQDatabaseService(); if (service.PatientRegistration(p)) { lblResult.Text = "Saved successfully"; } } catch (Exception ex) { lblResult.Text = ex.Message; } }