/// <summary> /// 更新一条TTrain记录 /// </summary> /// <param name="dto">TTrain实体</param> /// <returns>是否更新成功</returns> public bool Update(TTrainDTO dto) { try { if (_repository.Update(dto.ProjectedAs <T_Train>()) >= 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
/// <summary> /// 新增一条TTrain记录 /// </summary> /// <param name="dto">TTrain实体</param> /// <returns>是否新增成功</returns> public bool Add(TTrainDTO dto) { try { var entity = dto.ProjectedAs <T_Train>(); if (_repository.Insert(entity) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }