Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        [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));
        }
Ejemplo n.º 3
0
        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));
        }