public async Task <IActionResult> DeleteAsync(int id)
      {           //EmployeeAttendence data delete by id
          var result = await _rankService.DeleteAsync(id);

          if (result == null)
          {
              return(BadRequest(result.Message));
          }
          //show message
          return(Ok(result.Message));
      }
예제 #2
0
        public async Task <IActionResult> Delete(string id, [FromForm] RankDeleteModel deleteModel)
        {
            try
            {
                var isEffected = await _rankService.DeleteAsync(id, deleteModel);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
예제 #3
0
 public async Task <ActionResult> DeleteAsync(int id)
 {
     try
     {
         await rankService.DeleteAsync(new RankDTO { Id = id });
     }
     catch (NotFoundException e)
     {
         return(NotFound(new { Id = id, e.Message }));
     }
     catch (DeleteNotPermittedException e)
     {
         return(Conflict(e.Message));
     }
     return(NoContent());
 }