protected void btn_Sub_Click(object sender, EventArgs e) { int IDtemp; IDtemp = int.Parse(lb_CtrlId.Text); Core.Business.PageControlList pageCtrlList =CY.Common.Core.Business.PageControlList.Load(IDtemp); pageCtrlList.ControlID = tb_Ctrlname.Text; pageCtrlList.Save(); Core.Business.ControlPermissions.DeleteByCtrlId(IDtemp); 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.ControlPermissions Ctrlper=new CY.Common.Core.Business.ControlPermissions(); Ctrlper.ControlID=IDtemp; Ctrlper.PermissionsID=int.Parse(gv_Permissions.DataKeys[i].Value.ToString()); Ctrlper.Save(); } } }
protected void btn_sub_Click(object sender, EventArgs e) { Core.Business.PageControlList pcList = new CY.Common.Core.Business.PageControlList(); pcList.PageID = int.Parse(la_pageid.Text); pcList.ControlID = tb_CtrlName.Text; pcList.Save(); int CtrlId = pcList.Id; 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.ControlPermissions CtrlPer = new CY.Common.Core.Business.ControlPermissions(); CtrlPer.ControlID = CtrlId; CtrlPer.PermissionsID = int.Parse(gv_Permissions.DataKeys[i].Value.ToString()); CtrlPer.Save(); } } }