Ejemplo n.º 1
0
        /// <summary>
        /// Método para el acceso a la interfaz de visualización de restaurantes.
        /// </summary>
        /// <returns>Retorna un objeto para renderizar la vista parcial.</returns>
        public ActionResult M10_GestionRestaurantes_Ver(int id = -1)
        {
            //Carga Inicial de la vista ver se coloca por defecto un -1 debido a que no hay una ciudad seleccionada por defecto
            try
            {
                ViewBag.Ciudad = FabricaVista.asignarItemsComboBox(cargarComboBoxLugar(), "Id", "Name");


                Entidad _lugar = FabricaEntidad.crearLugar(id, "");//Aqui se envia la clave foranea de lugar para realizar la busqueda
                Command <List <Entidad> > comando      = (Command <List <Entidad> >)FabricaComando.comandosRestaurant(FabricaComando.comandosGlobales.CONSULTAR, BOReserva.Controllers.PatronComando.FabricaComando.comandoRestaurant.NULO, _lugar);
                List <Entidad>            restaurantes = comando.ejecutar();
                CRestauranteModelo        Restaurant   = FabricaEntidad.crearRestaurant();
                List <CRestauranteModelo> lista        = FabricaEntidad.crearListaRestarant();

                foreach (Entidad item in restaurantes)
                {
                    lista.Add((CRestauranteModelo)item);
                }

                Restaurant.listaRestaurantes = lista;
                return(PartialView(Restaurant));
            }
            catch (Exception)
            {
                return(PartialView());
            }
        }
Ejemplo n.º 2
0
 public void M10_PruebaAsignarItemsComboBox()
 {
     Assert.IsInstanceOf(typeof(SelectList), FabricaVista.asignarItemsComboBox(new List <Object>(), "", ""));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Método para el acceso a la interfaz de agregación de restaurantes.
 /// </summary>
 /// <returns>Retorna un objeto para renderizar la vista parcial.</returns>
 public ActionResult M10_GestionRestaurantes_Agregar()
 {
     ViewBag.Ciudad   = FabricaVista.asignarItemsComboBox(cargarComboBoxLugar(), "Id", "Name");
     ViewBag.Horarios = FabricaVista.asignarItemsComboBox(cargarComboBoxHorario(), "", "");
     return(PartialView());
 }