public async Task <IActionResult> Create([Bind("ID,libelleEtatVisite")] EtatVisite etatVisite) { if (ModelState.IsValid) { _context.Add(etatVisite); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(etatVisite)); }
public async Task <IActionResult> Create([Bind("ID,nomFournisseur")] Fournisseur fournisseur) { if (ModelState.IsValid) { _context.Add(fournisseur); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(fournisseur)); }
public async Task <IActionResult> Create([Bind("ID,nom,prenom,dateNaissance,tel,profession,adresse,ville,mail,sexe,remarque")] Client client) { if (ModelState.IsValid) { _context.Add(client); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(client)); }
public async Task <IActionResult> Create([Bind("ID,Libelle")] ArticlePosition articlePosition) { if (ModelState.IsValid) { _context.Add(articlePosition); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(articlePosition)); }
public async Task <IActionResult> Create([Bind("ID,libelleTypePaiement")] TypePaiement typePaiement) { if (ModelState.IsValid) { _context.Add(typePaiement); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(typePaiement)); }
public async Task <IActionResult> Create([Bind("ID,visiteID,datePaiement,typePaiementID,montant,remarque")] Paiement paiement) { if (ModelState.IsValid) { _context.Add(paiement); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["typePaiementID"] = new SelectList(_context.TypePaiements, "ID", "ID", paiement.typePaiementID); ViewData["visiteID"] = new SelectList(_context.Visites, "ID", "ID", paiement.visiteID); return(View(paiement)); }
public async Task <IActionResult> Create([Bind("ID,code,libelleArticle,prixAchat,prixVenteHT,stock,typeArticleID,fournisseurID")] Article article) { if (ModelState.IsValid) { _context.Add(article); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["fournisseurID"] = new SelectList(_context.Fournisseurs, "ID", "ID", article.fournisseurID); ViewData["typeArticleID"] = new SelectList(_context.TypeArticles, "ID", "ID", article.typeArticleID); return(View(article)); }
public async Task <IActionResult> Create([Bind("ID,visiteID,articleID,articlePositionID,montant")] Vente vente) { if (ModelState.IsValid) { _context.Add(vente); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["articleID"] = new SelectList(_context.Articles, "ID", "ID", vente.articleID); ViewData["articlePositionID"] = new SelectList(_context.ArticlePositions, "ID", "ID", vente.articlePositionID); ViewData["visiteID"] = new SelectList(_context.Visites, "ID", "ID", vente.visiteID); return(View(vente)); }
public async Task <IActionResult> Create([Bind("ID,clientID,ophtalmo,date_visite,DateLivraison,DatePrescription,OD_loinSphere,OD_loincylindre,OD_loinAxe,OD_loinAdd,OD_loinPrisme,OD_loinBase,OD_IntermSphere,OD_Intermcylindre,OD_IntermAxe,OD_IntermAdd,OD_IntermPrisme,OD_IntermBase,OD_presSphere,OD_prescylindre,OD_presAxe,OD_presPrisme,OD_presBase,OD_ecart1,OD_ecart2,OD_ht1,OD_ht2,OD_doct1,OD_doct2,OG_loinSphere,OG_loincylindre,OG_loinAxe,OG_loinAdd,OG_loinPrisme,OG_loinBase,OG_IntermSphere,OG_Intermcylindre,OG_IntermAxe,OG_IntermAdd,OG_IntermPrisme,OG_IntermBase,OG_presSphere,OG_prescylindre,OG_presAxe,OG_presPrisme,OG_presBase,OG_ecart1,OG_ecart2,OG_ht1,OG_ht2,OG_doct1,OG_doct2,total,reste,attachements,etatVisiteID,remarques")] Visite visite, VenteArticles venteArticles)// { if (ModelState.IsValid) { _context.Add(visite); await _context.SaveChangesAsync(); await InsertArticlesAsync(visite.ID, venteArticles); return(RedirectToAction(nameof(Index))); } ViewData["clientID"] = new SelectList(_context.Clients, "ID", "ID", visite.clientID); ViewData["etatVisiteID"] = new SelectList(_context.EtatVisites, "ID", "ID", visite.etatVisiteID); ViewData["ArticleVerreID"] = _context.Articles.Where(a => a.typeArticle.ID == 3).ToList(); ViewData["ArticleMontureID"] = _context.Articles.Where(a => a.typeArticle.ID == 2).ToList(); ViewData["ArticleAccessoireID"] = _context.Articles.Where(a => a.typeArticle.ID == 6).ToList(); return(View(visite)); }