Beispiel #1
0
    protected void LoadFilterFields()
    {
        try
        {
            DataTable dt = Filtering.GetFilterFields(parentModule, Options);

            if (dt != null && dt.Rows.Count > 0)
            {
                //dt.DefaultView.Sort = "NAME";
                //dt = dt.DefaultView.ToTable();

                for (var i = 0; i <= dt.Rows.Count - 1; i++)
                {
                    HtmlGenericControl newLi = new HtmlGenericControl("li");
                    newLi.InnerText = dt.Rows[i]["NAME"].ToString();

                    if (dt.Rows[i]["FIELD"].ToString().Trim().ToUpper() == "HEADER")
                    {
                        newLi.Attributes["class"] = "filterFieldsHeader";
                    }
                    else
                    {
                        newLi.Attributes["id"]      = "filterCriteria_" + dt.Rows[i]["NAME"].ToString();
                        newLi.Attributes["field"]   = dt.Rows[i]["FIELD"].ToString();
                        newLi.Attributes["name"]    = dt.Rows[i]["NAME"].ToString();
                        newLi.Attributes["onclick"] = "skm_LockScreen('Gathering filters...'); filterField_Click(this); return false;";
                        newLi.Attributes["class"]   = "filterFieldsItem";
                    }

                    this.lstFilterFields.Controls.Add(newLi);
                }
            }
        }
        catch (Exception e)
        {
            LogUtility.LogException(e);
            throw e;
        }
    }