// **************************
        // 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));
        }
Пример #2
0
        // GET: AreaController
        public ActionResult Index()
        {
            var area   = _areaRepository.FindAll().ToList();
            var model1 = _mapper.Map <List <Area>, List <DetailsAreaViewModel> >(area);

            return(View(model1));
        }
Пример #3
0
        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);
        }
Пример #5
0
 public IList <Area> FindAll()
 {
     return(areaRepository.FindAll());
 }
Пример #6
0
 // GET: CityController/Create
 public ActionResult Create()
 {
     ViewData["SelectCountry"] = new SelectList(_countryRepository.FindAll(), "CountryId", "CountryName");
     ViewData["selectArea"]    = new SelectList(_areaRepository.FindAll(), "AriaId", "AriaName");
     return(View());
 }
Пример #7
0
        // **************************
        // URL: /Manager/Area/
        // **************************

        public ActionResult Index()
        {
            var areas = _areaRepository.FindAll();

            return(View(areas));
        }