QueryUser.aspx.cs
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:2k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. namespace OThinker.H3.Portal
  12. {
  13.     public partial class QueryUser : PortalPage
  14.     {
  15.         protected void Page_Load(object sender, EventArgs e)
  16.         {
  17.             if (this.IsPostBack)
  18.             {
  19.                 this.lnkSearch_Click(this, new EventArgs());
  20.             }
  21.         }
  22.         protected void lnkSearch_Click(object sender, EventArgs e)
  23.         {
  24.             if (this.txtKeyword.Text == null || this.txtKeyword.Text.Trim() == "")
  25.             {
  26.                 this.NotifyMessage("请输入要查找的关键字");
  27.             }
  28.             System.Data.DataTable table = OThinker.H3.Server.Engine.Organization.QueryUser(this.txtKeyword.Text);
  29.             if (table.Rows.Count == 0)
  30.             {
  31.                 this.lblResult.Text = "没有找到符合条件的用户";
  32.             }
  33.             else
  34.             {
  35.                 this.lblResult.Text = null;
  36.             }
  37.             this.UserGrid.DataSource = table;
  38.             this.UserGrid.DataBind();
  39.         }
  40.         protected void UserGrid_RowDataBound(object sender, GridViewRowEventArgs e)
  41.         {
  42.             if (e.Row.RowType == DataControlRowType.DataRow)
  43.             {
  44.                 string id = e.Row.Cells[0].Text;
  45.                 HyperLink link = new HyperLink();
  46.                 link.NavigateUrl = PageName_EditUser + "?" + Param_ID + "=" + id;
  47.                 link.Text = "打开";
  48.                 e.Row.Cells[0].Controls.Add(link);
  49.             }
  50.         }
  51.     }
  52. }