예제 #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

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

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AlocacaoFilmesExists(AlocacaoFilmes.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

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

            _context.CadastroClientes.Add(CadastroCliente);
            await _context.SaveChangesAsync();

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

            _context.AlocacaoFilme.Add(AlocacaoFilmes);
            await _context.SaveChangesAsync();

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

            AlocacaoFilmes = await _context.AlocacaoFilme.FindAsync(id);

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

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

            CadastroCliente = await _context.CadastroClientes.FindAsync(id);

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

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