Esempio n. 1
0
        public void BindData()
        {
            DataSet       ds       = new DataSet();
            StringBuilder strWhere = new StringBuilder();

            switch (ddlStatus.SelectedItem.Value)
            {
            case "0":
                strWhere.AppendFormat(" Status ='1' ");
                break;

            case "1":
                strWhere.AppendFormat(" Status ='0' ");
                break;

            case "2":
                strWhere.AppendFormat(" Status in('0','1') ");
                break;

            default:
                strWhere.AppendFormat(" Status in('0','1') ");
                break;
            }
            if (txtKeyword.Text.Trim() != "")
            {
                strWhere.AppendFormat(" and DepartName like '%{0}%' ", txtKeyword.Text.Trim());
            }
            else
            {
                strWhere.AppendFormat("");
            }
            ds = bll.GetList(strWhere.ToString());
            gridView.DataSource = ds;
            gridView.DataBind();
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Repeater1.DataSource = departBll.GetList(" Status!='0' and Weight>0 order by Weight desc");
     Repeater1.DataBind();
 }