Пример #1
0
        public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
        {
            string body = actionContext.Request.Content.ReadAsStringAsync().Result;
            CustomerLoadOrMatch model = new CustomerLoadOrMatch();

            model = JsonConvert.DeserializeObject <CustomerLoadOrMatch>(body);

            //List<string> performingAction = new List<string> {"cload"};
            //model.AccessControl.ModuleAccess = performingAction.ToGroupCodeEnum();

            var validator = new CustomerLoadValidator();
            var result    = validator.Validate(model.Customer);

            foreach (var e in result.Errors)
            {
                bindingContext.ModelState.AddModelError(e.PropertyName, e.ErrorMessage);
            }
            bindingContext.Model = model;
            return(true);
        }
Пример #2
0
 public long SaveCustomer(CustomerLoadOrMatch customersLoad, out int customerId, out DateTime processedDatetime)
 {
     return(_mciRequestDataAccess.SaveCustomer(customersLoad, out customerId, out processedDatetime));
 }