コード例 #1
0
        public void TestMethod1()
        {
            RolesManager dal = new RolesManager();

            //断言
            Assert.IsTrue(dal.GetAll().Count < 0);
        }
コード例 #2
0
ファイル: Users.aspx.cs プロジェクト: prakashdgl/PMS
        private void BindRoleDropDown(DropDownList ddl)
        {
            RolesManager rolesManager = new RolesManager();

            ddl.DataSource = rolesManager.GetAll();
            ddl.DataBind();
            ddl.Items.Insert(0, new ListItem("--Select--"));
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: jvarahuayta/demo-winforms
        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
            });
        }
コード例 #4
0
ファイル: Users.aspx.cs プロジェクト: prakashdgl/PMS
        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;
                }
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public List <Roles> GetRoles()
 {
     return(rolesManager.GetAll());
 }
コード例 #7
0
ファイル: RolesService.cs プロジェクト: imsrui/YD10.30
 public IList <Roles> GetAll()
 {
     return(rm.GetAll());
 }
コード例 #8
0
ファイル: Roles.aspx.cs プロジェクト: prakashdgl/PMS
 private void BindRolesGrid()
 {
     grvRoles.DataSource = rolesManager.GetAll();
     grvRoles.DataBind();
 }