protected void btnCreateMember_Click(object sender, EventArgs e)
    {
        EnterpriseService enterpriseService = new EnterpriseService();

        OrganizationService  comBSO  = new OrganizationService();
        IList <Organization> listOrg = new List <Organization>();

        listOrg = comBSO.FindAll();
        SecurityBSO   securityBSO   = new SecurityBSO();
        AdminRolesBSO adminRolesBSO = new AdminRolesBSO();
        AdminBSO      adminBSO      = new AdminBSO();
        Utils         objUtil       = new Utils();
        MemberService memberService = new MemberService();

        foreach (Organization org in listOrg)
        {
            int STT = 0;
            IList <Enterprise> list = enterpriseService.FindList(0, 0, 0, org.Id, 0, 0, null, "", new ePower.Core.PagingInfo(1000, 1));
            foreach (Enterprise enter in list)
            {
                STT++;
                ePower.DE.Domain.Member member = new ePower.DE.Domain.Member();
                member.EnterpriseId = enter.Id;
                member.IsDelete     = false;
                member.AccountName  = "DN." + Utils.UCS2Convert(org.Title).Replace(" ", "").Replace("-", "").ToUpper() + "." + (STT).ToString("000");
                member.Password     = securityBSO.EncPwd("123456");
                memberService.Insert(member);
            }
        }
    }
    private void BindData()
    {
        EnterpriseService  comBSO = new EnterpriseService();
        IList <Enterprise> list   = new List <Enterprise>();
        int AreaId    = 0;
        int SubAreaId = 0;
        int OrgId     = 0;

        if (ddlOrg.SelectedIndex > 0)
        {
            OrgId = Convert.ToInt32(ddlOrg.SelectedValue);
        }
        ePower.Core.PagingInfo paging = new ePower.Core.PagingInfo(PageSize, CurrentPage);
        list = comBSO.FindList(0, AreaId, SubAreaId, OrgId, 0, 0, null, txtKeyword.Text.Trim(), paging);
        if (list != null && list.Count() > 0)
        {
            paging.RowsCount   = list[0].Total;
            Paging.PageSize    = PageSize;
            Paging.CurrentPage = CurrentPage;
            Paging.TotalRecord = list[0].Total;
            Paging.DataLoad();
            if (paging.PagesCount <= 1)
            {
                clientview.Text = "Có tổng số " + paging.RowsCount + " doanh nghiệp";
                Paging.Visible  = false;
            }
            else
            {
                clientview.Text = "Có " + list.Count() + " trong tổng số " + paging.RowsCount + " doanh nghiệp";
                Paging.Visible  = true;
            }
        }
        else
        {
            clientview.Text = "";
            Paging.Visible  = false;
        }
        grvNewsGroup.DataSource = list;

        grvNewsGroup.DataBind();
    }