// GET: Field/Create
        public ActionResult Create()
        {
            NeighborhoodVM neighborhood = new NeighborhoodVM();

            neighborhood.Governorates = GovernorateService.GetAllGovernorates().Select(a => new SelectListItem
            {
                Text  = a.Name,
                Value = a.ID.ToString()
            }).ToList();
            return(View(neighborhood));
        }
        // GET: Governorate
        public ActionResult Index()
        {
            List <GovernorateListingVM> governorateListingVM = new List <GovernorateListingVM>();

            GovernorateService.GetAllGovernorates().ToList().ForEach(c => {
                GovernorateListingVM governorateListing = new GovernorateListingVM
                {
                    ID   = c.ID,
                    Name = c.Name
                };
                governorateListingVM.Add(governorateListing);
            });

            return(View(governorateListingVM));
        }
Exemple #3
0
        // GET: Student
        public ActionResult Index()
        {
            StudentVM student = new StudentVM();

            student.Governorates = governorateService.GetAllGovernorates().Select(a => new SelectListItem
            {
                Text  = a.Name,
                Value = a.ID.ToString()
            }).ToList();
            student.Fields = fieldService.GetAllFields().Select(a => new SelectListItem
            {
                Text  = a.Name,
                Value = a.ID.ToString()
            }).ToList();
            student.Neighborhoods = neighborhoodService.GetAllNeighborhoods().Select(a => new SelectListItem
            {
                Text  = a.Name,
                Value = a.ID.ToString()
            }).ToList();
            return(View(student));
        }