Beispiel #1
0
        /// <summary>
        /// Método para el acceso a la interfaz de modificación de restaurantes.
        /// </summary>
        /// <returns>Retorna un objeto para renderizar la vista parcial.</returns>
        public ActionResult M10_GestionRestaurantes_Modificar(int id)
        {
            try
            {
                //Atributos del metodo
                Entidad _restaurant = FabricaEntidad.crearRestaurant();
                ((CRestauranteModelo)_restaurant)._id = id;
                Command <Entidad> comando = (Command <Entidad>)FabricaComando.comandosRestaurant(FabricaComando.comandosGlobales.CONSULTAR, BOReserva.Controllers.PatronComando.FabricaComando.comandoRestaurant.CONSULTAR_ID, _restaurant);
                Entidad           rest    = comando.ejecutar();

                //Cargar la ciudad donde se encuentra el restaurant registrado en la base de datos
                ViewBag.Ciudad      = FabricaVista.asignarItemsComboBoxConPosicion(cargarComboBoxLugar(), "Id", "Name", ((CRestauranteModelo)rest).idLugar);
                ViewBag.HorariosIni = FabricaVista.asignarItemsComboBoxConPosicion(cargarComboBoxHorario(), "", "", ((CRestauranteModelo)rest).horarioApertura);
                ViewBag.HorariosFin = FabricaVista.asignarItemsComboBoxConPosicion(cargarComboBoxHorario(), "", "", ((CRestauranteModelo)rest).horarioCierre);

                //Elementos a cargar en la Ventana
                ViewBag.Id = ((CRestauranteModelo)rest)._id;
                ViewBag.NombreRestaurant      = ((CRestauranteModelo)rest).nombre;
                ViewBag.DescripcionRestaurant = ((CRestauranteModelo)rest).descripcion;
                ViewBag.DireccionRestaurant   = ((CRestauranteModelo)rest).direccion;
                ViewBag.TelefonoRestaurant    = ((CRestauranteModelo)rest).Telefono;
                ViewBag.IdLugarRestaurant     = ((CRestauranteModelo)rest).idLugar;
                ViewBag.HoraIniRestaurant     = ((CRestauranteModelo)rest).horarioApertura;
                ViewBag.HoraFinRestaurant     = ((CRestauranteModelo)rest).horarioCierre;

                return(PartialView());
            }
            catch (Exception)
            {
                return(PartialView());
            }
        }
Beispiel #2
0
        public void M10_PruebaAsignarItemsConPosicion()
        {
            List <String> lista = new List <String> {
                "Posicion1", "Posicion2", "Posicion3"
            };
            SelectList listaS = FabricaVista.asignarItemsComboBoxConPosicion(new List <Object>(), "", "", "Posicion2");

            Assert.AreEqual(listaS.SelectedValue, "Posicion2");
        }