Skip to content
Snippets Groups Projects
Commit 06a467dd authored by Alfa-J's avatar Alfa-J
Browse files

agrege metodo a comentario

parent fb0b2896
Branches
Tags
No related merge requests found
......@@ -72,8 +72,25 @@ public class Comentario {
public boolean agregarSubComentario(int idComPadre, DtComentario dtC, Usuario usr){
if(this.id==idComPadre){
Comentario com = new Comentario();
com.setUsr(usr);
com.setId(Comentario.getNuevoID());
com.setFecha(dtC.getFecha());
com.setTexto(dtC.getTexto());
com.setNivelSubComentario(dtC.getNivelSubComentario());
this.misComentario.add(com);
return true;
}
else{
for(int i = 0; i< misComentario.size();i++){
if(this.misComentario.get(i).agregarSubComentario(idComPadre,dtC,usr)){
return true;
}
}
return false;
}
}
public DtComentario getDT(){
DtComentario dtC = new DtComentario(this.id, this.usr.getNickname(), this.fecha, this.texto, this.nivelSubComentario);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment