Exemple #1
0
        public void DeleteObj(SheduleTask model)
        {
            var res = _context.Tasks.FirstOrDefault(a => a.Title == model.Title);

            if (res != null)
            {
                _context.Tasks.Remove(res);
                _context.SaveChanges();
            }
        }
Exemple #2
0
 public IActionResult Update([FromBody] SheduleTask model)
 {
     try
     {
         // update user
         _taskService.Update(model);
         return(Ok());
     }
     catch (Exception ex)
     {
         // return error message if there was an exception
         return(BadRequest(new { message = ex.Message }));
     }
 }
Exemple #3
0
 public void Update(SheduleTask task)
 {
     _context.Tasks.Update(task);
     _context.SaveChanges();
 }
Exemple #4
0
 public SheduleTask Create(SheduleTask task)
 {
     _context.Tasks.Add(task);
     _context.SaveChanges();
     return(task);
 }
Exemple #5
0
 public IActionResult DeleteObj([FromBody] SheduleTask model)
 {
     _taskService.DeleteObj(model);
     return(Ok());
 }
Exemple #6
0
        public IActionResult GetByDate([FromBody] SheduleTask model)
        {
            var tasks = _taskService.GetByDate(model.DateTime);

            return(Ok(tasks));
        }