protected void BRecRefresh_Click(object sender, EventArgs e) { conn.Open(); SqlCommand query = new SqlCommand("SELECT RecordId,OpdId,PatientName,DepartmentName,DoctorName,AppointmentDate,Status FROM Appointment JOIN Patients ON Appointment.OpdId = Patients.OpdNo and DoctorName like '%'+@Docname+'%' and DepartmentName like '%'+@Deptname+'%' and OpdId like'%'+@opd+'%' and PatientName like '%'+@record+'%'", conn); query.Parameters.AddWithValue("Docname", ""); query.Parameters.AddWithValue("Deptname", ""); query.Parameters.AddWithValue("opd", ""); query.Parameters.AddWithValue("record", ""); DataTable dt = new DataTable(); SqlDataAdapter sda = new SqlDataAdapter(query); sda.Fill(dt); GridViewRecords.DataSource = dt; GridViewRecords.DataBind(); BRecSearch.Enabled = true; BRecRefresh.Enabled = false; BRecRefresh.BackColor = System.Drawing.Color.White; BRecRefresh.ForeColor = System.Drawing.Color.DarkGray; BRecSearch.BackColor = Color.FromName("#c23838"); BRecSearch.ForeColor = Color.FromName("#fff"); TodayAppointPanel.Visible = false; RecordsPanel.Visible = true; PatientsPanel.Visible = false; }
protected void GridViewRecords_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridViewRecords.PageIndex = e.NewPageIndex; GridViewRecords.DataSource = ViewState["GridViewRecords"]; GridViewRecords.DataBind(); ScriptManager.RegisterStartupScript(this, GetType(), "Open View File Modal", "$('#NoteRecords').collapse('show');", true); }
protected void Bind_GridViewRecords() { List <Record> records = recordBLL.GetRecords(); ViewState["GridViewRecords"] = records; GridViewRecords.DataSource = records; GridViewRecords.DataBind(); UpdatePanelRecords.Update(); }
private void LoadRecords() { conn.Open(); SqlDataAdapter da = new SqlDataAdapter("SELECT RecordId,OpdId,PatientName,DepartmentName,DoctorName,AppointmentDate,Status FROM Appointment JOIN Patients ON Appointment.OpdId = Patients.OpdNo ORDER BY Appointment.AppointmentDate DESC", conn); DataTable dt = new DataTable(); da.Fill(dt); GridViewRecords.DataSource = dt; GridViewRecords.DataBind(); conn.Close(); BRecSearch.Enabled = true; BRecRefresh.Enabled = false; BRecRefresh.BackColor = System.Drawing.Color.White; BRecRefresh.ForeColor = System.Drawing.Color.DarkGray; BRecSearch.BackColor = Color.FromName("#c23838"); BRecSearch.ForeColor = Color.FromName("#fff"); }
protected void GridViewPatientAnonymised_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("ViewRecords")) { try { string recordIDsString = e.CommandArgument.ToString(); List <long> recordIDs = recordIDsString.Split(',').Select(long.Parse).ToList(); List <Record> records = dataBLL.GetRecords(recordIDs); ViewState["GridViewRecords"] = records; GridViewRecords.DataSource = records; GridViewRecords.DataBind(); UpdatePanelRecords.Update(); ScriptManager.RegisterStartupScript(this, GetType(), "Open Select Records Modal", "$('#modalRecords').modal('show');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error Opening Records Modal.');", true); } } else if (e.CommandName.Equals("ViewDiagnosis")) { try { string patientId = e.CommandArgument.ToString(); List <PatientDiagnosis> patientDiagnoses = dataBLL.GetPatientDiagnoses(patientId); GridViewPatientDiagnoses.DataSource = patientDiagnoses; GridViewPatientDiagnoses.DataBind(); UpdatePanelDiagnosisView.Update(); ScriptManager.RegisterStartupScript(this, GetType(), "Open Diagnosis Modal", "$('#modalDiagnosisView').modal('show');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error Opening Diagnosis Modal.');", true); } } }
protected void Bind_GridViewPatientAndRecord() { string nric = string.Empty; if (ViewState["GridViewPatientSelectedPatientNRIC"] != null) { nric = Convert.ToString(ViewState["GridViewPatientSelectedPatientNRIC"]); } List <Record> records = new RecordBLL().GetRecords(nric); ViewState["GridViewRecords"] = records; GridViewRecords.DataSource = records; GridViewRecords.DataBind(); string term = TextboxSearch.Text.Trim().ToLower(); List <Classes.Entity.Patient> patients = therapistBLL.GetCurrentPatients(term); ViewState["GridViewPatient"] = patients; GridViewPatient.DataSource = patients; GridViewPatient.DataBind(); UpdatePanelNewMedicalNote.Update(); }
protected void GridViewMedicalNote_RowCommand(object sender, GridViewCommandEventArgs e) { long id = Convert.ToInt64(e.CommandArgument.ToString()); ViewState["GridViewGridViewMedicalNoteSelectedID"] = id; if (e.CommandName.Equals("ViewNote")) { try { Note note = therapistBLL.GetNote(id); // Note Details inputTitle.Value = note.title; TextBoxContent.Text = note.content; inputCreateBy.Value = note.creator.lastName + " " + note.creator.firstName; inputCreateTime.Value = note.createTime.ToString(); inputPatientNRIC.Value = note.patient.nric; if (note.patient.approvedTime == null) { inputPatientName.Value = "Redacted"; PanelNoteUnauthorized.Visible = true; PanelPatientPersonalInformation.Visible = false; PanelPatientDiagnosis.Visible = false; PanelNoteRecords.Visible = false; } else { inputPatientName.Value = note.patient.lastName + " " + note.patient.firstName; // Personal Details inputNRIC.Value = note.patient.nric; DateofBirth.Value = note.patient.dateOfBirth.ToString("MM/dd/yyyy"); FirstName.Value = note.patient.firstName; LastName.Value = note.patient.lastName; CountryofBirth.Value = note.patient.countryOfBirth; Nationality.Value = note.patient.nationality; Sex.Value = note.patient.sex; Gender.Value = note.patient.gender; MaritalStatus.Value = note.patient.maritalStatus; // Contact Details Address.Value = note.patient.address; PostalCode.Value = note.patient.addressPostalCode; EmailAddress.Value = note.patient.email; ContactNumber.Value = note.patient.contactNumber; // Patient NOK Details NOKName.Value = note.patient.nokName; NOKContact.Value = note.patient.nokContact; // Patient Diagnoses List <PatientDiagnosis> patientDiagnoses = therapistBLL.GetPatientDiagnoses(note.patient.nric, id); ViewState["GridViewPatientDiagnoses"] = patientDiagnoses; GridViewPatientDiagnoses.DataSource = patientDiagnoses; GridViewPatientDiagnoses.DataBind(); // Records List <Record> records = new RecordBLL().GetRecords(note.patient.nric, note.id); ViewState["GridViewRecords"] = records; GridViewRecords.DataSource = records; GridViewRecords.DataBind(); } ViewState["GridViewPatientSelectedNRIC"] = note.patient.nric; UpdatePanelNote.Update(); ScriptManager.RegisterStartupScript(this, GetType(), "Open Select Note Modal", "$('#modalNote').modal('show'); $('#NoteInformation').collapse('show');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error Opening Note View.');", true); } } else if (e.CommandName.Equals("ViewSendNoteModal")) { try { Bind_GridViewTherapistSendNote(); ScriptManager.RegisterStartupScript(this, GetType(), "Open Select Note Modal", "$('#modalSendNote').modal('show');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error Opening Send Note View.');", true); } } Bind_GridViewMedicalNote(); }
protected void GridViewRecords_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridViewRecords.PageIndex = e.NewPageIndex; GridViewRecords.DataSource = ViewState["GridViewRecords"]; GridViewRecords.DataBind(); }
protected void GridViewPatient_RowCommand(object sender, GridViewCommandEventArgs e) { string nric = e.CommandArgument.ToString(); ViewState["GridViewPatientSelectedNRIC"] = nric; if (e.CommandName.Equals("ViewPermission")) { try { Update_UpdatePanelPermissions(nric); ScriptManager.RegisterStartupScript(this, GetType(), "Open Select Permission Modal", "$('#modalPermissions').modal('show');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error Opening Permission View.');", true); } } else if (e.CommandName.Equals("ViewInformation")) { try { Classes.Entity.Patient patient = therapistBLL.GetPatientInformation(nric); // Personal Details LabelInformationNRIC.Text = patient.nric; inputNRIC.Value = patient.nric; DateofBirth.Value = patient.dateOfBirth.ToString("MM/dd/yyyy"); FirstName.Value = patient.firstName; LastName.Value = patient.lastName; CountryofBirth.Value = patient.countryOfBirth; Nationality.Value = patient.nationality; Sex.Value = patient.sex; Gender.Value = patient.gender; MaritalStatus.Value = patient.maritalStatus; // Contact Details Address.Value = patient.address; PostalCode.Value = patient.addressPostalCode; EmailAddress.Value = patient.email; ContactNumber.Value = patient.contactNumber; // Patient NOK Details NOKName.Value = patient.nokName; NOKContact.Value = patient.nokContact; UpdatePanelInformation.Update(); ScriptManager.RegisterStartupScript(this, GetType(), "Open Select Information Modal", "$('#modalInformation').modal('show');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error Opening Information View.');", true); } } else if (e.CommandName.Equals("ViewRecords")) { try { List <Record> records = new RecordBLL().GetRecords(nric); LabelRecordsNRIC.Text = nric; modalRecordsHyperlinkNewRecord.NavigateUrl = "~/Therapist/My-Patients/New-Record?Patient-NRIC=" + nric; ViewState["GridViewRecords"] = records; GridViewRecords.DataSource = records; GridViewRecords.DataBind(); UpdatePanelRecords.Update(); ScriptManager.RegisterStartupScript(this, GetType(), "Open Select Records Modal", "$('#modalRecords').modal('show');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error Opening Records Modal.');", true); } } else if (e.CommandName.Equals("ViewDiagnosis")) { try { TextboxSearchDiagnosis.Text = string.Empty; Bind_GridViewPatientDiagnoses(nric); ScriptManager.RegisterStartupScript(this, GetType(), "Open Diagnosis Modal", "$('#modalDiagnosisView').modal('show');", true); } catch { ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error Opening Diagnosis Modal.');", true); } } Bind_GridViewPatient(); }