/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package beanAdmin;
import Business.business;
import EntityBean.Enroll;
import EntityBean.Users;
import helper.messages;
import helper.operationSession;
import java.util.ArrayList;
import java.util.List;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
/**
*
* @author Huynh Kim Toan
*/
@ManagedBean(name = "ADMIN_ViewInvole")
@RequestScoped
public class ViewInvolve {
private Users member1 = new Users();
private String titleEvent;
private String title;
private String userName;
private String memberID;
List<Enroll> lstInvolve = new ArrayList<Enroll>();
public ViewInvolve() {
}
public String allInvolve() {
title = titleEvent;
operationSession.ganGiaTriChoSession("tieude", title);
this.login = new business().getLoginFacade().getUserID((String) operationSession.layGTSession("user"));
if (this.login.getRoles().equals("admin")) {
return "/admin/viewInvolve";
} else {
return "/staff/viewInvolve";
}
}
public List<Enroll> getListInvolve() {
lstInvolve = new business().getInvolveFacade().getListEnroll((String) operationSession.layGTSession("tieude"));
return lstInvolve;
}
public List<Enroll> getListInvolveByMemberAndTitle() {
this.login = new business().getLoginFacade().getUserID((String) operationSession.layGTSession("user"));
lstInvolve = new business().getInvolveFacade().getEnrollUser( login.getUserID());
return lstInvolve;
}
public void user() {
// try {
// if (userName.length() ==0) {
// messages.taoTB(FacesMessage.SEVERITY_ERROR, "UserName not null .", "Error");
// } else {
// int ID = Integer.parseInt(memberID);
// this.member1 = new business().getMember1Facade().find(ID);
// if(member1 == null)
// {
// messages.taoTB(FacesMessage.SEVERITY_ERROR, "UserName not Exist .", "Error");
// }else
// {
// int userID = new business().getMember1Facade().find(ID).getLogin().getUserID();
// userName = new business().getLoginFacade().find(userID).getUsername();
// }
//
// }
// } catch (Exception ex) {
// messages.taoTB(FacesMessage.SEVERITY_ERROR, "Error .", "Error");
// }
}
public String getTitleEvent() {
return titleEvent;
}
public void setTitleEvent(String titleEvent) {
this.titleEvent = titleEvent;
}
public String getMemberID() {
return memberID;
}
public void setMemberID(String memberID) {
this.memberID = memberID;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
private Users login = new Users();
public Users getLogin() {
return login;
}
public void setLogin(Users login) {
this.login = login;
}
}