当前位置: 首页>>代码示例>>C#>>正文


C# User.GetUsersByType方法代码示例

本文整理汇总了C#中User.GetUsersByType方法的典型用法代码示例。如果您正苦于以下问题:C# User.GetUsersByType方法的具体用法?C# User.GetUsersByType怎么用?C# User.GetUsersByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在User的用法示例。


在下文中一共展示了User.GetUsersByType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitialDataBind

        private void InitialDataBind()
        {
            DataSet ds;

            #region 绑定用户下拉列表
            string[] str = new string[3] { "AA", "AG", "PG" };

            User user = new User();

            this.ddlUser.Items.Clear();
            for (int i = 0; i < str.Length; i++)
            {
                ds = new DataSet();
                ds = user.GetUsersByType(str[i].ToString(), "");

                for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                {
                    string userID = ds.Tables[0].Rows[j]["UserID"].ToString();
                    string userName = ds.Tables[0].Rows[j]["UserName"].ToString();

                    ListItem li = new ListItem(userName, userID);
                    this.ddlUser.Items.Add(li);
                }

                ds.Dispose();
            }
            #endregion

            #region 绑定角色
            int userid = Convert.ToInt32(this.ddlUser.SelectedValue);
            FillSelectedRoleList(userid);
            FillAllRoleList(userid);
            #endregion
        }
开发者ID:tianyaalone,项目名称:Water125,代码行数:34,代码来源:UserRoleAssignment.aspx.cs

示例2: dataBind

 protected void dataBind()
 {
     string usertype = DropUserType.SelectedValue;
     string key=this.TextBox1.Text.Trim();
     User userAdmin=new User();
     DataSet ds=new DataSet();
     if (usertype != "")
     {
         ds = userAdmin.GetUsersByType(usertype, key);
     }
     else
     {
         ds = userAdmin.GetAllUsers(key);
     }
     int pageIndex=this.DataGrid1.CurrentPageIndex;
     DataGrid1.DataSource=ds.Tables[0].DefaultView;
     int record_Count=ds.Tables[0].Rows.Count;
     int page_Size=DataGrid1.PageSize;
     int totalPages = int.Parse(Math.Ceiling((double)record_Count/page_Size).ToString());
     if(totalPages>0)
     {
         if (pageIndex>totalPages-1)
             pageIndex = totalPages-1;
     }
     else
     {
         pageIndex=0;
     }
     DataGrid1.CurrentPageIndex=pageIndex;
     DataGrid1.DataBind();
 }
开发者ID:suizhikuo,项目名称:SourceCollection,代码行数:31,代码来源:UserAdmin.aspx.cs

示例3: LoadUsers

 private void LoadUsers()
 {
     string usertype = "AA";
     User userAdmin = new User();
     DataSet ds = userAdmin.GetUsersByType(usertype, "");
     DropUserlist.DataSource = ds.Tables[0];
     DropUserlist.DataTextField = "UserName";
     DropUserlist.DataValueField = "UserID";
     DropUserlist.DataBind();
 }
开发者ID:tianyaalone,项目名称:Water125,代码行数:10,代码来源:UserAssignmentRole.aspx.cs

示例4: dataBind

		protected void dataBind()
		{
            string usertype = DropUserType.SelectedValue;
			string key=this.TextBox1.Text.Trim();
		    Session["AccountsAdminKey"] = key;
			User userAdmin=new User();
			DataSet ds=new DataSet();
            if (usertype != "")
            {
                ds = userAdmin.GetUsersByType(usertype, key);
            }
            else
            {
                ds = userAdmin.GetUserList(key);
            }
			int pageIndex=this.DataGrid1.CurrentPageIndex;
            Session["AccountsAdminPage"] = pageIndex;
			DataGrid1.DataSource=ds.Tables[0].DefaultView;
			int record_Count=ds.Tables[0].Rows.Count;
			int page_Size=DataGrid1.PageSize;
			int totalPages = int.Parse(Math.Ceiling((double)record_Count/page_Size).ToString());
			if(totalPages>0)
			{
				if (pageIndex>totalPages-1) 
					pageIndex = totalPages-1;				
			}
			else
			{
				pageIndex=0;
			}
			DataGrid1.CurrentPageIndex=pageIndex;
			DataGrid1.DataBind();

            //显示数量
            if (this.DataGrid1.CurrentPageIndex == 0)
            {
                btnFirst.Enabled = false;
                btnPrev.Enabled = false;
                if (this.DataGrid1.PageCount == 1)
                {
                    btnLast.Enabled = false;
                    btnNext.Enabled = false;
                }
            }
            else if (this.DataGrid1.CurrentPageIndex == this.DataGrid1.PageCount - 1)
            {
                btnLast.Enabled = false;
                btnNext.Enabled = false;
            }
            this.lblpagesum.Text = totalPages.ToString();
            this.lblpage.Text = (pageIndex + 1).ToString();
            this.lblrowscount.Text = record_Count.ToString();
		}
开发者ID:tianyaalone,项目名称:Water125,代码行数:53,代码来源:UserAdmin.aspx.cs

示例5: InitialDataBind

        private void InitialDataBind()
        {
            DataSet ds;

            #region 绑定用户下拉列表
            string[] str = new string[3] { "AA", "AG", "PG" };

            User user = new User();

            for (int i = 0; i < str.Length;i++ )
            {
                ds = new DataSet();
                ds = user.GetUsersByType(str[i].ToString(),"");

                for (int j = 0; j < ds.Tables[0].Rows.Count;j++ )
                {
                    string userID = ds.Tables[0].Rows[j]["UserID"].ToString();
                    string userName = ds.Tables[0].Rows[j]["UserName"].ToString();

                    ListItem li = new ListItem(userName,userID);
                    this.ddlUser.Items.Add(li);
                }

                ds.Dispose();
            }
            #endregion

            #region 绑定代理商列表

            string strWhere = "";
            MmyeeAd.BLL.ADManage.AdAgent bll = new MmyeeAd.BLL.ADManage.AdAgent();

            ds = new DataSet();
            ds = bll.GetList(strWhere);

            for (int i = 0; i < ds.Tables[0].Rows.Count;i++ )
            {
                string agentID = ds.Tables[0].Rows[i]["AgentID"].ToString();
                string agentName = ds.Tables[0].Rows[i]["AgentName"].ToString();

                ListItem li = new ListItem(agentName, agentID);
                this.AllAgentList.Items.Add(li);
            }

            ds.Dispose();

            #endregion
        }
开发者ID:tianyaalone,项目名称:Water125,代码行数:48,代码来源:UserAgentAdmin.aspx.cs


注:本文中的User.GetUsersByType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。