Пример #1
0
 @Override
 public void getObject(String id) {
   IDepartmentBN departmentBN = Lookup.getDefault().lookup(IDepartmentBN.class);
   Department department = departmentBN.getByObjectId(id);
   if (department != null) {
     DepartmentExt_W43 bean = dao.getByObjectId(String.valueOf(department.getId()));
     tableSB32.setValueAt(bean.getSumMoneyImport(), 0, 1);
     tableSB32.setValueAt(bean.getSumMoneyExport(), 0, 3);
     tableSB32.setValueAt(bean.getSumprofit(), 1, 1);
     tableSB32.setValueAt(bean.getProportionProfit(), 1, 3);
     tableSB32.setValueAt(" ", 2, 1);
     tableSB32.setValueAt(" ", 2, 3);
   }
 }
Пример #2
0
  @Override
  public IEntity save() {
    if (idDepartment == 0) {
      return null;
    }
    float sumMoneyImport = Float.parseFloat(tableSB32.getValueAt(0, 1).toString().trim());
    float sumMoneyExport = Float.parseFloat(tableSB32.getValueAt(0, 3).toString().trim());
    float sumProfit = Float.parseFloat(tableSB32.getValueAt(1, 1).toString().trim());
    String proportionProfit = tableSB32.getValueAt(1, 3).toString().trim();
    String estimate = tableSB32.getValueAt(2, 1).toString().trim();

    DepartmentExt_W43 bean = dao.getByObjectId(String.valueOf(idDepartment));
    if (bean == null) {
      bean = new DepartmentExt_W43();
    }
    bean.setDepartmentIdActual(idDepartment);
    bean.setSumMoneyImport(sumMoneyImport);
    bean.setSumMoneyExport(sumMoneyExport);
    bean.setSumprofit(sumProfit);
    bean.setProportionProfit(proportionProfit);
    bean.setEstimate(estimate);

    dao.update(bean);
    reset();

    return bean;
  }