public void TestMethod1() { RolesManager dal = new RolesManager(); //断言 Assert.IsTrue(dal.GetAll().Count < 0); }
private void BindRoleDropDown(DropDownList ddl) { RolesManager rolesManager = new RolesManager(); ddl.DataSource = rolesManager.GetAll(); ddl.DataBind(); ddl.Items.Insert(0, new ListItem("--Select--")); }
static void Main(string[] args) { ILogger logger = new NLogLogger("test"); ITeamMembersRepository teamMembersRepository = new EFTeamMembersRepository(logger); IRolesRepository rolesRepository = new EFRolesRepository(logger); ITodosRepository todosrepository = new EFTodosRepository(logger); ITeamMembersManager teamMembersManager = new TeamMembersManager(teamMembersRepository, logger); IRolesManager rolesManager = new RolesManager(rolesRepository, logger); ITodosManager todosManager = new TodosManager(todosrepository, logger); var roleList = rolesManager.GetAll(); var scrumMasterRole = rolesManager.GetById(1); var josafat = teamMembersManager.GetById(2); rolesManager.SetRolesFor(josafat, new List <Role>() { scrumMasterRole }); }
protected void grvUsers_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (grvUsers.EditIndex == e.Row.RowIndex) { DropDownList ddlRoleName = (DropDownList)e.Row.FindControl("ddlGridRoleName"); RolesManager rolesManager = new RolesManager(); ddlRoleName.DataSource = rolesManager.GetAll(); ddlRoleName.DataBind(); var roleName = (e.Row.FindControl("lblRoleName") as Label).Text; var selectedItem = ddlRoleName.Items.FindByValue(roleName); selectedItem.Selected = true; //ddlUnitTypes.Items.FindByText((e.Row.FindControl("lblUnitType") as Label).Text).Selected = true; } } }
private void RepeaterData() { int nowpage = 1; if (Request.QueryString["nowpage"] != null) { nowpage = int.Parse(Request.QueryString["nowpage"]); } if (nowpage == 1) { hlfirst.Enabled = false; hlprev.Enabled = false; } if (nowpage == pages) { hllast.Enabled = false; hlnext.Enabled = false; } this.Repeater1.DataSource = RolesManager.GetAll(nowpage); this.Repeater1.DataBind(); this.lblsum.Text = RolesManager.GetSumCount().ToString(); this.lblpage.Text = nowpage.ToString(); this.lblpages.Text = pages.ToString(); if (nowpage != pages) { this.lblone.Text = "7"; } else { this.lblone.Text = (RolesManager.GetSumCount() - 7 * (nowpage - 1)).ToString(); } hlfirst.NavigateUrl = "~/MusicGL/MusicTypeGL.aspx?nowpage=" + 1; hlnext.NavigateUrl = "~/MusicGL/MusicTypeGL.aspx?nowpage=" + (nowpage + 1).ToString(); hlprev.NavigateUrl = "~/MusicGL/MusicTypeGL.aspx?nowpage=" + (nowpage - 1).ToString(); hllast.NavigateUrl = "~/MusicGL/MusicTypeGL.aspx?nowpage=" + (pages); }
public List <Roles> GetRoles() { return(rolesManager.GetAll()); }
public IList <Roles> GetAll() { return(rm.GetAll()); }
private void BindRolesGrid() { grvRoles.DataSource = rolesManager.GetAll(); grvRoles.DataBind(); }