Exemplo n.º 1
0
        private void BindRoles()
        {
            BLL.Base_Role roles = new BLL.Base_Role();
            DataTable     dt    = new DataTable();

            dt = roles.GetAllList().Tables[0];
            this.rdoRoles.Items.Clear();
            foreach (DataRow r in dt.Rows)
            {
                rdoRoles.Items.Add(new ListItem(r["RoleName"].ToString(), r["RoleId"].ToString()));
            }
            if (rdoRoles.Items.Count != 0)
            {
                rdoRoles.SelectedIndex = 0;
            }
        }
Exemplo n.º 2
0
        private void bindDataSource()
        {
            DataTable dt = new DataTable();

            dt = bllRole.GetAllList().Tables[0];

            AspNetPager1.RecordCount = dt.Rows.Count;

            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = dt.DefaultView;
            pds.AllowPaging      = true;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize         = AspNetPager1.PageSize;

            this.dlAdmin.DataSource = pds;
            this.dlAdmin.DataBind();
        }