Example #1
0
        public IActionResult OnPost(int id)
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            var prestamoToDelete = _prestamoRepository.GetById(id);

            if (prestamoToDelete == null)
            {
                return(NotFound());
            }

            prestamoToDelete.CodigoEstudiante = Prestamo.CodigoEstudiante;
            prestamoToDelete.CodigoLibro      = Prestamo.CodigoLibro;
            prestamoToDelete.Fecha            = Prestamo.Fecha;

            _prestamoRepository.Delete(prestamoToDelete);
            return(RedirectToPage("./Prestamos"));
        }
        public IActionResult OnPost(int Id)
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            var PrestamoToDelete = _prestamoRepository.GetById(Id);

            if (PrestamoToDelete == null)
            {
                return(NotFound());
            }

            PrestamoToDelete.CodigoPrestamo  = Prestamo.CodigoPrestamo;
            PrestamoToDelete.FechaPrestamo   = Prestamo.FechaPrestamo;
            PrestamoToDelete.FechaDevolucion = Prestamo.FechaDevolucion;
            PrestamoToDelete.ClienteID       = Prestamo.ClienteID;
            PrestamoToDelete.PeliculaID      = Prestamo.PeliculaID;

            _prestamoRepository.Delete(PrestamoToDelete);
            return(RedirectToPage("./Prestamos"));
        }
Example #3
0
 public Prestamo Delete(long id)
 {
     return(prestamoRepository.Delete(id));
 }