示例#1
0
        public ActionResult Update([FromBody] ICRUDModel <Units> entity)
        {
            if (!ModelState.IsValid) // если проверка не удалась
            {
                var message = string.Join(" | ", ModelState.Values.SelectMany(v => v.Errors).Select(e => e.ErrorMessage));
                return(new BadRequestObjectResult(HttpStatusCode.BadRequest));//message returns the exception content
            }
            int result = data.Update <Units>(entity.value);

            return(Json(entity.value));
        }
示例#2
0
        //[ValidateInput(false)]
        public ActionResult CkEditorNews(News item)
        {
            News val = item;

            if (val.Id != 0)
            {
                data.Update <News>(val);
            }
            else
            {
                data.Add <News>(item);
            }
            return(Redirect("/admin/News"));
        }
        public ActionResult Update([FromBody] ICRUDModel <Products> entity)
        {
            if (!ModelState.IsValid) // если проверка не удалась
            {
                var message = string.Join(" | ", ModelState.Values.SelectMany(v => v.Errors).Select(e => e.ErrorMessage));
                BadRequestObjectResult badRequest = new BadRequestObjectResult(HttpStatusCode.BadRequest);
                badRequest.Value = "Ошибка изменение модели";
            }
            double?Amount = entity.value.Amount;

            entity.value.Amount = null;
            int result = data.Update <Products>(entity.value);

            entity.value.Amount = Amount;
            return(Json(entity.value));
        }
示例#4
0
 public ActionResult Update([FromBody] ICRUDModel <ProductIncoms> entity)
 {
     data.Update <ProductIncoms>(entity.value);
     return(Json(entity.value));
 }
        public ActionResult Update([FromBody] ICRUDModel <Customers> entity)
        {
            int result = data.Update <Customers>(entity.value);

            return(Json(entity.value));
        }
示例#6
0
        public ActionResult Update([FromBody] ICRUDModel <ProductTypes> entity)
        {
            int result = data.Update <ProductTypes>(entity.value);

            return(Json(entity.value));
        }