/// Author Sonia /// <summary> /// This function is used to Bind ScriptHistory Grid and Other Details of Medication Order /// </summary> private void BindControls() { DataView DataViewClientMedicationScriptHistory; ShowHidePillImage = "display:none"; try { DataViewClientMedicationScriptHistory = null; if (((Streamline.BaseLayer.StreamlinePrinciple)Context.User) != null) { _clientMedicationId = Convert.ToInt32(((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientOrderDetailsMedicationId.ToString()); HiddenFieldClientMedicationId.Value = _clientMedicationId.ToString(); GetMedicationOrderDetails(); MedicationClientPersonalInformationControl.showEditableAllergyList = false; MedicationClientPersonalInformationControl.Activate(); //Fill the Script History Information objectClientMedications = new ClientMedication(); if (HiddenFieldScriptId.Value.ToString() != "") { _DataSetClientMedicationScriptHistory = objectClientMedications.DownloadClientMedicationScriptHistory(((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId, _clientMedicationId, Convert.ToInt32(HiddenFieldScriptId.Value.ToString())); } else { _DataSetClientMedicationScriptHistory = objectClientMedications.DownloadClientMedicationScriptHistory(((Streamline.BaseLayer.StreamlinePrinciple)Context.User).Client.ClientId, _clientMedicationId, -1); } DataViewClientMedicationScriptHistory = _DataSetClientMedicationScriptHistory.Tables["ClientMedicationScripts"].DefaultView; DataViewClientMedicationScriptHistory.Sort = "ClientMedicationScriptId desc"; Session["DataViewClientMedicationScriptHistory"] = DataViewClientMedicationScriptHistory; if (DataViewClientMedicationScriptHistory.Table.Rows.Count > 0) { Session["PharmacyName"] = DataViewClientMedicationScriptHistory.Table.Rows[0]["PharmacyName"]; Session["OrderingMethod"] = DataViewClientMedicationScriptHistory.Table.Rows[0]["OrderingMethod"]; DataGridScriptHistory.DataSource = DataViewClientMedicationScriptHistory; DataGridScriptHistory.DataBind(); HiddenFieldLatestClientMedicationScriptId.Value = DataViewClientMedicationScriptHistory.Table.Rows[0]["ClientMedicationScriptId"].ToString(); HiddenFieldPrescriptionStatus.Value = DataViewClientMedicationScriptHistory.Table.Rows[0]["Status"].ToString(); } else { DataGridScriptHistory.DataBind(); } } else { ScriptManager.RegisterStartupScript(LabelClientScript, LabelClientScript.GetType(), ClientID.ToString(), "redirectToLoginPage();", true); } } catch (Exception ex) { throw (ex); } finally { DataViewClientMedicationScriptHistory = null; } }
public override bool DocumentCloseDocument() { _DataSetOrderDetails = null; _DataSetClientMedicationScriptHistory = null; objectClientMedications = null; _DataSetClientSummary = null; Session["DataViewClientMedicationScriptHistory"] = null; GridViewMedicationInstructions.Dispose(); DataGridScriptHistory.Dispose(); return(true); }