    public void execute(Event<UIGroupEditMembershipForm> event) throws Exception {
      UIGroupEditMembershipForm uiForm = event.getSource();
      UIApplication uiApp = event.getRequestContext().getUIApplication() ;
      OrganizationService service = uiForm.getApplicationComponent(OrganizationService.class);
      User user = service.getUserHandler().findUserByName(uiForm.membership.getUserName()) ;
      MembershipHandler memberShipHandler = service.getMembershipHandler();
      String memberShipType = uiForm.getUIFormSelectBox(MEMBER_SHIP).getValue();
      MembershipType membershipType = service.getMembershipTypeHandler().findMembershipType(memberShipType);
      try {
        memberShipHandler.removeMembership(uiForm.membership.getId(), true);
        memberShipHandler.linkMembership(user,uiForm.group,membershipType,true);
      } catch (Exception e) {
        uiApp.addMessage(new ApplicationMessage("UIGroupEditMembershipForm.msg.membership-delete", null)) ;
      }
      UIPopupWindow uiPopup = uiForm.getParent();
      uiPopup.setUIComponent(null);
      uiPopup.setShow(false);
    }

    public void execute(Event<UIGroupEditMembershipForm> event) throws Exception {
      UIGroupEditMembershipForm uiForm = event.getSource();
      UIApplication uiApp = event.getRequestContext().getUIApplication() ;
      UIPopupWindow uiPopup = uiForm.getParent();
      OrganizationService service = uiForm.getApplicationComponent(OrganizationService.class);
      String userName = uiForm.membership.getUserName();
      Group group = uiForm.group;
      User user = service.getUserHandler().findUserByName(userName) ;
      MembershipHandler memberShipHandler = service.getMembershipHandler();
      String memberShipType = uiForm.getUIFormSelectBox(MEMBER_SHIP).getValue();
      MembershipType membershipType = service.getMembershipTypeHandler().findMembershipType(memberShipType);
      Membership membership = memberShipHandler.findMembershipByUserGroupAndType(userName, group.getId(), membershipType.getName());
      if(membership != null){
        uiApp.addMessage(new ApplicationMessage("UIGroupEditMembershipForm.msg.membership-exist", null)) ;
        return ;
      }
      try {
        memberShipHandler.removeMembership(uiForm.membership.getId(), true);
        memberShipHandler.linkMembership(user,group,membershipType,true);
      } catch (Exception e) {
        uiApp.addMessage(new ApplicationMessage("UIGroupEditMembershipForm.msg.membership-delete", null)) ;
      }
      uiPopup.setUIComponent(null);
      uiPopup.setShow(false);
    }
