public async Task <IActionResult> Edit(int id, [Bind("IdFiliere,Libelle")] Model.Filiere filiere) { if (id != filiere.IdFiliere) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(filiere); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FiliereExists(filiere.IdFiliere)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(filiere)); }
public async Task <IActionResult> Create([Bind("Libelle")] Model.Filiere filiere) { if (ModelState.IsValid) { _context.Add(filiere); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(filiere)); }
public bool insertIntoTableFiliere(Model.Filiere filiere) { try { using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder, DbName))) { connection.Insert(filiere); return(true); } } catch (SQLiteException ex) { Log.Info("SQLiteEx", ex.Message); return(false); } }