Esempio n. 1
0
        public ActionResult Index()
        {
            List <FieldListingVM> fieldListingVM = new List <FieldListingVM> ();

            fieldService.GetAllFields().ToList().ForEach(c => {
                FieldListingVM fieldListing = new FieldListingVM
                {
                    ID   = c.ID,
                    Name = c.Name
                };
                fieldListingVM.Add(fieldListing);
            });

            return(View(fieldListingVM));
        }
Esempio n. 2
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));
        }
 public IHttpActionResult GetAllFields()
 {
     List<FieldResultDTO> field = fieldSvc.GetAllFields();
     return Ok(field);
 }