public BaseResultModel <int> DeleteModel(List <Guid?> IDs) { if (IDs == null || IDs.Count == 0) { return(new ErrorResultModel <int>(EnumErrorCode.请求参数错误, "参数不能为空")); } return(ModelService.DeleteModel(IDs)); }
public ActionResult RemoveModel(int id) { ModelDTO model = new ModelDTO { Id = id }; modelService.DeleteModel(model); return(RedirectToAction("Models", new RouteValueDictionary(new { controller = "Model", action = "Models", brandId = TempData["BrandId"] }))); }
public ActionResult DeleteConfirmed(long id) { ModelPivot modelPivot = modelService.GetModel(id); // modelPivot.IdDossier = Constantes.CurrentPreferenceIdDossier; modelService.DeleteModel(modelPivot); return(RedirectToAction("Index")); }
public ActionResult DeleteModel(int id) { var dModel = _modelService.FindById(id); if (dModel == null) { return(NotFound()); } _modelService.DeleteModel(dModel); _modelService.SaveChanges(); _log.Save(User.Identity.Name, "Usunięto model", GetType().Name); return(Ok()); }
public ActionResult <Model> Delete(int id) { try { return(Ok(_modelService.DeleteModel(id))); } catch (ArgumentException e) { return(StatusCode(500, e.Message)); } catch (InvalidOperationException e) { return(StatusCode(500, e.Message)); } }