public int AddTutorial(TutorialDTO dto) { int id = 0; try { log.Debug(TutorialDTO.FormatTutorialDTO(dto)); R_Tutorial t = TutorialDTO.ConvertDTOtoEntity(dto); // add id = Repository.AddTutorial(t); dto.TutorialId = id; log.Debug("result: 'success', id: " + id); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } return(id); }
public void DeleteTutorial(TutorialDTO dto) { try { log.Debug(TutorialDTO.FormatTutorialDTO(dto)); R_Tutorial t = TutorialDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteTutorial(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public void UpdateTutorial(TutorialDTO dto) { try { //Requires.NotNull(t); //Requires.PropertyNotNegative(t, "TutorialId"); log.Debug(TutorialDTO.FormatTutorialDTO(dto)); R_Tutorial t = TutorialDTO.ConvertDTOtoEntity(dto); // update Repository.UpdateTutorial(t); log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }