コード例 #1
0
 public JsonResult Suspend(int id)
 {
     try
     {
         if (id > 0)
         {
             if (_complaint.SuspendComplaint(id))
             {
                 return(Json(new { IsAuthenticated = true, IsSuccessful = true }));
             }
             else
             {
                 return(Json(new { IsAuthenticated = true, IsSuccessful = false, Error = "An error accurred while suspending this record!" }));
             }
         }
         else
         {
             return(Json(new { IsAuthenticated = true, IsSuccessful = false, Error = "This record does not exist!" }));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { IsAuthenticated = true, IsSuccessful = false, Error = ex.Message }));
     }
 }