コード例 #1
0
 public IList GetByCondition(PropertyAppropriation propertyAppropriation)
 {
     ArrayList param = new ArrayList();
     string queryStr = "from PropertyAppropriation t where 1=1";
     if (!string.IsNullOrEmpty(propertyAppropriation.ast_id))
     {
         queryStr += " and t.ast_id=?";
         param.Add(propertyAppropriation.ast_id);
     }
     if (propertyAppropriation.Department != null)
     {
         queryStr += " and t.Department = ?";
         param.Add(propertyAppropriation.Department.DepartmentID);
     }
     if (!string.IsNullOrEmpty(propertyAppropriation.ast_from_user))
     {
         queryStr += " and t.ast_from_user like ?";
         param.Add("%" + propertyAppropriation.ast_from_user  + "%");
     }
     if (propertyAppropriation.ast_fit_date != propertyAppropriation.ast_fit_default_date )
     {
         DateTime dtTemp = propertyAppropriation.ast_fit_date.AddDays(1);
         queryStr += " and t.ast_fit_date >= ? and t.ast_fit_date < ?";
         param.Add(propertyAppropriation.ast_fit_date);
         param.Add(dtTemp);
     }
     return HibernateTemplate.Find(queryStr, param.ToArray());
 }
コード例 #2
0
 public static PropertyAppropriationDTO MapToDTO(PropertyAppropriation model)
 {
     PropertyAppropriationDTO dto = new PropertyAppropriationDTO();
     dto.ast_main_id = model.ast_main_id;
     dto.ast_id = model.ast_id;
     dto.DepartmentID = model.Department == null ? "" : model.Department.DepartmentID;
     dto.DepartmentName = model.Department == null ? "" : model.Department.DepartmentName;
     dto.ast_from_user = model.ast_from_user;
     dto.ast_fit_date = model.ast_fit_date.ToString("yyyy/MM/dd");
     dto.ast_fit_reason = model.ast_fit_reason;
     return dto;
 }
コード例 #3
0
 public static PropertyAppropriation MapFromDTO(PropertyAppropriationDTO dto)
 {
     PropertyAppropriation propertyAppropriation = new PropertyAppropriation();
     propertyAppropriation.ast_main_id = dto.ast_main_id;
     propertyAppropriation.ast_id  = dto.ast_id ;
     propertyAppropriation.Department = dto.DepartmentID == null ? null : ManagerFactory.DepartmentManager.GetDepartment(dto.DepartmentID);
     propertyAppropriation.ast_from_user = dto.ast_from_user;
     if (!string.IsNullOrEmpty(dto.ast_fit_date))
     {
         propertyAppropriation.ast_fit_date = DateTime.Parse(dto.ast_fit_date);
     }
     propertyAppropriation.ast_fit_reason = dto.ast_fit_reason;
     return propertyAppropriation;
 }
コード例 #4
0
 /// <summary>
 /// 保存资产
 /// </summary>
 /// <param name="property">资产实体</param>
 /// <returns></returns>
 public void SaveProperty(Property property,PropertyAppropriation propertyAppropriation)
 {
     PropertyDao.SaveOrUpdate(property);
     PropertyAppropriationDao.Save(propertyAppropriation);
 }
コード例 #5
0
 public PropertyAppropriation SaveOrUpdate(PropertyAppropriation propertyAppropriation)
 {
     HibernateTemplate.SaveOrUpdate(propertyAppropriation);
     return propertyAppropriation;
 }
コード例 #6
0
 public void Save(PropertyAppropriation propertyAppropriation)
 {
     HibernateTemplate.Save(propertyAppropriation);
 }
コード例 #7
0
 public void Delete(PropertyAppropriation propertyAppropriation)
 {
     HibernateTemplate.Delete(propertyAppropriation);
 }
コード例 #8
0
 private void Validate(PropertyAppropriation propertyAppropriation)
 {
     //TODO throw exception on error.
 }
コード例 #9
0
 /// <summary>
 /// 更新资产调拨
 /// </summary>
 /// <param name="propertyAppropriation">资产调拨实体</param>
 /// <returns></returns>
 public PropertyAppropriation UpdatePropertyAppropriation(PropertyAppropriation propertyAppropriation)
 {
     return PropertyAppropriationDao.SaveOrUpdate(propertyAppropriation);
 }
コード例 #10
0
 /// <summary>
 /// 保存资产调拨
 /// </summary>
 /// <param name="propertyAppropriation">资产调拨实体</param>
 /// <returns></returns>
 public void SavePropertyAppropriation(PropertyAppropriation propertyAppropriation)
 {
     PropertyAppropriationDao.Save(propertyAppropriation);
 }
コード例 #11
0
 /// <summary>
 /// 创建资产调拨
 /// </summary>
 /// <returns></returns>
 public PropertyAppropriation NewPropertyAppropriation()
 {
     var propertyAppropriation = new PropertyAppropriation();
     return propertyAppropriation;
 }
コード例 #12
0
 public IList GetByCondition(PropertyAppropriation propertyAppropriation)
 {
     return PropertyAppropriationDao.GetByCondition(propertyAppropriation);
 }