// GET: Manufacturer public ActionResult Index(int id = 1) { Session["LastPage"] = id; int countOfPages = (int)Math.Ceiling((double)(repo.GetAll().ToList().Count) / countPerPage); ViewBag.Manufacturers = repo.GetAll() .ToList() .Skip((id - 1) * countPerPage) .Take(countPerPage); ViewBag.CountOfPages = countOfPages; return(View()); }
public void TestManufacturerRepo_GetAll() { //Arrange ManufacturerRepository TestRepo = CreateManufacturerTestRepo("ManufacturerGetAll"); //Act var result = TestRepo.GetAll(); //Assert Assert.IsTrue(result.Count() == _ManufacturerNumber); }
public void SetValues() { ManufacturerComboBox.ItemsSource = ManufacturerRepository.GetAll(); CategorieComboBox.ItemsSource = CategorieRepository.GetAll(); ManufacturerComboBox.Text = Product.Manufacturer.name; CategorieComboBox.Text = Product.Categorie.name; NameTextBox.Text = Product.name; PriceTextBox.Text = Product.price.ToString(); ManufacturedDatePiker.SelectedDate = Product.manufacturedDate; ImportDatePiker.SelectedDate = Product.importDate; }
public ActionResult Manufacturers(int id = 1) { var manufacturers = _manufacturers.GetAll(); var countPagesManufacturers = GetCountPages(manufacturers.Count()); ViewBag.Manufacturers = manufacturers .Skip((id - 1) * _perPage) .Take(_perPage); ViewBag.CouuntPagesManufacturers = countPagesManufacturers; return(View()); }
public HomeController() { repo = new GoodRepository(); manufRepo = new ManufacturerRepository(); catRepo = new CategoryRepository(); Manufs = manufRepo.GetAll().ToList(); Cats = catRepo.GetAll().ToList(); ViewBag.Manufs = Manufs; ViewBag.Cats = Cats; }
public IEnumerable <ManufacturerModel> GetAll() { var manufacturers = manufacturerRepository.GetAll(); var manufactererModels = manufacturers.Select(x => new ManufacturerModel { Name = x.Name, Details = x.Details.Select(y => new DetailModel { Price = y.Price, CarId = y.CarId, ManufacturerId = y.ManufacturerId, TypeId = y.TypeId }).ToList(), Cars = x.Cars.Select(y => new CarModel { Model = y.Model, ManufacturerId = y.ManufacturerId }).ToList() }); return(manufactererModels); }
private void Fill(GoodViewModel goodViewModel) { goodViewModel.Filters = new List <Filtration>(); foreach (var category in categoryRepository.GetAll()) { goodViewModel.Filters.Add(new Filtration { CategoryId = category.CategoryId, CategoryName = category.CategoryName }); } foreach (var manufacturer in manufacturerRepository.GetAll()) { goodViewModel.Filters.Add(new Filtration { ManufacturerId = manufacturer.ManufacturerId, ManufacturerName = manufacturer.ManufacturerName }); } }
public GoodController() { ViewBag.Categories = _categories.GetAll() .ToList() .Select(x => new SelectListItem() { Value = x.CategoryId.ToString(), Text = x.CategoryName }).ToList(); ViewBag.Manufacturers = _manufacturers.GetAll() .ToList() .Select(uc => new SelectListItem() { Value = uc.ManufacturerId.ToString(), Text = uc.ManufacturerName }) .ToList(); }
public IEnumerable <Manufacturer> GetAll() { return(manufacturerRepository.GetAll()); }
// GET: Manufacturers //Show all manufacturers. public async Task <IActionResult> Index() { return(View(await _manufacturerRepository.GetAll().ToListAsync())); }
public void SetManufacturerAndCategorieComboBox() { ManufacturerComboBox.ItemsSource = ManufacturerRepository.GetAll(); CategorieComboBox.ItemsSource = CategorieRepository.GetAll(); }
// GET: Manufacturer public ActionResult Index() { return(View(manufacturerRepository.GetAll())); }
public ActionResult Manufacturers(int id = 1) { ViewBag.CouuntPagesManufacturers = GetCountPages(_manufacturers.GetAll().Count()); return(View()); }
public List <ManufacturerListModel> GetAll() { return(mapper.Map <List <ManufacturerListModel> >(manufacturerRepository.GetAll())); }
// GET: Manufacturer public ActionResult Index() { return(View(_manufacturers.GetAll())); }