Пример #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;
 }
Пример #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;
 }
Пример #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;
 }
Пример #4
0
 public String getTopRecFalse() throws Exception {
   List enterprises = enterpriseService.getTopRecFalse();
   result = new HashMap<String, Object>();
   result.put("en_list_false", enterprises);
   return SUCCESS;
 }
Пример #5
0
 public String getRecEnterprise() throws Exception {
   List enterprises = enterpriseService.getRecEnterprise(recommend);
   result = new HashMap<String, Object>();
   result.put("rec_en", enterprises);
   return SUCCESS;
 }
Пример #6
0
 public String getTopEnterprise() throws Exception {
   List enterprises = enterpriseService.getTopEnterprise(top);
   result = new HashMap<String, Object>();
   result.put("top_en", enterprises);
   return SUCCESS;
 }
Пример #7
0
 public String setRec() throws Exception {
   enterpriseService.setRec(eid, rec);
   return SUCCESS;
 }
Пример #8
0
 public String setTopEnterprise() throws Exception {
   enterpriseService.setTop(eid);
   return SUCCESS;
 }
Пример #9
0
 public String listAllEnterprise() throws Exception {
   List enterprises = enterpriseService.listAllEnterprise();
   result = new HashMap<String, Object>();
   result.put("enlist", enterprises);
   return SUCCESS;
 }