예제 #1
0
    public static string[] GetDoctorNames(string prefixText, int count, string contextKey)
    {
        PatientInfoDAL Pat_Info = new PatientInfoDAL();
        List<string> Pat_List = new List<string>();
        Pat_Info = new PatientInfoDAL();
        Pat_List.Clear();
        DataTable Pat_Names;
        if (contextKey == "N")
            Pat_Names = Pat_Info.get_NurseNames(prefixText);
        else
            Pat_Names = Pat_Info.get_DoctorNames(prefixText);
        if (Pat_Names.Rows.Count > 0)
        {

            foreach (DataRow dr in Pat_Names.Rows)
            {
                Pat_List.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dr[1].ToString() + "," + dr[0].ToString(), dr[2].ToString()));
            }
        }
        else
        {
            Pat_List.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem("No Doctor Found..!", "0"));
        }
        return Pat_List.ToArray();
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string likeElementForSearchingDB = string.Empty;

        if (Request.QueryString.Count == 3)
        {
            likeElementForSearchingDB = Request.QueryString[2];

        }

        PatientInfoDAL objPat_Info = new PatientInfoDAL();

        objPat_Info = new PatientInfoDAL();

        DataTable Doc_Names = objPat_Info.get_DoctorNames(likeElementForSearchingDB);

        var sb = new StringBuilder();
        for (int i = 0; i < Doc_Names.Rows.Count; i++)
        {
            switch (i)
            {
                case 0:
                    sb.AppendFormat(keyValueFormater, Doc_Names.Rows[i][2], string.Format("{1}, {0} - {2}", Doc_Names.Rows[i][1], Doc_Names.Rows[i][0], Doc_Names.Rows[i][3]), "{", "}");
                    break;
                default:
                    sb.AppendFormat(keyValueFormaterIntermediatElement, Doc_Names.Rows[i][2], string.Format("{1}, {0} - {2}", Doc_Names.Rows[i][1], Doc_Names.Rows[i][0], Doc_Names.Rows[i][3]), "{", "}");
                    break;
            }
        }
        Response.Write(string.Format(jasonPacketFormater, sb.ToString()));
    }
예제 #3
0
 public static string[] GetDoctorNames(string prefixText, int count, string contextKey)
 {
     PatientInfoDAL Pat_Info = new PatientInfoDAL();
     List<string> Doc_List = new List<string>();
     Pat_Info = new PatientInfoDAL();
     Doc_List.Clear();
     DataTable Doc_Names = Pat_Info.get_DoctorNames(prefixText,  contextKey);
     if (Doc_Names.Rows.Count > 0)
     {
         foreach (DataRow dr in Doc_Names.Rows)
         {
             Doc_List.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dr[1].ToString().Trim() + "," + dr[0].ToString().Trim(), dr[2].ToString()));
         }
     }
     else
     {
         Doc_List.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem("No Doctor Found under selected Location.", "0"));
     }
     return Doc_List.ToArray();
 }