public IDataResult <Task> Add(Task task) { _validation = new Validation <TaskValidator>(); _validation.Validate(task); _taskDal.Add(task); return(new SuccessDataResult <Task>(task)); }
public int Add(TaskModel model) { var record = new Entities.Concrete.Task(); record.Detail = model.Detail; record.StartingDate = model.StartingDate; record.ExpirationDate = model.ExpirationDate; record.CreationDate = DateTime.Now; record = _taskDal.Add(record); return(record.Id); }
public int AddTask(TaskDto taskDto) { var task = new Task { Name = taskDto.Name, Description = taskDto.Description, BeginDate = taskDto.BeginDate, EndDate = taskDto.EndDate }; return(_taskDal.Add(task)); }
public IDataResult <Task> Add(TaskDto task) { var newTask = new Task { EndDate = GetEndDate(task), CreateDate = GetStartDate(task), Explanation = task.Explanation, TaskName = task.TaskName, }; newTask.UserId = GetUserId(); _taskDal.Add(newTask); return(new SuccessDataResult <Task>(newTask, Messages.TaskAdded)); }
//To add new object public void AddTask(Task task) { task.TaskDetail.RegisterTime = DateTime.Now; if (task.SessionTime == null) { task.SessionTime = new TimeSpan(0, 25, 0); } _taskDal.Add(task); //To add subtask #region SubTaskAdder //control if task contains pomodoro if (task.IsPomodoro == true) { //if contains then calculate subtask number which every subtask consist of 25 minutes int subTaskCounter = Convert.ToInt32(task.SessionTime) / 25; //if last task smaller than 25 mins int additionalTime = Convert.ToInt32(task.SessionTime) % 25; if (additionalTime != 0) { _subtaskDal.Add(new SubTask() { TaskId = task.TaskId, SessionTime = new TimeSpan(0, additionalTime, 0) }); } //add subtasks one by one for (int i = 0; i < subTaskCounter; i++) { _subtaskDal.Add(new SubTask() { TaskId = task.TaskId, SessionTime = new TimeSpan(0, 25, 0) }); } } else { _subtaskDal.Add(new SubTask() { TaskId = task.TaskId, SessionTime = task.SessionTime }); } #endregion }
public void Add(Task task) { _taskDal.Add(task); }
public ToDoTask Add(ToDoTask task) { _taskDal.Add(task); return(task); }
public void SaveTaskDefinition(TaskDefinition taskDefinition) { _taskDal.Add(taskDefinition); }
public void Add(Task_Entity table) { _dal.Add(table); }
public void Create(Tasks task) { _taskDal.Add(task); }