コード例 #1
0
        public IActionResult Add()
        {
            var viewModel = new TimbradosAddViewModel()
            {
                Cajas = _cajas.GetAll().Select(x => new AdditionalData()
                {
                    Value = x.Id, Text = x.Nombre, AdditionalInt = x.SucursalId
                }).ToList(),
                Sucursales = _sucursales.GetAll().Select(x => new DropDownViewModel <int>()
                {
                    Value = x.Id, Text = $"{x.Nombre} - Codigo Establecimiento: {x.CodigoEstablecimiento}"
                }).ToList()
            };

            return(View(viewModel));
        }
コード例 #2
0
        public List <DropDownViewModel <int> > GetCajas()
        {
            var cajas = _cajas.GetAll().Select(x => new DropDownViewModel <int>()
            {
                Text = x.Nombre, Value = x.Id
            }).ToList();

            return(cajas);
        }