public static List <string> Searchlab(string prefixText, int count) { List <string> Labdetail = new List <string>(); ILabFunctions LabTestsMgrDate; LabTestsMgrDate = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory"); //List<string> lstDrugsDetail = GetLab(prefixText, count); DataTable dt = new DataTable(); dt = LabTestsMgrDate.FindLabByName(prefixText, 8, null); List <string> ar = new List <string>(); string custItem = string.Empty; if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { try { custItem = AutoCompleteExtender.CreateAutoCompleteItem( row["LabName"].ToString(), String.Format("{0};{1};{2};{3}", row["LabTestID"], row["LabName"], row["labdepartmentname"], row["DataType"] ) ); ar.Add(custItem); } catch { } } } return(ar); }
/// <summary> /// Gets the lab. /// </summary> /// <param name="prefixText">The prefix text.</param> /// <param name="count">The count.</param> /// <returns></returns> public static List <Labs> GetLab(string prefixText, int count) { List <Labs> items = new List <Labs>(); ILabFunctions LabTestsMgrDate; LabTestsMgrDate = (ILabFunctions)ObjectFactory.CreateInstance("BusinessProcess.Laboratory.BLabFunctions, BusinessProcess.Laboratory"); //string query; //query = "Exec dbo.Laboratory_GetLabTestID @LabName='" + prefixText + "' ,@ExcludeLabDepartment=8"; // DataTable dt = LabTestsMgrDate.ReturnLabQuery(query); DataTable dt = new DataTable(); dt = LabTestsMgrDate.FindLabByName(prefixText, null, 8); HttpContext.Current.Session["DTLABRESULT"] = dt; if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { try { Labs item = new Labs(); item.SubTestId = (int)row["LabTestID"]; item.SubTestName = (string)row["LabName"]; item.LabDepartmentId = (int)row["LabDepartmentID"]; item.LabDepartmentName = (string)row["labdepartmentname"]; item.DataType = row["DataType"].ToString(); items.Add(item); } catch { } } } return(items); }