Exemplo n.º 1
0
 public ActionResult Delete(TableModels model)
 {
     try
     {
         string msg    = "";
         var    result = _factory.DeleteTables(model.ID, ref msg);
         if (!result)
         {
             //ModelState.AddModelError("Name", "Have a error when you delete an Category");
             ModelState.AddModelError("Name", msg);
             Response.StatusCode = (int)HttpStatusCode.BadRequest;
             return(PartialView("_Delete", model));
         }
         return(new HttpStatusCodeResult(HttpStatusCode.OK));
     }
     catch (Exception ex)
     {
         _logger.Error("Tables_Delete: " + ex);
         ModelState.AddModelError("Name", _AttributeForLanguage.CurrentUser.GetLanguageTextFromKey("Have an error when you delete a Table"));
         Response.StatusCode = (int)HttpStatusCode.BadRequest;
         return(PartialView("_Delete", model));
     }
 }