예제 #1
0
        public IResult Add(Model model)
        {
            //ValidationTool.Validate(new ModelValidator(), model);

            _modelDal.Add(model);
            return(new SuccessDataResult <Model>(Messages.DataAdded));
        }
예제 #2
0
        public IResult Add(Model model)
        {
            var result = _modelDal.GetAll(m => m.ModelName == model.ModelName);

            if (result.Count != 0)
            {
                return(new ErrorResult(Messages.ModelAlreadyExist));
            }
            _modelDal.Add(model);
            return(new SuccessResult(Messages.AddedModel));
        }
예제 #3
0
 public IResult Add(Model model)
 {
     if (DateTime.Now.Hour == 22)
     {
         return(new ErrorResult(Messages.MaintenanceTime));
     }
     else if (model.Name.Length < 2)
     {
         return(new ErrorResult(Messages.ModelNameInvalid));
     }
     _modelDal.Add(model);
     return(new SuccessResult(Messages.ModelAdded));
 }
예제 #4
0
        public IResult Add(Model model)
        {
            var normalizedName = model.Name.ToUpper();
            var result         = BusinessRules.Run(CheckModelNameExist(normalizedName));

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

            model.NormalizedName = normalizedName;
            _modelDal.Add(model);

            return(new SuccessResult(Messages.Added));
        }
예제 #5
0
 public IResult Add(Model model)
 {
     _modelDal.Add(model);
     return(new SuccessResult(Messages.Added));
 }
 public IResult Add(Model model)
 {
     _modelDal.Add(model);
     return(new SuccessResult());
 }
 public Model AddModel(Model model)
 {
     _modelDal.Add(model);
     return(model);
 }