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());
 }
예제 #5
0
 //[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));
 }