Exemplo n.º 1
0
    /// <summary>
    /// US:1945 US:1880 search the list of note titles
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSearchOptions_Click(object sender, EventArgs e)
    {
        //re-load the note titles
        lbNoteTitles.Items.Clear();

        CNoteTitleData ntd          = new CNoteTitleData(BaseMstr.BaseData);
        DataSet        dsNoteTitles = null;
        CStatus        status       = ntd.GetNoteTitleDS(out dsNoteTitles);

        if (!status.Status)
        {
            ShowStatusInfo(status);
            return;
        }

        lbNoteTitles.DataTextField = "note_title_label";
        //note: the tag is not unique so it cannot be used
        //as the datavaluefield, will map incorrectly...
        //lbNoteTitles.DataValueField = "note_title_tag";
        lbNoteTitles.DataValueField = "note_title_label";
        lbNoteTitles.DataSource     = dsNoteTitles;
        lbNoteTitles.DataBind();

        //filter the listbox using helper
        CListBox clb = new CListBox();

        clb.FilterListBox(lbNoteTitles, txtSearchOptions.Text);

        //show the parents MPE and then this controls MPE
        ShowMPE();
    }
Exemplo n.º 2
0
    /// <summary>
    /// event
    /// US:838
    /// handler for the Search button for filtering the options list.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSearchOptions_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(rblOptions.SelectedValue))
        {
            //clear current options
            lbOptions.Items.Clear();

            string strValue = rblOptions.SelectedValue;
            if (strValue == OPTION_PROVIDERS)
            {
                string strSearch    = txtSearchOptions.Text;
                string strFirstName = string.Empty;
                string strLastName  = string.Empty;

                string[] splitSearch = strSearch.Split(',');
                if (splitSearch.Length > 0)
                {
                    strLastName = splitSearch[0];
                }
                if (splitSearch.Length > 1)
                {
                    strFirstName = splitSearch[1];
                }

                if (strLastName.Length < 3)
                {
                    ShowStatusInfo(new CStatus(false, k_STATUS_CODE.Failed, "Please enter at least 3 characters to search for"));
                    return;
                }

                //1=providers
                //get the dataset from our db
                DataSet   dsUsers = null;
                CUserData ud      = new CUserData(BaseMstr.BaseData);
                CStatus   status  = ud.GetUserDS(strLastName, strFirstName, out dsUsers);

                CListBox lb = new CListBox();
                lb.RenderDataSet(dsUsers,
                                 lbOptions,
                                 "",
                                 "LAST_NAME,FIRST_NAME",
                                 "USER_ID");
            }
            else if (strValue == OPTION_TEAMS)
            {
                //load the team lb
                LoadOptionsListBox(false);
                //filter the listbox using helper
                CListBox clb = new CListBox();
                clb.FilterListBox(lbOptions, txtSearchOptions.Text);
            }
            else if (strValue == OPTION_SPECIALTIES)
            {
                //load the specialties lb
                LoadOptionsListBox(false);
                //filter the listbox using helper
                CListBox clb = new CListBox();
                clb.FilterListBox(lbOptions, txtSearchOptions.Text);
            }
            else if (strValue == OPTION_CLINICS)
            {
            }
            else if (strValue == OPTION_WARDS)
            {
                //load the wards lb
                LoadOptionsListBox(false);
                //filter the listbox using helper
                CListBox clb = new CListBox();
                clb.FilterListBox(lbOptions, txtSearchOptions.Text);
            }
        }
    }