Example #1
0
 public void deleteGroup(AjaxBehaviorEvent event) {
   Group group = groupModel.getRowData();
   DaoFactory.getInstance().getGroupDao().deleteGroup(group.getId());
   groupList.remove(group);
   fillGroupItem();
   //        getAllGroup();
 }
Example #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);
  }
Example #3
0
 private void getAllGroup() {
   groupList = DaoFactory.getInstance().getGroupDao().getAllGroup();
   fillGroupItem();
 }
Example #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");
 }
Example #5
0
 public void saveGroup(AjaxBehaviorEvent event) {
   DaoFactory.getInstance().getGroupDao().addGroup(groupEdit);
   groupList.add(groupEdit);
   fillGroupItem();
 }
Example #6
0
 public void updateGroup(AjaxBehaviorEvent event) {
   DaoFactory.getInstance().getGroupDao().updateGroup(groupEdit);
 }
Example #7
0
 public void deleteFilm(AjaxBehaviorEvent event) {
   Distribution distribution = filmModel.getRowData();
   DaoFactory.getInstance().getDistributionDao().removeDistribution(distribution.getId());
   filmList.remove(distribution);
   //        getAllFilm();
 }
Example #8
0
 private void getAllFilm() {
   filmList = DaoFactory.getInstance().getDistributionDao().getAllDistribution();
   allFilmList = new ArrayList<Distribution>(filmList);
 }