// ************************** // URL: /Manager/Tasks/Create/ // ************************** public ActionResult Create() { var task = new Task(); ViewBag.Employees = GetEngineersAndMe(); ViewBag.Areas = _areaRepository.FindAll(); var items = EnumHelper.GetItemsOf <Priority>(); ViewBag.Priority = new SelectList(items, "ID", "Name", task.Priority); return(View(task)); }
// GET: AreaController public ActionResult Index() { var area = _areaRepository.FindAll().ToList(); var model1 = _mapper.Map <List <Area>, List <DetailsAreaViewModel> >(area); return(View(model1)); }
public ActionResult Index(int page = 1) { ViewBag.Message = TempData[MESSAGE_KEY]; if (TempData.ContainsKey(MESSAGE_KEY)) { ModelState.AddModelError("", ((String)TempData[MESSAGE_KEY])); } List <int> areaIds = CurrentAvailableAreas.Select(area => area.Id).ToList(); IEnumerable <AreaModel> areaModels = areaRepository .FindAll(area => areaIds.Contains(area.Id), new PagingOptions <Area>(page, Pagination.DefaultPageSize, "Name")) .Select(AreaToViewModel); ViewBag.Pagination = new Pagination { CurrentPage = page, TotalCount = areaModels.Count() }; return(View(areaModels)); }
public void FindAll_ReturnsList() { //Arrange IList <Area> areas = new List <Area>() { new Area(), new Area() }; Mock <IAreaRepository> MockAreaRepository = new Mock <IAreaRepository>(); AreaRepositorySetupMoq.FindAll(MockAreaRepository, areas); IAreaRepository areaRepository = MockAreaRepository.Object; //Act IList <Area> findedTrips = areaRepository.FindAll(); //Assert Assert.AreEqual(findedTrips.Count, areas.Count); Assert.AreEqual(findedTrips.Count, 2); }
public IList <Area> FindAll() { return(areaRepository.FindAll()); }
// GET: CityController/Create public ActionResult Create() { ViewData["SelectCountry"] = new SelectList(_countryRepository.FindAll(), "CountryId", "CountryName"); ViewData["selectArea"] = new SelectList(_areaRepository.FindAll(), "AriaId", "AriaName"); return(View()); }
// ************************** // URL: /Manager/Area/ // ************************** public ActionResult Index() { var areas = _areaRepository.FindAll(); return(View(areas)); }