public string AutoCompleteReqDoc(string docName) { docName = docName.ToLower(); Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls(); var a = from dn in ws.GetCareprovider("").AsEnumerable() select dn; var result = (from dn in ws.GetCareprovider("").AsEnumerable() where dn.Field <string>("DoctorName").ToLower().Contains(docName) || dn.Field <string>("CTPCP_Desc").ToLower().Contains(docName) || dn.Field <string>("CTPCP_Code").ToLower().Contains(docName) select new docdata { DocNameE = dn.Field <string>("CTPCP_Desc"), DocNameT = dn.Field <string>("DoctorName"), DocCode = dn.Field <string>("CTPCP_Code") }).ToList(); string tmpStr = string.Empty; string tmpConj = "<,>"; foreach (docdata st in result) { string[] temp = st.DocNameE.Split('/'); tmpStr += st.DocCode + "/" + st.DocNameT + "/" + (temp != null ? temp[0] : "") + tmpConj; //+ st.DocCode+"," } if (!string.IsNullOrEmpty(tmpStr)) { tmpStr.Substring(1, tmpStr.Length - tmpConj.Length); } return(tmpStr); }
public List <DoctorProfile> GetDoctorData() { List <DoctorProfile> DocName = new List <DoctorProfile>(); try { using (Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls()) { DataTable dt = ws.GetCareprovider(""); if (dt != null) { var result = dt.AsEnumerable().Where(x => x.Field <string>("SSUSR_Initials") != null && x.Field <string>("CTPCP_Desc") != null) .Select(x => new DoctorProfile { SSUSR_Initials = x.Field <string>("SSUSR_Initials"), CTPCP_Desc = x.Field <string>("CTPCP_Desc"), CTPCP_Code = x.Field <string>("CTPCP_Code"), CTPCP_SMCNo = x.Field <string>("CTPCP_SMCNo") }).ToList(); result.Insert(0, new DoctorProfile { SSUSR_Initials = "", CTPCP_Desc = "", CTPCP_Code = "", CTCPT_Desc = "", DoctorName = "", CTPCP_SMCNo = "" }); DocName = result.ToList(); } } return(DocName); } catch { return(DocName); } }
public List <string> AutoCompleteReqDoc(string txt) { Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls(); List <string> result = (from t in ws.GetCareprovider(txt).AsEnumerable() where t.Field <string>("DoctorName").Contains(txt) select t.Field <string>("DoctorName")).ToList(); return(result); }