Beispiel #1
0
        public int AddTask(TaskDTO dto)
        {
            int id = 0;

            try
            {
                log.Debug(TaskDTO.FormatTaskDTO(dto));

                R_Task t = TaskDTO.ConvertDTOtoEntity(dto);

                // add
                id         = Repository.AddTask(t);
                dto.TaskId = id;

                log.Debug("result: 'success', id: " + id);
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }

            return(id);
        }
Beispiel #2
0
        public void DeleteTask(TaskDTO dto)
        {
            try
            {
                log.Debug(TaskDTO.FormatTaskDTO(dto));

                R_Task t = TaskDTO.ConvertDTOtoEntity(dto);

                // delete
                Repository.DeleteTask(t);
                dto.IsDeleted = t.IsDeleted;

                log.Debug("result: 'success'");
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }
Beispiel #3
0
        public void UpdateTask(TaskDTO dto)
        {
            try
            {
                //Requires.NotNull(t);
                //Requires.PropertyNotNegative(t, "TaskId");

                log.Debug(TaskDTO.FormatTaskDTO(dto));

                R_Task t = TaskDTO.ConvertDTOtoEntity(dto);

                // update
                Repository.UpdateTask(t);

                log.Debug("result: 'success'");
            }
            catch (System.Exception e)
            {
                // error
                log.Error(e.ToString());

                throw;
            }
        }