public void DeleteBcPermission(int permissionId, int permissionType, string moduleId, string funcPointId) { var entity = new BcPermissionEntity(); entity.UserRoleId = permissionId; entity.PermissionType = permissionType; entity.ModuleId = moduleId; entity.FuncPointId = funcPointId; EntityExecution.DeleteEntity(entity); }
private List<BcPermissionEntity> PrepareFormData() { var list = new List<BcPermissionEntity>(); foreach (TableRow row in this.gvBcPermission.Rows) { var hdModuleId = (HiddenField)row.Cells[0].FindControl("hdModuleId"); var hdFuncPointId = (HiddenField)row.Cells[1].FindControl("hdFuncPointId"); var cblPermissions = (CheckBoxList)row.Cells[2].FindControl("cblPermissions"); var entity = new BcPermissionEntity(); entity.PermissionType = int.Parse(this.hdPermissionType.Value); entity.UserRoleId = int.Parse(this.hdPermissionId.Value); entity.ModuleId = hdModuleId.Value; entity.FuncPointId = hdFuncPointId.Value; foreach (ListItem li in cblPermissions.Items) { if (li.Selected) entity.Permissions += li.Value + ","; } entity.Permissions = string.IsNullOrEmpty(entity.Permissions) ? string.Empty : entity.Permissions.Remove(entity.Permissions.Length - 1); list.Add(entity); } return list; }