示例#1
0
        public IResult Update(Model model)
        {
            Model result = _modelDal.Get(m => m.ModelId == model.ModelId);

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

            modelToUpdate.BrandId   = model.BrandId;
            modelToUpdate.ModelName = model.ModelName;
            _modelDal.Update(modelToUpdate);
            return(new SuccessResult(Messages.ModelUpdated));
        }
示例#3
0
 public IResult Update(Model model)
 {
     if (DateTime.Now.Hour == 22)
     {
         return(new ErrorResult(Messages.MaintenanceTime));
     }
     else if (model.Name.Length < 2)
     {
         return(new ErrorResult(Messages.ModelNameInvalid));
     }
     _modelDal.Update(model);
     return(new SuccessResult(Messages.ModelUpdated));
 }
示例#4
0
        public IResult Update(Model model)
        {
            var normalizedName = model.Name.ToUpper();
            var result         = BusinessRules.Run(CheckModelNameExist(normalizedName), CheckModelIdExist(model.Id));

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

            var modelUptaded = _modelDal.Get(m => m.Id == model.Id);

            modelUptaded.Name           = model.Name;
            modelUptaded.NormalizedName = model.Name.ToUpper();

            _modelDal.Update(modelUptaded);

            return(new SuccessResult(Messages.Uptaded));
        }
示例#5
0
 public IResult Update(Model model)
 {
     _modelDal.Update(_modelDal.Get(c => c.Id == model.Id));
     return(new SuccessResult(Messages.Updated));
 }
示例#6
0
 public IResult Update(Model model)
 {
     _modelDal.Update(model);
     return(new SuccessResult(Messages.Model + Messages.Updated));
 }
 public Model UpdateModel(Model model)
 {
     _modelDal.Update(model);
     return(model);
 }
示例#8
0
 public IResult Update(Model model)
 {
     _modelDal.Update(model);
     return(new SuccessResult());
 }
示例#9
0
 public IResult Update(Model model)
 {
     _modelDal.Update(model);
     return(new SuccessDataResult <Model>(Messages.DataUpdated));
 }