public async Task <IActionResult> PutProductIncoms(int id, ProductIncoms productIncoms) { if (id != productIncoms.Id || !ModelState.IsValid) { return(BadRequest()); } _context.Entry(productIncoms).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductIncomsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
[HttpPost] // Для История прихода (старый) на гриде диалоговое окно public ActionResult Insert(ProductIncoms entity) { if (User.FindFirstValue("UserId") != null) { entity.UserId = Convert.ToInt32(User.FindFirstValue("UserId")); } int result = data.SqlExecuteProc("SP_AddProductIncome", entity); return(Json(entity)); }
public async Task <ActionResult <ProductIncoms> > PostProductIncoms(ProductIncoms productIncoms) { if (!ModelState.IsValid) { BadRequest(); } _context.ProductIncoms.Add(productIncoms); await _context.SaveChangesAsync(); return(CreatedAtAction("GetProductIncoms", new { id = productIncoms.Id }, productIncoms)); }