Example #1
0
        public void EliminarReserva()
        {
            ObtenerToken("ADMINISTRADOR", "ASDF");
            var reserva = new Reserva {
                Token = _token
            };

            Assert.AreEqual(true, reserva.EliminarReserva(62));
        }
        public ActionResult EliminarReserva(int id)
        {
            _token = Session["Token"].ToString();
            if (string.IsNullOrEmpty(_token))
            {
                RedirectToAction("Index", "Home");
            }
            var reserva = new Reserva {
                Token = _token
            };

            reserva.EliminarReserva(id);
            return(RedirectToAction("VerReservas"));
        }
Example #3
0
 private void btnEliminar_Click(object sender, EventArgs e)
 {
     if (this.lstReserva.SelectedItems.Count == 0)
     {
         MessageBox.Show("Seleccione una fila para Eliminar.");
     }
     else
     {
         Reserva rs = (Reserva)lstReserva.SelectedItem;
         Reserva.EliminarReserva(rs);
         ActualizarListaReservas();
         LimpiarFormulario();
     }
 }