public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(Etudiant).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EtudiantExists(Etudiant.code_etudiant))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
예제 #2
0
        public async Task <IActionResult> OnPostCreateAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Seance.Add(SeanceCreate);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Professeur.Add(Professeur);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            //Génération Code RFID
            Random random = new Random();

            Etudiant.code_rfid = Etudiant.cin + "-" + Etudiant.Filierecode_filiere + "-" + random.Next(0, 100);

            _context.Etudiant.Add(Etudiant);

            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Seance = await _context.Seance.FindAsync(id);

            if (Seance != null)
            {
                _context.Seance.Remove(Seance);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
예제 #6
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Professeur = await _context.Professeur.FindAsync(id);

            if (Professeur != null)
            {
                _context.Professeur.Remove(Professeur);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
예제 #7
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Etudiant = await _context.Etudiant.FindAsync(id);

            if (Etudiant != null)
            {
                _context.Etudiant.Remove(Etudiant);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }