Beispiel #1
0
        public JsonResult DeleteData(int?id)
        {
            if (id > 0)
            {
                db.Delete(id.Value);
                return(Json("success", JsonRequestBehavior.AllowGet));
            }

            return(Json("error", JsonRequestBehavior.DenyGet));
        }
Beispiel #2
0
 public void Delete(DeleteServiceTypeRequest request)
 {
     try
     {
         var response = new DeleteServiceTypeResponse();
         var bc       = new ServiceTypeComponent();
         bc.Delete(request.Id);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }