public static DropDownList FillddlRoles(DropDownList ddl, int EVENT, int ID, string CODE) { ddl.Items.Clear(); var dt = BL_Roles.GetRoles(EVENT, ID, CODE); if (dt.Rows.Count > 0) { ddl.DataSource = dt; ddl.DataValueField = "ROLE_ID"; ddl.DataTextField = "ROLE_NAME"; ddl.DataBind(); ddl.Items.Insert(0, new ListItem("Select", "0", true)); } return(ddl); }
private void FillgvRoles() { DataTable dt = new DataTable(); dt = BL_Roles.GetRoles(1, 0, ""); if (dt.Rows.Count > 0) { gvUsersRoles.DataSource = dt; gvUsersRoles.DataBind(); } else { gvUsersRoles.DataSource = new string[] { }; gvUsersRoles.DataBind(); } }