Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 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);
     }
 }