Пример #1
0
 public BaseResultModel <int> DeleteModel(List <Guid?> IDs)
 {
     if (IDs == null || IDs.Count == 0)
     {
         return(new ErrorResultModel <int>(EnumErrorCode.请求参数错误, "参数不能为空"));
     }
     return(ModelService.DeleteModel(IDs));
 }
Пример #2
0
        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"] })));
        }
Пример #3
0
        public ActionResult DeleteConfirmed(long id)
        {
            ModelPivot modelPivot = modelService.GetModel(id);

            // modelPivot.IdDossier = Constantes.CurrentPreferenceIdDossier;

            modelService.DeleteModel(modelPivot);

            return(RedirectToAction("Index"));
        }
Пример #4
0
        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));
     }
 }