Beispiel #1
0
        public async Task <IActionResult> Index()
        {
            MachineListViewModel viewModel = new MachineListViewModel();

            viewModel.AddRange(await _machineService.GetListAsync());
            return(View(viewModel));
        }
Beispiel #2
0
        public ActionResult Index()
        {
            var machineList = new MachineListViewModel
            {
                Machines = Machines.Select(m => new MachineViewModel
                {
                    EquipId    = m.EquipId,
                    EquipMake  = m.EquipMake,
                    EquipModel = m.EquipModel
                }).ToList()
            };

            machineList.TotalMachines = machineList.Machines.Count;

            return(View(machineList));
        }
        public ActionResult Index()
        {
            using (var machineContext = new MachineContext())
            {
                {
                    var machineList = new MachineListViewModel
                    {
                        Machines = machineContext.Machines.Select(m => new MachineViewModel
                        {
                            Num   = m.Num,
                            Make  = m.Make,
                            Model = m.Model,
                            Hours = m.Hours
                        }).ToList()
                    };

                    machineList.MachineCounter = machineList.Machines.Count;

                    return(View(machineList));
                }
            }
        }
Beispiel #4
0
        public ActionResult Index()
        {
            using (var machineContext = new MachineContext())
            {
                var machineList = new MachineListViewModel
                {
                    Machines = machineContext.Machines.Select(m => new MachineViewModel
                    {
                        MachineId    = m.MachineId,
                        MachineNum   = m.MachineNum,
                        MachineMake  = m.MachineMake,
                        MachineModel = m.MachineModel,
                        TypeName     = m.MachineType.TypeName,
                        TypeId       = m.TypeId,
                        Hours        = m.Hours,
                        Notes        = m.Notes,
                        Status       = m.Status,
                        Photo        = m.Photo
                    }).ToList()
                };

                return(View(machineList));
            }
        }