Exemple #1
0
        /// <summary>
        /// 绑定GridView
        /// </summary>
        private void GridViewDataBind()
        {
            //员工姓名
            string name = txtEmployeeName.Text.Trim();
            //员工编号
            string employeeNo = txtEmployeeNo.Text.Trim();

            string where = string.Empty;
            if (!string.IsNullOrEmpty(name))
            {
                where += " AND name like '%" + name + "%'";
            }
            if (!string.IsNullOrEmpty(employeeNo))
            {
                where += " AND employeeNo like '%" + employeeNo + "%'";
            }
            DataSet   ds = aBll.GetListUnionEmp(where);
            DataTable dt = ds.Tables[0];

            gvData.DataSource = dt;
            gvData.DataBind();
        }