Beispiel #1
0
 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.Delete(entity);
 }
 private List<BcPermissionEntity> PrepareFormData()
 {
     var list = new List<BcPermissionEntity>();
     foreach (TableRow row in 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(hdPermissionType.Value);
         entity.UserRoleId = int.Parse(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;
 }