예제 #1
0
 public IHttpActionResult PutProducts(ProductData product)
 {
     if (ModelState.IsValid)
     {
         Product pro = service.FindById(4);
         pro.Name = product.Name;
         service.Edit(pro);
     }
     return(Ok(false));
 }
예제 #2
0
        public IActionResult Edit(ProductFormVM model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            string thumb = UploadFile(model.Product.file);

            model.Product.Thumb = string.IsNullOrEmpty(thumb) ? model.Product.Thumb : thumb;
            productOperations.Edit(model.Product);
            return(View(model));
        }
예제 #3
0
 public IActionResult Edit([FromQuery] ProductChangeModel model)
 {
     if (ModelState.IsValid)
     {
         _productOperations.Edit(model);
     }
     else
     {
         return(BadRequest());
     }
     return(Ok());
 }
예제 #4
0
        public IActionResult Edit([FromBody] ProductViewModel model)
        {
            var res = product.Edit(model);

            return(Ok(res));
        }