Esempio n. 1
0
 public String pic() throws Exception {
   Enterprise en = (Enterprise) ActionContext.getContext().getSession().get("user");
   int id = en.getId();
   String pictures = enterpriseService.getEnPhotos(id);
   result = new HashMap<String, Object>();
   result.put("result", pictures);
   return SUCCESS;
 }
Esempio n. 2
0
 public String changepassword() throws Exception {
   session = ActionContext.getContext().getSession();
   Enterprise enterpise = (Enterprise) session.get("user");
   int id = enterpise.getId();
   String password = enterpriseService.getEnterpriseDAO().findById(id).getPassword();
   System.out.println(password + "---------------------");
   System.out.println(oldpassword + "----------------");
   System.out.println(newpassword + "---------------------");
   System.out.println(temppassword + "---------------------");
   if (!password.equals(oldpassword)) {
     //			System.out.println("old---------------------");
     return "passworderror";
   }
   if (!newpassword.equals(temppassword)) {
     //			System.out.println("new---------------------");
     return "newerror";
   }
   //		System.out.println(enterpise.getEmail());
   enterpriseService.savePassword(enterpise.getId(), newpassword);
   //		System.out.println(enterprise.getId()+"------------------");
   return SUCCESS;
 }
Esempio n. 3
0
 public String login() throws Exception {
   result = new HashMap<String, Object>();
   Enterprise enterprise = enterpriseService.isValidEnterprise(userid, password);
   if (enterprise != null) {
     session = ActionContext.getContext().getSession();
     session.clear();
     session.put("user", enterprise);
     result.put("success", true);
     System.out.println("success...............");
   } else {
     result.put("success", false);
     System.out.println("error...............");
   }
   return SUCCESS;
 }
Esempio n. 4
0
 public String getTopRecFalse() throws Exception {
   List enterprises = enterpriseService.getTopRecFalse();
   result = new HashMap<String, Object>();
   result.put("en_list_false", enterprises);
   return SUCCESS;
 }
Esempio n. 5
0
 public String getRecEnterprise() throws Exception {
   List enterprises = enterpriseService.getRecEnterprise(recommend);
   result = new HashMap<String, Object>();
   result.put("rec_en", enterprises);
   return SUCCESS;
 }
Esempio n. 6
0
 public String getTopEnterprise() throws Exception {
   List enterprises = enterpriseService.getTopEnterprise(top);
   result = new HashMap<String, Object>();
   result.put("top_en", enterprises);
   return SUCCESS;
 }
Esempio n. 7
0
 public String setRec() throws Exception {
   enterpriseService.setRec(eid, rec);
   return SUCCESS;
 }
Esempio n. 8
0
 public String setTopEnterprise() throws Exception {
   enterpriseService.setTop(eid);
   return SUCCESS;
 }
Esempio n. 9
0
 public String listAllEnterprise() throws Exception {
   List enterprises = enterpriseService.listAllEnterprise();
   result = new HashMap<String, Object>();
   result.put("enlist", enterprises);
   return SUCCESS;
 }