Пример #1
0
 public void deleteGroup(AjaxBehaviorEvent event) {
   Group group = groupModel.getRowData();
   DaoFactory.getInstance().getGroupDao().deleteGroup(group.getId());
   groupList.remove(group);
   fillGroupItem();
   //        getAllGroup();
 }
Пример #2
0
  public void saveFilm(AjaxBehaviorEvent event) {
    WebBrowser webBrowser = new WebBrowser(LogEnum.WEB.getLog());
    try {
      webBrowser.goToUrl(filmEdit.getLinkRutracker());
      filmEdit.setTitle(webBrowser.getTitle());
    } catch (CoreException e) {
      // TODO Избавится от такого большого исключения сделать один статический метод
      FacesMessage error = new FacesMessage();
      error.setSeverity(FacesMessage.SEVERITY_ERROR);
      error.setSummary(e.getMessage());
      throw new ValidatorException(error);
    }

    if (filmEdit.getType() != TypeDistributionEnum.SERIALS.getType()) {
      filmEdit.setRegexpSerialNumber(null);
      filmEdit.setSeasonNumber(null);
    }
    DaoFactory.getInstance().getDistributionDao().addDistribution(filmEdit);
    if (filmList.size() > 0) filmList.add(0, filmEdit);
    filmList.add(filmEdit);
  }
Пример #3
0
 private void getAllGroup() {
   groupList = DaoFactory.getInstance().getGroupDao().getAllGroup();
   fillGroupItem();
 }
Пример #4
0
 public void updateFilm(AjaxBehaviorEvent event) {
   System.out.println("PRE UPDATE");
   System.out.println(filmEdit);
   DaoFactory.getInstance().getDistributionDao().updateDistribution(filmEdit);
   System.out.println("POST UPDATE");
 }
Пример #5
0
 public void saveGroup(AjaxBehaviorEvent event) {
   DaoFactory.getInstance().getGroupDao().addGroup(groupEdit);
   groupList.add(groupEdit);
   fillGroupItem();
 }
Пример #6
0
 public void updateGroup(AjaxBehaviorEvent event) {
   DaoFactory.getInstance().getGroupDao().updateGroup(groupEdit);
 }
Пример #7
0
 public void deleteFilm(AjaxBehaviorEvent event) {
   Distribution distribution = filmModel.getRowData();
   DaoFactory.getInstance().getDistributionDao().removeDistribution(distribution.getId());
   filmList.remove(distribution);
   //        getAllFilm();
 }
Пример #8
0
 private void getAllFilm() {
   filmList = DaoFactory.getInstance().getDistributionDao().getAllDistribution();
   allFilmList = new ArrayList<Distribution>(filmList);
 }