public async Task <InventaireLigneEntity> DeleteAsync(InventaireLigneEntity item) { _context.Remove(item); await _context.SaveChangesAsync(); return(item); }
public async Task <InventaireLigneEntity> AddAsync(InventaireLigneEntity item) { _context.InventaireLigneEntities.Add(item); await _context.SaveChangesAsync(); return(item); }
public async Task <InventaireLigneEntity> Update(InventaireLigneEntity item) { if (!_repository.Exist(item.Id)) { throw new NotFoundException(ExceptionMessageUtil.NOT_FOUND); } return(await _repository.UpdateAsync(item)); }
public async Task <IActionResult> UpdateLigneQuantiteComptee(int ligne_quantite_comptee, int ligne_Id) { InventaireLigneEntity ligne = await _service_inventaire_ligne.GetOneById(ligne_Id); ligne.QuantiteComptee = ligne_quantite_comptee; await _service_inventaire_ligne.Update(ligne); return(RedirectToAction("Edit", new { id = ligne.InventaireId })); }
public async Task <InventaireLigneEntity> AddArticle(InventaireEntity inventaire, ArticleEntity article) { InventaireLigneEntity ligne = new InventaireLigneEntity(); ligne.Inventaire = inventaire; ligne.Article = article; ligne.QuantiteTheorique = article.Stock.Quantite; return(await _repository.AddAsync(ligne)); }