public int AddEquipment(EquipmentDTO dto) { int id = 0; try { log.Debug(EquipmentDTO.FormatEquipmentDTO(dto)); R_Equipment t = EquipmentDTO.ConvertDTOtoEntity(dto); // add id = Repository.AddEquipment(t); dto.EquipmentId = id; log.Debug("result: 'success', id: " + id); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } return(id); }
public void DeleteEquipment(EquipmentDTO dto) { try { log.Debug(EquipmentDTO.FormatEquipmentDTO(dto)); R_Equipment t = EquipmentDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteEquipment(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public void UpdateEquipment(EquipmentDTO dto) { try { //Requires.NotNull(t); //Requires.PropertyNotNegative(t, "EquipmentId"); log.Debug(EquipmentDTO.FormatEquipmentDTO(dto)); R_Equipment t = EquipmentDTO.ConvertDTOtoEntity(dto); // update Repository.UpdateEquipment(t); log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }