public String updatedUser() {

    try {
      if (validateForm(!true) && validateLoginForm(!updateLogin)) {

        WebClient client = IclubWebHelper.createCustomClient(BASE_URL + "mod");

        IclubPersonModel model = IclubPersonTrans.fromUItoWS(bean);

        model.setIclubPerson(getSessionUserId());

        ResponseModel response =
            client.accept(MediaType.APPLICATION_JSON).put(model, ResponseModel.class);
        client.close();

        if (response.getStatusCode() == 0) {
          return updateLogin();
        } else {
          IclubWebHelper.addMessage(
              "Fail :: " + response.getStatusDesc(), FacesMessage.SEVERITY_ERROR);
        }
      } else {
        IclubWebHelper.addMessage("Fail :: ", FacesMessage.SEVERITY_ERROR);
      }

    } catch (Exception e) {
      IclubWebHelper.addMessage("Fail :: " + e.getMessage(), FacesMessage.SEVERITY_ERROR);
    }

    return null;
  }
  public static IclubPersonModel fromORMtoWS(IclubPerson bean) {

    IclubPersonModel model = new IclubPersonModel();

    model.setPId(bean.getPId());
    model.setPCrtdDt(bean.getPCrtdDt());
    model.setPDob(bean.getPDob());
    model.setPEmail(bean.getPEmail());
    model.setPFName(bean.getPFName());
    model.setPIdNum(bean.getPIdNum());
    model.setPLName(bean.getPLName());
    model.setPAge(bean.getPAge());
    model.setPMobile(bean.getPMobile());
    model.setPAddress(bean.getPAddress());
    model.setPContactPref(bean.getPContactPref());
    model.setPGender(bean.getPGender());
    model.setPContactPref(bean.getPContactPref());
    model.setPIdExpiryDt(bean.getPIdExpiryDt());
    model.setPInitials(bean.getPInitials());
    model.setPIsPensioner(bean.getPIsPensioner());
    model.setPIdIssueCntry(bean.getPIdIssueCntry());
    model.setPIdIssueDt(bean.getPIdIssueDt());
    model.setPLat(bean.getPLat());
    model.setPLong(bean.getPLong());
    model.setPOccupation(bean.getPOccupation());
    model.setPTitle(bean.getPTitle());
    model.setPZipCd(bean.getPZipCd());
    model.setIclubIdType(bean.getIclubIdType() != null ? (bean.getIclubIdType().getItId()) : null);
    model.setItLongDesc(
        bean.getIclubIdType() != null ? (bean.getIclubIdType().getItLongDesc()) : null);
    model.setIclubPerson(bean.getIclubPerson() != null ? bean.getIclubPerson().getPId() : null);
    model.setIclubCohort(bean.getIclubCohort() != null ? bean.getIclubCohort().getCId() : null);
    model.setCEmail(bean.getIclubCohort() != null ? bean.getIclubCohort().getCEmail() : null);
    model.setIclubMaritalStatus(
        bean.getIclubMaritalStatus() != null ? (bean.getIclubMaritalStatus().getMsId()) : null);
    model.setMsLongDesc(
        bean.getIclubMaritalStatus() != null
            ? (bean.getIclubMaritalStatus().getMsLongDesc())
            : null);
    model.setPFNameAndLName(
        bean.getIclubPerson() != null
            ? bean.getIclubPerson().getPFName() + " " + bean.getIclubPerson().getPLName() != null
                ? bean.getIclubPerson().getPLName()
                : ""
            : "");
    model.setIclubCohortInvite(
        bean.getIclubCohortInvite() != null ? bean.getIclubCohortInvite().getCiId() : null);

    return model;
  }
  public String updatedPerson() {

    try {
      if (validateForm(!true)) {
        WebClient client = IclubWebHelper.createCustomClient(BASE_URL + "mod");

        IclubPersonModel model = IclubPersonTrans.fromUItoWS(bean);

        model.setIclubPerson(getSessionUserId());

        ResponseModel response =
            client.accept(MediaType.APPLICATION_JSON).put(model, ResponseModel.class);
        client.close();

        if (response.getStatusCode() == 0) {
          for (String doc : getDocIds()) {
            IclubDocumentModel docModel = new IclubDocumentModel();
            docModel.setDId(doc);
            docModel.setDEntityId(model.getPId().toString());
            docModel.setIclubEntityType(1l);
            WebClient docClient = IclubWebHelper.createCustomClient(D_BASE_URL + "mod");
            ResponseModel res =
                docClient.accept(MediaType.APPLICATION_JSON).put(docModel, ResponseModel.class);
            if (res.getStatusCode() == 0) LOGGER.info("Doc Merge Successful :: " + doc);
          }
          docIds = null;
          IclubWebHelper.addMessage("Updated Successfully", FacesMessage.SEVERITY_INFO);
          return "userDashboard";

        } else {
          IclubWebHelper.addMessage(
              "Fail :: " + response.getStatusDesc(), FacesMessage.SEVERITY_ERROR);
        }
      } else {
        IclubWebHelper.addMessage("Fail :: ", FacesMessage.SEVERITY_ERROR);
      }

    } catch (Exception e) {
      IclubWebHelper.addMessage("Fail :: " + e.getMessage(), FacesMessage.SEVERITY_ERROR);
    }

    return "";
  }