Example #1
0
        protected void btn_sub_Click(object sender, EventArgs e)
        {
            Core.Business.PageList pagelist = new CY.Common.Core.Business.PageList();
            pagelist.PageName = tb_PageName.Text;
            pagelist.PageURI = tb_PageURI.Text;
            pagelist.Save();

            for (int i = 0; i < gv_Permissions.Rows.Count; i++)
            {
                CheckBox cb = new CheckBox();
                cb = (CheckBox)gv_Permissions.Rows[i].FindControl("chk");
                if (cb.Checked)
                {
                    Core.Business.PagePermissions pagepermission = new CY.Common.Core.Business.PagePermissions();
                    pagepermission.PageID = pagelist.Id;
                    pagepermission.PermissionsID=int.Parse(gv_Permissions.DataKeys[i].Value.ToString());
                    pagepermission.Save();
                }

            }
            ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>window.location.href='./AddPageControl.aspx?pageid=" + pagelist.Id + "';</script>");
        }
Example #2
0
        protected void btn_sub_Click(object sender, EventArgs e)
        {
            Core.Business.PageList pagelist = CY.Common.Core.Business.PageList.Load(int.Parse(lb_pageid.Text));
            pagelist.PageName = tb_PageName.Text;
            pagelist.PageURI = tb_PageURI.Text;
            pagelist.Save();

            CY.Common.Core.Business.PagePermissions.SqlDeletePagePermissionsByPageId(int.Parse(lb_pageid.Text));
            for (int i = 0; i < gv_Permissions.Rows.Count; i++)
            {
                CheckBox cb = new CheckBox();
                cb = (CheckBox)gv_Permissions.Rows[i].FindControl("chk");
                if (cb.Checked)
                {
                    Core.Business.PagePermissions pagepermission = new CY.Common.Core.Business.PagePermissions();
                    pagepermission.PageID = int.Parse(lb_pageid.Text);
                    pagepermission.PermissionsID = int.Parse(gv_Permissions.DataKeys[i].Value.ToString());
                    pagepermission.Save();
                }

            }
        }