Beispiel #1
0
        protected void Bind_GridViewRecordDiagnoses()
        {
            long   recordID = Convert.ToInt64(ViewState["GridViewRecordsSelectedRecord"]);
            Record record   = recordBLL.GetRecord(recordID);

            labelRecordNameDiagnosis.Text = record.title;

            List <RecordDiagnosis> recordDiagnoses = recordBLL.GetRecordDiagnoses(recordID);

            ViewState["GridViewRecordDiagnoses"] = recordDiagnoses;
            GridViewRecordDiagnoses.DataSource   = recordDiagnoses;
            GridViewRecordDiagnoses.DataBind();

            UpdatePanelRecordDiagnosisView.Update();
        }
        protected void Bind_GridViewRecordDiagnoses()
        {
            long   recordID = Convert.ToInt64(ViewState["GridViewRecordsSelectedRecord"]);
            Record record   = recordBLL.GetRecord(recordID);

            labelRecordNameDiagnosis.Text = record.title;

            List <RecordDiagnosis> recordDiagnoses = recordBLL.GetRecordDiagnoses(recordID);

            ViewState["GridViewRecordDiagnoses"] = recordDiagnoses;
            GridViewRecordDiagnoses.DataSource   = recordDiagnoses;
            GridViewRecordDiagnoses.DataBind();

            string           term        = TextboxSearchDiagnosisForRecord.Text.Trim().ToLower();
            string           patientNRIC = ViewState["GridViewPatientSelectedNRIC"].ToString();
            List <Diagnosis> diagnoses   = therapistBLL.GetDiagnoses(term, patientNRIC, recordDiagnoses);

            ViewState["GridViewRecordDiagnosesAdd"] = diagnoses;
            GridViewRecordDiagnosesAdd.DataSource   = diagnoses;
            GridViewRecordDiagnosesAdd.DataBind();

            UpdatePanelRecordDiagnosisView.Update();
        }
Beispiel #3
0
 protected void GridViewRecordDiagnoses_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GridViewRecordDiagnoses.PageIndex  = e.NewPageIndex;
     GridViewRecordDiagnoses.DataSource = ViewState["GridViewRecordDiagnoses"];
     GridViewRecordDiagnoses.DataBind();
 }
        protected void GridViewRecords_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("FileView"))
            {
                try
                {
                    long   recordID = Convert.ToInt64(e.CommandArgument);
                    Record record   = dataBLL.GetRecord(recordID);

                    modalFileViewImage.Visible     = false;
                    modalFileViewVideo.Visible     = false;
                    modalFileViewPanelText.Visible = false;

                    labelRecordName.Text            = record.title;
                    modalFileViewLabelFileName.Text = record.fileName + record.fileExtension;
                    modalFileViewLabelFileSize.Text = record.fileSizeMegabytes;
                    FileDownloadLinkviaModal.HRef   = "~/Researcher/Download.ashx?record=" + record.id.ToString();

                    if (record.fileIsImage)
                    {
                        modalFileViewImage.Visible  = true;
                        modalFileViewImage.ImageUrl = "~/Researcher/Download.ashx?record=" + record.id;

                        ScriptManager.RegisterStartupScript(this, GetType(), "Open View File Modal", "$('#modalRecords').modal('hide'); $('#modalFileView').modal('show');", true);
                    }
                    else if (record.fileIsText)
                    {
                        modalFileViewPanelText.Visible = true;
                        if (record.IsFileSafe())
                        {
                            string js = string.Empty;
                            try
                            {
                                js = record.type.GetTextPlotJS(File.ReadAllText(record.fullpath));
                                ScriptManager.RegisterStartupScript(this, GetType(), "Open View File Modal", "$('#modalRecords').modal('hide'); $('#modalFileView').on('shown.bs.modal', function (e) {  " + js + "}); $('#modalFileView').modal('show');", true);
                            }
                            catch
                            {
                                ScriptManager.RegisterStartupScript(this, GetType(), "Error Opening View File Modal", "toastr['error']('Text file is not formatted incorrectly to be plotted. To view file, please download it.');", true);
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), "Error Opening View File Modal", "toastr['error']('Error Occured in retrieving text file and opening File Modal.');", true);
                        }
                    }
                    else if (record.fileIsVideo)
                    {
                        modalFileViewVideo.Visible = true;
                        modalFileViewVideoSource.Attributes.Add("src", "~/Researcher/Download.ashx?record=" + record.id);

                        ScriptManager.RegisterStartupScript(this, GetType(), "Open View File Modal", "$('#modalRecords').modal('hide'); $('#modalFileView').modal('show');", true);
                    }

                    UpdatePanelFileView.Update();
                }
                catch
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "Error Opening View File Modal", "toastr['error']('Error Opening File Modal.');", true);
                }
            }
            else if (e.CommandName.Equals("RecordDiagnosisView"))
            {
                try
                {
                    long recordID = Convert.ToInt64(e.CommandArgument);

                    Record record = dataBLL.GetRecord(recordID);
                    labelRecordNameDiagnosis.Text = record.title;

                    List <RecordDiagnosis> recordDiagnoses = dataBLL.GetRecordDiagnoses(recordID);
                    ViewState["GridViewRecordDiagnoses"] = recordDiagnoses;
                    GridViewRecordDiagnoses.DataSource   = recordDiagnoses;
                    GridViewRecordDiagnoses.DataBind();

                    UpdatePanelRecordDiagnosisView.Update();

                    ScriptManager.RegisterStartupScript(this, GetType(), "Open View Record Diagnosis Modal", "$('#modalRecords').modal('hide'); $('#modalRecordDiagnosisView').modal('show');", true);
                }
                catch
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "Error Opening View Record Diagnosis Modal", "toastr['error']('Error Opening Record Diagnosis Modal.');", true);
                }
            }
        }