Ejemplo n.º 1
0
        private void BinList()
        {
            this.lv_ThongTinSP.DataSource = MemberGroupDAO.DanhSachTinhNangChucNang(function_Group_ID);
            this.lv_ThongTinSP.DataBind();
            var ddl_FunctionName = (DropDownList)this.lv_ThongTinSP.InsertItem.FindControl("ddl_FunctionName");

            ddl_FunctionName.DataSource     = MemberGroupDAO.DanhSachTinhNang();
            ddl_FunctionName.DataValueField = "FunctionName_ID";
            ddl_FunctionName.DataTextField  = "FunctionName";
            ddl_FunctionName.DataBind();
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.objCheckPermision.Permission(this.objCheckPermision.LayQuyen("strNhomThanhVien_Them")))
     {
         if (!this.IsPostBack)
         {
             tinhNangCount = MemberGroupDAO.DanhSachTinhNang().Count();
             this.BindData();
         }
     }
     else
     {
         this.htmlMemberGroupEdit.Visible = false;
         this.objControl.LoadMyControl(this.idPermissionAccess, NotPermissControl);
     }
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.objCheckPermision.Permission(this.objCheckPermision.LayQuyen("strNhomThanhVien_Sua")))
     {
         if (!this.IsPostBack)
         {
             if (Common.RequestID("id") != "")
             {
                 tinhNangCount = MemberGroupDAO.DanhSachTinhNang().Count();
                 GroupID       = Int32.Parse(Common.RequestID("id"));
                 this.BindData();
             }
             else
             {
                 this.Response.Redirect("quan-ly-nhom-thanh-vien");
             }
         }
     }
     else
     {
         this.htmlMemberGroupEdit.Visible = false;
         this.objControl.LoadMyControl(this.idPermissionAccess, NotPermissControl);
     }
 }
Ejemplo n.º 4
0
        public void BindData()
        {
            #region LoadThongTin

            var it = MemberGroupDAO.getGroupByID(GroupID);
            this.txt_GroupName.Text = it.GroupName;
            this.txt_GroupDesc.Text = it.GroupDesc;
            this.ckb_Active.Checked = it.Active;

            #endregion

            #region Quyền hạn trong từng chức năng

            #region Header

            this.tbl.Append(
                "<div style='padding: 2px; margin: 5px 0px 5px 0px;' class='ui-widget-content ui-corner-top ui-corner-bottom'><div><table cellspacing='0' border='1' style='width: 100%; border-collapse: collapse;' rules='all' class='adminlist'><tbody> <tr> <th scope='col'>Nhóm chức năng</th>");
            foreach (TBT_AdminFunctionName t1 in MemberGroupDAO.DanhSachTinhNang())
            {
                this.tbl.Append(String.Format("<th scope='col'>{0}</th>", t1.FunctionName));
            }
            this.tbl.Append("</tr>");

            #endregion

            #region Content

            foreach (var t1 in MemberGroupDAO.DanhSachNhomChucNang())
            {
                for (int i = 0; i < tinhNangCount; i++)
                {
                    this.Permission[i] = false;
                    this.bcheck[i]     = string.Empty;
                }
                this.tbl.Append("<tr class='row0'>");
                this.tbl.Append("    <td align='left' width='25%'>");
                this.tbl.Append(
                    String.Format(
                        "        <a href='JavaScript:checkAllGroupItem({0},document.aspnetForm.chbFunc{0})' class='member_list'>{1}</a>",
                        t1.Function_Group_ID,
                        t1.FunctionGroupName));
                this.tbl.Append("    </td>");
                foreach (var t2 in MemberGroupDAO.DanhSachTinhNangChucNang1(t1.Function_Group_ID))
                {
                    int id = (int)(t2.TBT_AdminFunctionName.FunctionOrder - 1);
                    this.Permission[id]        = true;
                    this.Function_Group_Id[id] = t1.Function_Group_ID;
                    this.Function_Id[id]       = t2.Function_ID;
                    if (
                        MemberGroupDAO.DanhSachQuyenHanNhomThanhVien().Any(p => p.Group_ID == GroupID && p.Function_ID == t2.Function_ID))
                    {
                        this.bcheck[id] = " checked ";
                    }
                }

                for (int i = 0; i < tinhNangCount; i++)
                {
                    if (this.Permission[i])
                    {
                        this.tbl.Append("<td align='center'>");
                        this.tbl.Append(
                            String.Format(
                                "<input type='checkbox' name='chbFunc{0}' value='check' id='{1}' {2}>",
                                this.Function_Id[i],
                                this.Function_Group_Id[i],
                                this.bcheck[i]));
                        this.tbl.Append("</td>");
                    }
                    else
                    {
                        this.tbl.Append("<td align='center'>");
                        this.tbl.Append("&nbsp;");
                        this.tbl.Append("</td>");
                    }
                }
                this.tbl.Append("</tr>");
            }
            this.tbl.Append("</tbody></table></div></div>");

            #endregion

            #endregion

            this.htmlMemberGroupEdit.InnerHtml = this.tbl.ToString();
        }
Ejemplo n.º 5
0
 private void BinList()
 {
     this.lv_ThongTinSP.DataSource = MemberGroupDAO.DanhSachTinhNang();
     this.lv_ThongTinSP.DataBind();
 }
Ejemplo n.º 6
0
        public void BindData()
        {
            #region Quyền hạn trong từng chức năng

            #region Header

            this.tbl.Append(
                "<div style='padding: 2px; margin: 5px 0px 5px 0px;' class='ui-widget-content ui-corner-top ui-corner-bottom'><div><table cellspacing='0' border='1' style='width: 100%; border-collapse: collapse;' rules='all' class='adminlist'><tbody> <tr> <th scope='col'>Nhóm chức năng</th>");
            foreach (TBT_AdminFunctionName t1 in MemberGroupDAO.DanhSachTinhNang())
            {
                this.tbl.Append(String.Format("<th scope='col'>{0}</th>", t1.FunctionName));
            }
            this.tbl.Append("</tr>");

            #endregion

            #region Content

            foreach (TBT_AdminFunctionGroup t1 in MemberGroupDAO.DanhSachNhomChucNang())
            {
                for (int i = 0; i < tinhNangCount; i++)
                {
                    this.Permission[i] = false;
                    this.bcheck[i]     = string.Empty;
                }
                this.tbl.Append("<tr class='row0'>");
                this.tbl.Append("    <td align='left' width='25%'>");
                this.tbl.Append(
                    String.Format(
                        "        <a href='JavaScript:checkAllGroupItem({0},document.aspnetForm.chbFunc{0})' class='member_list'>{1}</a>",
                        t1.Function_Group_ID,
                        t1.FunctionGroupName));
                this.tbl.Append("    </td>");
                int ID = -1;
                foreach (TBT_AdminFunction t2 in MemberGroupDAO.DanhSachTinhNangChucNang1(t1.Function_Group_ID))
                {
                    ID++;
                    this.Permission[ID]        = true;
                    this.Function_Group_Id[ID] = t1.Function_Group_ID;
                    this.Function_Id[ID]       = t2.Function_ID;
                }

                for (int i = 0; i < tinhNangCount; i++)
                {
                    if (this.Permission[i])
                    {
                        this.tbl.Append("<td align='center'>");
                        this.tbl.Append(
                            String.Format(
                                "<input type='checkbox' name='chbFunc{0}' value='check' id='{1}'>",
                                this.Function_Id[i],
                                this.Function_Group_Id[i]));
                        this.tbl.Append("</td>");
                    }
                    else
                    {
                        this.tbl.Append("<td align='center'>");
                        this.tbl.Append("&nbsp;");
                        this.tbl.Append("</td>");
                    }
                }
                this.tbl.Append("</tr>");
            }
            this.tbl.Append("</tbody></table></div></div>");

            #endregion

            #endregion

            this.htmlMemberGroupEdit.InnerHtml = this.tbl.ToString();
        }