public IResult DeleteById(int modelId)
        {
            var result = _modelDal.Get(model => model.Id == modelId);

            _modelDal.Delete(result);
            return(new SuccessResult());
        }
示例#2
0
        public IResult Delete(Model model)
        {
            Model result = _modelDal.Get(m => m.ModelId == model.ModelId);

            _modelDal.Delete(result);
            return(new SuccessResult(Messages.ModelDeleted));
        }
 public int DeleteModel(int Id)
 {
     _modelDal.Delete(new Model {
         Id = Id
     });
     return(Id);
 }
示例#4
0
 public IResult Delete(Model model)
 {
     if (DateTime.Now.Hour == 22)
     {
         return(new ErrorResult(Messages.MaintenanceTime));
     }
     _modelDal.Delete(model);
     return(new SuccessResult());
 }
 //[SecuredOperation("model.delete, admin")]
 public IResult Delete(Model model)
 {
     if (model != null)
     {
         _modelDal.Delete(model);
         return(new SuccessResult(ModelMessages.ModelDeleted));
     }
     return(new ErrorResult(ModelMessages.FailedModelDeleted));
 }
示例#6
0
        public IResult Delete(int modelId)
        {
            var result = BusinessRules.Run(CheckModelIdExist(modelId));

            if (result != null)
            {
                return(result);
            }

            var deletedColor = _modelDal.Get(c => c.Id == modelId);

            _modelDal.Delete(deletedColor);

            return(new SuccessResult(Messages.Deleted));
        }
示例#7
0
 public IResult Delete(Model model)
 {
     _modelDal.Delete(_modelDal.Get(c => c.Id == model.Id));
     return(new SuccessResult(Messages.Deleted));
 }
示例#8
0
 public IResult Delete(Model model)
 {
     _modelDal.Delete(model);
     return(new SuccessResult(Messages.Model + Messages.Deleted));
 }
示例#9
0
 public IResult Delete(Model model)
 {
     _modelDal.Delete(model);
     return(new SuccessResult());
 }
示例#10
0
 public IResult Delete(Model model)
 {
     _modelDal.Delete(model);
     return(new SuccessDataResult <Model>(Messages.DataDeleted));
 }