public void BindData() { #region //if (!Context.User.Identity.IsAuthenticated) //{ // return; //} //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name); //if (user.HasPermissionID(PermId_Modify)) //{ // gridView.Columns[6].Visible = true; //} //if (user.HasPermissionID(PermId_Delete)) //{ // gridView.Columns[7].Visible = true; //} #endregion DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); if (txtKeyword.Text.Trim() != "") { // 请修改 keywordField 为需要匹配查询的真实字段名称 //strWhere.AppendFormat("keywordField like '%{0}%'", txtKeyword.Text.Trim()); strWhere.AppendFormat("RealName like '%{0}%' or UserName like '%{0}%' or Gender like '%{0}%' or BornDate like '%{0}%' or Phone like '%{0}%' or Address like '%{0}%' or IDNumber like '%{0}%' or RoleName like '%{0}%'", txtKeyword.Text.Trim()); } ds = bll.GetList(strWhere.ToString()); gridView.DataSource = ds; gridView.DataBind(); }
private void ShowInfo(int UID) { CHSS.BLL.CUser bll = new CHSS.BLL.CUser(); CHSS.Model.CUser model = bll.GetModel(UID); this.UID.Text = model.UID.ToString(); this.RealName.Text = model.RealName; this.UserName.Text = model.UserName; this.Password.Text = model.Password + " (加密)"; this.Gender.Text = model.Gender; this.BornDate.Text = model.BornDate; this.Phone.Text = model.Phone; this.Address.Text = model.Address; this.IDNumber.Text = model.IDNumber; this.RoleName.Text = bll.GetList("UID=" + UID.ToString()).Tables[0].Rows[0]["RoleName"].ToString(); }