Пример #1
0
        // GET: MotherBoard/Create
        public ActionResult Create()
        {
            var sockets = _cpuSocketService.GetCPUSockets();

            ViewBag.Sockets = new SelectList(sockets, "Id", "Name");
            var manufacturers = _manufacturerService.GetManufacturers();

            ViewBag.Manufacturers = new SelectList(manufacturers, "Id", "Name");
            var motherBoardFormFactors = _motherBoardFormFactorService.GetMotherBoardFormFactors();

            ViewBag.MotherBoardFormFactors = new SelectList(motherBoardFormFactors, "Id", "Name");
            var motherBoardNothernBridges = _northBridgeService.GetMotherBoardNorthBridges();

            ViewBag.MotherBoardNothernBridges = new SelectList(motherBoardNothernBridges, "Id", "Name");
            var outerMemoryInterfaces = _outerMemoryInterfaceService.GetOuterMemoryInterfaces();

            ViewBag.OuterMemoryInterfaces = new SelectList(outerMemoryInterfaces, "Id", "Name");
            var videoCardInterfaces = _videoCardInterfaceService.GetVideoCardInterfaces().Select(m => new VideoCardInterfaceViewModel()
            {
                Id = m.Id, Name = m.Name, Multiplier = m.Multiplier, Version = m.Version
            });

            ViewBag.VideoCardInterfaces = new SelectList(videoCardInterfaces, "Id", "FullName");
            var powerSupplyMotherBoardInterfaces = _powerSupplyMotherBoardInterfaceService.GetPowerSupplyMotherBoardInterfaces();

            ViewBag.PowerSupplyMotherBoardInterfaces = new SelectList(powerSupplyMotherBoardInterfaces, "Id", "Name");
            var ramTypes = _ramTypeService.GetRAMTypes();

            ViewBag.RamTypes = new SelectList(ramTypes, "Id", "Name");
            return(View());
        }
Пример #2
0
        public ActionResult Create()
        {
            var sockets = _cpuSocketService.GetCPUSockets();

            ViewBag.Sockets = new SelectList(sockets, "Id", "Name");
            var manufacturers = _manufacturerService.GetManufacturers();

            ViewBag.Manufacturers = new SelectList(manufacturers, "Id", "Name");
            return(View());
        }
Пример #3
0
        // GET: CPUSocket
        public ActionResult Index()
        {
            var cpuSockets = _cpuSocketService.GetCPUSockets().OrderBy(m => m.Name);

            var model = cpuSockets.Select(m => new CPUSocketViewModel
            {
                Id   = m.Id,
                Name = m.Name
            });

            return(View(model));
        }