Package org.brain.bean

Source Code of org.brain.bean.AddCommentinfo

package org.brain.bean;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

import org.brain.dbo.DBOperate;
import org.brain.pojos.Commentinfo;
import org.brain.pojos.Document;
import org.brain.pojos.User;
import org.brain.tool.ToolBean;

@ManagedBean(name="addcommentinfo")
@SessionScoped
public class AddCommentinfo {
  private Integer commentid;
  private Document document;
  private String commentcontent;
  private Date date;
  private String commentuser;
  private Commentinfo com= new Commentinfo();
  int row = 0;
 
  public void initaddComment(){
    User user;
    user = ToolBean.getUserSession();
    commentuser=user.getUsername();
    boolean flag=false;
    com.setComdocumentid(commentid);
    com.setCommentcontent(commentcontent);
    date=new Date();
    com.setCommenttime( date);
    com.setCommentuser(commentuser);
    flag = DBOperate.save(com);
  }
  public int getRow() {
    return row;
  }
  public void setRow(int row) {
    this.row = row;
  }
  public Integer getCommentid() {
    return commentid;
  }
  public void setCommentid(Integer commentid) {
    this.commentid = commentid;
  }
  public Document getDocument() {
    return document;
  }
  public void setDocument(Document document) {
    this.document = document;
  }
  public String getCommentcontent() {
    return commentcontent;
  }
  public void setCommentcontent(String commentcontent) {
    this.commentcontent = commentcontent;
  }
  public Commentinfo getCom() {
    return com;
  }
  public void setCom(Commentinfo com) {
    this.com = com;
  }
  public Date getDate() {
    return date;
  }
  public void setDate(Timestamp date) {
    this.date =  date;
  }
  public String getCommentuser() {
    return commentuser;
  }
  public void setCommentuser(String commentuser) {
    this.commentuser = commentuser;
  }

}
 

TOP

Related Classes of org.brain.bean.AddCommentinfo

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.