public ActionResult AddNewTask(TaskDTO newTask)
 {
     try
     {
         if (newTask == new TaskDTO())
         {
             throw new ArgumentException("Input Cannot be Null");
         }
         else
         {
             _taskRepo.AddNewTask(_mapper.Map <Task>(newTask));
             return(Ok());
         }
     }
     catch (Exception ex)
     {
         LogHelper.LogExceptionMessage(ex);
         return(BadRequest(ex.GetBaseException().ToString()));
     }
 }
 public ActionResult AddNewEmployee(EmployeeDTO newEmployee)
 {
     try
     {
         if (newEmployee == new EmployeeDTO())
         {
             throw new ArgumentException("Input Value is Empty/Null");
         }
         string task           = JsonConvert.SerializeObject(newEmployee.Tasks);
         var    employeeToRepo = _mapper.Map <Employee>(newEmployee);
         employeeToRepo.Tasks = task;
         _task.AddNewTask(_mapper.Map <DataStorage.Models.Task>(task));
         _employeeRepo.AddNewEmployee(employeeToRepo);
         return(NoContent());
     }
     catch (Exception ex)
     {
         LogHelper.LogExceptionMessage(ex);
         return(BadRequest(ex.GetBaseException().ToString()));
     }
 }
 public ActionResult AddTask(string name, string description, string date, int?projectId)
 {
     service.AddNewTask(name, description, date, projectId, (int)Session["accountId"]);
     return(Redirect("/Task/Tasks"));
 }