public ArrayList GetPharmacyPrescriptionDetails() { PatientEncounterLogic patientEncounter = new PatientEncounterLogic(); DataTable theDT = patientEncounter.loadPatientPharmacyPrescription(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString()); ArrayList rows = new ArrayList(); string remove = ""; foreach (DataRow row in theDT.Rows) { if (row["DispensedQuantity"].ToString() == "") { remove = "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"; } else { if (Convert.ToDecimal(row["DispensedQuantity"].ToString()) == 0) { remove = "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"; } else { remove = "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' disabled> Remove</button>"; } } string[] i = new string[13] { row["Drug_Pk"].ToString(), row["batchId"].ToString(), row["FrequencyID"].ToString(), row["abbr"].ToString(), row["DrugName"].ToString(), row["batchName"].ToString(), row["dose"].ToString(), row["freq"].ToString(), row["duration"].ToString(), row["OrderedQuantity"].ToString(), row["DispensedQuantity"].ToString(), row["prophylaxis"].ToString(), remove }; rows.Add(i); } return(rows); }