// // GET: /category/ public ActionResult Index() { var model = new PosCategoriesListViewModel(); model.Organization = new Organization { Name = "ALL" }; model.Categories = _repository.Categories.ToList(); //var db = new ProductRepository(); return View("List", Layout, model); }
public ViewResult List(int? id) { var model = new PosCategoriesListViewModel(); if(id.HasValue && id.Value > 0) { model.Organization = _organizationRepository.Organizations.Single(x => x.Id == id); model.Categories = _repository.GetCategoriesBy(model.Organization.Id, 0, 0, 100).ToList(); } else { model.Organization = new Organization { Name = "ALL" }; model.Categories = _repository.Categories.OrderBy(x => x.Name).ToList(); } return View("List", Layout, model); }
// // GET: /pradmin/categories/500001 public ActionResult Categories(int id) { var model = new PosCategoriesListViewModel(); var db = new ProductRepository(); throw new NotImplementedException("Need to Ninject CategoryRepository!"); //model.Organization = new OrganizationRepository().Items.Single(x => x.Id == id); //model.Categories = db.Categories.Where(x => x.OrganizationId == model.Organization.Id).ToList(); return View(model); }