// GET:/Depot/Delete/1
 public IActionResult Delete(int?id)
 {
     ViewData["department"] = HttpContext.Session.GetString("department");
     if (id == null)
     {
         return(NotFound());
     }
     DepotRepository.Remove(id.Value);
     return(RedirectToAction("Index"));
 }
 public JsonResult Delete(int id)
 {
     try
     {
         _DepotRepository.Remove(id);
         return(Json(new
         {
             status = true
         }));
     }
     catch (Exception ex)
     {
         return(Json(new
         {
             status = false,
             message = ex.Message
         }));
     }
 }