예제 #1
0
파일: AreaBean.java 프로젝트: yaoliweb/cws
  public String adminAddSuccessAction() {
    if (areaSelectName == null) {
      FacesContext context = FacesContext.getCurrentInstance();
      String bundleName = context.getApplication().getMessageBundle();
      ResourceBundle messageBundle =
          ResourceBundle.getBundle(
              bundleName,
              context.getViewRoot().getLocale(),
              Thread.currentThread().getContextClassLoader());
      String prompt = messageBundle.getString("selectArea");

      FacesUtils.addErrorMessage(prompt);
      return null;
    } else {
      Administrator admin = new Administrator();
      String condition = " name ='" + this.areaSelectName + "'";
      area_admin = this.serviceLocator.getAreaService().queryAreaByCondition(condition).get(0);
      admin.setAdr(adr_admin);
      admin.setArea(area_admin);
      admin.setEmail(email_admin);
      admin.setName(name_admin);
      admin.setTel(tel_admin);
      this.serviceLocator.getAdminService().saveAdministrator(admin);
      return NavigationResults.ADMINADDSUCCESSACTION;
    }
  }
예제 #2
0
파일: AreaBean.java 프로젝트: yaoliweb/cws
  public String areaAddSuccessAction() {
    Area area = new Area();
    if ((areaSelectName == null) || (areaSelectName.equals(""))) {
      // superiorArea = 0;
      FacesContext context = FacesContext.getCurrentInstance();
      String bundleName = context.getApplication().getMessageBundle();
      ResourceBundle messageBundle =
          ResourceBundle.getBundle(
              bundleName,
              context.getViewRoot().getLocale(),
              Thread.currentThread().getContextClassLoader());
      String prompt = messageBundle.getString("selectSuperArea");

      FacesUtils.addErrorMessage(prompt);
      return null;
    } else {
      String condition = "name ='" + this.areaSelectName + "'";
      superiorArea =
          this.serviceLocator.getAreaService().queryAreaByCondition(condition).get(0).getAreaId();

      area.setSuperiorArea(superiorArea);
      area.setName(name);
      area.setIntro(intro);
      area.setPrincipal(principal);
      area.setTel(tel);
      area.setCoordinateX(coordinateX);
      area.setCoordinateY(coordinateY);
      this.serviceLocator.getAreaService().saveArea(area);
      return NavigationResults.AREAADDSUCCESSACTION;
    }
  }
예제 #3
0
파일: AreaBean.java 프로젝트: yaoliweb/cws
 public String adminEditAction() {
   administratorId = Integer.parseInt(FacesUtils.getRequestParameter("adminId"));
   Administrator admin =
       this.serviceLocator.getAdminService().queryAdministratorById(administratorId);
   area_admin = admin.getArea();
   areaSelectName = area_admin.getName();
   name_admin = admin.getName();
   tel_admin = admin.getTel();
   adr_admin = admin.getAdr();
   email_admin = admin.getEmail();
   return NavigationResults.ADMINEDITACTION;
 }
예제 #4
0
파일: AreaBean.java 프로젝트: yaoliweb/cws
  public String areaEditAction() {
    String areaId_s = FacesUtils.getRequestParameter("areaId");

    Area area = this.serviceLocator.getAreaService().queryAreaById(Integer.parseInt(areaId_s));
    areaId = area.getAreaId();
    superiorArea = area.getSuperiorArea();
    if (superiorArea == 0) {
      name_edit = "";
    } else {
      // name_edit = this.serviceLocator.getAreaService().queryAreaById(
      //		superiorArea).getName();
      name_edit = "无锡";
    }
    name = area.getName();
    intro = area.getIntro();
    principal = area.getPrincipal();
    tel = area.getTel();
    coordinateX = area.getCoordinateX();
    coordinateY = area.getCoordinateY();
    return NavigationResults.AREAEDITACTION;
  }