Examples of DepAlgorithm


Examples of com.narirelays.ems.persistence.orm.DepAlgorithm

    if(algorithmID==null)
    {
      result.setFailed(DEPRECIATION_ALGORITHM_ID_IS_NULL);
      return result;
    }
    DepAlgorithm depAlgorithm = depAlgorithmDAO.findById(algorithmID);
    if(depAlgorithm==null)
    {
      result.setFailed(DEPRECIATION_ALGORITHM_NOT_EXIST,algorithmID);
      return result;
    }
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.DepAlgorithm

    if(nameObject==null)
    {
      result.setFailed(DEPRECIATION_ALGORITHM_NAME_IS_NULL);
      return result;
    }
    DepAlgorithm depAlgorithm = new DepAlgorithm();
    try{
      BeanUtils.populate(depAlgorithm, properties);
      depAlgorithm.setId(MyUUIDGen.getUUID());
      depAlgorithmDAO.merge(depAlgorithm);
      result.setSucceed(depAlgorithm.getId());
    }
    catch (IllegalAccessException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.DepAlgorithm

    if(id==null)
    {
      result.setFailed(DEPRECIATION_ALGORITHM_ID_IS_NULL);
      return result;
    }
    DepAlgorithm depAlgorithm = depAlgorithmDAO.findById(id);
    if(depAlgorithm==null)
    {
      result.setFailed(DEPRECIATION_ALGORITHM_NOT_EXIST,id);
      return result;
    }
    try{
      BeanUtils.populate(depAlgorithm, properties);
      depAlgorithm.setId(id);
      depAlgorithmDAO.merge(depAlgorithm);
      result.setSucceed(DEPRECIATION_ALGORITHM_MODIFY_SUCCED,depAlgorithm.getName());
    }
    catch (IllegalAccessException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.DepAlgorithm

    if(id==null)
    {
      result.setFailed(DEPRECIATION_ALGORITHM_ID_IS_NULL);
      return result;
    }
    DepAlgorithm depAlgorithm = depAlgorithmDAO.findById(id);
    if(depAlgorithm==null)
    {
      result.setFailed(DEPRECIATION_ALGORITHM_NOT_EXIST,id);
      return result;
    }
    Set<DepreciationCaculator>caculators = depAlgorithm.getDepreciationCaculators();
    if(caculators!=null&&caculators.size()>0)
    {
      result.setFailed(CACULATOR_EXIST);
      return result;
    }
    try{
      depAlgorithmDAO.delete(depAlgorithm);
      result.setSucceed(DEPRECIATION_ALGORITHM_DELETE_SUCCED,depAlgorithm.getName());
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

Examples of com.narirelays.ems.persistence.orm.DepAlgorithm

  {
    // TODO Auto-generated method stub
    List<DepAlgorithm> algs = depAlgorithmDAO.findByName("平均年限法");
    if(algs==null||algs.size()==0)//系统中没有该算法,则创建
    {
      DepAlgorithm alg = new DepAlgorithm();
      alg.setId(MyUUIDGen.getUUID());
      alg.setName("平均年限法");
      depAlgorithmDAO.merge(alg);
    }
   
    algs = depAlgorithmDAO.findByName("年数总和法");
    if(algs==null||algs.size()==0)//系统中没有该算法,则创建
    {
      DepAlgorithm alg = new DepAlgorithm();
      alg.setId(MyUUIDGen.getUUID());
      alg.setName("年数总和法");
      depAlgorithmDAO.merge(alg);
    }
   
    algs = depAlgorithmDAO.findByName("双倍余额递减法");
    if(algs==null||algs.size()==0)//系统中没有该算法,则创建
    {
      DepAlgorithm alg = new DepAlgorithm();
      alg.setId(MyUUIDGen.getUUID());
      alg.setName("双倍余额递减法");
      depAlgorithmDAO.merge(alg);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.