Beispiel #1
0
        private void LoadDefaultData()
        {
            //Binding data Role dropdown list
            ddlRoles.Items.Clear();
            ddlRoles.Items.Add(new ListItem("", "0"));

            IRoleTypeService  roleTypeService = new RoleTypeService();
            List <RoleTypeBO> roles           = roleTypeService.GetRoleTypes();

            for (int i = 0; i < roles.Count; i++)
            {
                ddlRoles.Items.Add(new ListItem(roles[i].RoleName, roles[i].RoleTypeId.ToString()));
            }

            //Department Dropdown list
            ddlDepartment.Items.Clear();
            ddlDepartment.Items.Add(new ListItem("", "0"));
            List <DepartmentBO> departments = this.MemberService.GetAllDepartment();

            foreach (DepartmentBO d in departments)
            {
                ddlDepartment.Items.Add(new ListItem(d.Name, d.DepartmentId.ToString()));
            }

            //Organization dropdown
            ddlOrganization.Items.Clear();
            ddlOrganization.Items.Add(new ListItem(string.Empty, "0"));
            List <OrganizationBO> orgs = this.MemberService.GetAllOrganization();

            foreach (OrganizationBO o in orgs)
            {
                ddlOrganization.Items.Add(new ListItem(o.Name, o.OrganizationId.ToString()));
            }

            //Binding gridview
            IMemberService memberService = new MemberService();
            string         orderBy       = "UserId ASC";

            grvMembers.DataSource = memberService.GetMembers(orderBy);
            grvMembers.DataBind();
        }
Beispiel #2
0
        private void FillDropDowns()
        {
            ddlRoleType.Items.Clear();


            IRoleTypeService  roleTypeService = new RoleTypeService();
            List <RoleTypeBO> roles           = roleTypeService.GetRoleTypes();

            for (int i = 0; i < roles.Count; i++)
            {
                ddlRoleType.Items.Add(new ListItem(roles[i].RoleName, roles[i].RoleTypeId.ToString()));
            }

            //Department Dropdown list
            ddlDepartment.Items.Clear();
            List <DepartmentBO> departments = this.MemberService.GetAllDepartment();

            foreach (DepartmentBO d in departments)
            {
                ddlDepartment.Items.Add(new ListItem(d.Name, d.DepartmentId.ToString()));
            }
        }