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;
 }
 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;
 }
 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;
 }
 public String getTopRecFalse() throws Exception {
   List enterprises = enterpriseService.getTopRecFalse();
   result = new HashMap<String, Object>();
   result.put("en_list_false", enterprises);
   return SUCCESS;
 }
 public String getRecEnterprise() throws Exception {
   List enterprises = enterpriseService.getRecEnterprise(recommend);
   result = new HashMap<String, Object>();
   result.put("rec_en", enterprises);
   return SUCCESS;
 }
 public String getTopEnterprise() throws Exception {
   List enterprises = enterpriseService.getTopEnterprise(top);
   result = new HashMap<String, Object>();
   result.put("top_en", enterprises);
   return SUCCESS;
 }
 public String setRec() throws Exception {
   enterpriseService.setRec(eid, rec);
   return SUCCESS;
 }
 public String setTopEnterprise() throws Exception {
   enterpriseService.setTop(eid);
   return SUCCESS;
 }
 public String listAllEnterprise() throws Exception {
   List enterprises = enterpriseService.listAllEnterprise();
   result = new HashMap<String, Object>();
   result.put("enlist", enterprises);
   return SUCCESS;
 }