public string Update([Bind("Id,Product_Name,Qnt,Price")] DetailViewModels.ProductViewModel product) { if (ModelState.IsValid) { var data = _product.Update(product); if (data == 1) { return("sucess"); } } return("false"); }
public int Create(DetailViewModels.ProductViewModel product) { var query = new Product { Product_Name = product.Product_Name, Qnt = product.Qnt, Price = product.Price }; _context.Product.Add(query); int row = _context.SaveChanges(); return(row); }