Esempio n. 1
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        List <string> fulltext = new List <string>();
        string        str      = kword.Value.Replace("'", "");

        dateFrom = z.formatSearchDate(datepickerFrom.Value);
        dateTo   = z.formatSearchDate(datepickerTo.Value);
        if ((dateTo == "") || (dateTo == null))
        {
            dateTo = DateTime.Today.Date.ToString("yyyy-MM-dd");
        }
        foreach (string str2 in str.Split(new char[] { ' ' }))
        {
            if (str2 != "")
            {
                fulltext.Add(str2);
            }
        }
        if (selectSearchCriteria.SelectedValue == "product_title")
        {
            lt_mi = z.getAdminSearchPtInfoRS("4", "A_Contact", selectSearchCriteria.SelectedValue, fulltext, dateFrom, dateTo);
            if (lt_mi.Count <zues.PtInfo>() > 0)
            {
                criteria = string.Concat(new object[] { lt_mi.Count <zues.PtInfo>(), " result(s) found for search criteria (", kword.Value, ")!!" });
            }
            else
            {
                criteria = "No result found for search criteria (" + kword.Value + ")!!";
            }
        }
        else if (fulltext.Count <string>() == 1)
        {
            if (lt_mi.Count <zues.PtInfo>() > 0)
            {
                lt_mi = z.getAdminSearchPtInfoRS("1", "A_Contact", selectSearchCriteria.SelectedValue, fulltext, dateFrom, dateTo);
            }
            else
            {
                criteria = "No result found for search criteria (" + kword.Value + ")!!";
            }
        }
        else
        {
            criteria = "The Application number cannot be more one (1) !!";
        }
    }