Exemplo n.º 1
0
  protected void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    int userId = Integer.parseInt(request.getSession().getAttribute("userId").toString());
    int documentId = Integer.parseInt(request.getSession().getAttribute("documentId").toString());
    long documentDate =
        Long.parseLong(request.getSession().getAttribute("documentDate").toString());

    int lawyerId = Integer.parseInt(request.getParameter("lawyerid"));

    DocumentPath path = new DocumentPath();
    String filesource = path.getDocumentPath(userId, documentId, documentDate);

    UserAccount account = new UserAccount();
    User user = account.findUserbyId(userId);

    LawyerAccount lawyeraccount = new LawyerAccount();
    Lawyer lawyer = lawyeraccount.getLawyerById(lawyerId);

    Mail mail = new Mail();
    // sending file to lawyer
    String lcontent =
        "Request came from user :"******" "
            + user.getLast_name()
            + "\n"
            + "contact no : "
            + user.getPhone_number()
            + "\n"
            + "email : "
            + user.getEmail()
            + "\n"
            + "address : \n "
            + user.getStreet_address()
            + "\n"
            + user.getCity()
            + "\n"
            + user.getState()
            + "\n Document is attached";

    mail.sendemail(
        lawyer.getEmail(), user.getEmail(), "Request for validation", lcontent, filesource);

    response.sendRedirect("../response.jsp?id=7");
  }
Exemplo n.º 2
0
 public void updateWorkout(
     final Long id,
     final User user,
     final Date date,
     final Long duration,
     final Double distance,
     final Long energy,
     final String discipline,
     final String debriefing,
     final String trackId)
     throws WorkoutNotFoundException, AccessDeniedException, TrackNotFoundException {
   final TrackImpl track =
       trackId != null && !trackId.isEmpty()
           ? fetchTrackForUpdate(user, Long.parseLong(trackId))
           : null;
   workoutStore.updateWorkout(
       id, user, date, duration, distance, energy, discipline, debriefing, track);
 }
Exemplo n.º 3
0
 public static TuserInfo findTuserInfo(String userno) {
   Long usernoLong = Long.parseLong(userno);
   return findTuserInfo(usernoLong);
 }
Exemplo n.º 4
0
 /** needed to map existing entities by carenotebook form processor * */
 public void setEmploymentId(String employmentId) {
   this.employmentId = Long.parseLong(employmentId);
 }
 private void abrirEstado() {
   TipoEstado te = TipoEstado.findById(Long.parseLong("1"));
   this.setEstado(te);
   this._save();
 }
Exemplo n.º 6
0
 /** needed to map existing entities by carenotebook form processor * */
 public void setStressId(String stressId) {
   this.stressId = Long.parseLong(stressId);
 }
Exemplo n.º 7
0
 /** needed to map existing entities by carenotebook form processor * */
 public void setFamilymemberId(String familymemberId) {
   this.familymemberId = Long.parseLong(familymemberId);
 }
Exemplo n.º 8
0
  /**
   * 이 객체를 리소스로 반환한다.
   *
   * <p>when: 권한검사시 사용
   *
   * @return 리소스
   */
  @Override
  public Resource asResource() {
    boolean isContainerProject = containerType.equals(ResourceType.PROJECT);
    final Project project;
    final Resource container;

    if (isContainerProject) {
      project = Project.find.byId(Long.parseLong(containerId));
      if (project == null) {
        throw new RuntimeException(messageForLosingProject());
      }
      container = project.asResource();
    } else {
      container = Resource.get(containerType, containerId);
      if (!(container instanceof GlobalResource)) {
        project = container.getProject();
        if (project == null) {
          throw new RuntimeException(messageForLosingProject());
        }
      } else {
        project = null;
      }
    }

    if (project != null) {
      return new Resource() {
        @Override
        public String getId() {
          return id.toString();
        }

        @Override
        public Project getProject() {
          return project;
        }

        @Override
        public ResourceType getType() {
          return ResourceType.ATTACHMENT;
        }

        @Override
        public Resource getContainer() {
          return container;
        }
      };
    } else {
      return new GlobalResource() {
        @Override
        public String getId() {
          return id.toString();
        }

        @Override
        public ResourceType getType() {
          return ResourceType.ATTACHMENT;
        }

        @Override
        public Resource getContainer() {
          return container;
        }
      };
    }
  }