Пример #1
0
        public async Task <IActionResult> Editar(string codigo)
        {
            #region dropdowns
            ViewBag.ListaEstadoVuelo = (await servicioVuelo.Listar()).Select(p => new SelectListItem()
            {
                Text  = p.Descripcion,
                Value = p.Codigo.ToString()
            }).ToList();

            ViewBag.ListaAeronave = (await servicioAeronave.Listar()).Select(p => new SelectListItem()
            {
                Text  = p.Codigo,
                Value = p.Codigo.ToString()
            }).ToList();

            ViewBag.ListaObservacion = (await servicioObservacion.Listar()).Select(p => new SelectListItem()
            {
                Text  = p.Descripcion,
                Value = p.Codigo.ToString()
            }).ToList();
            #endregion


            RegistroViewModel view = null;

            if (string.IsNullOrEmpty(codigo))
            {
                view = new RegistroViewModel();
            }
            else
            {
                view = await servicioRegistro.Buscar(codigo);
            }

            return(View(view));
        }
        public async Task <IActionResult> Lista()
        {
            var view = await servicio.Listar();

            return(View(view));
        }