Exemplo n.º 1
0
        private SelectList GetUniversityList(int EducationCategoryID)
        {
            List <Master_University> List = new List <Master_University>();
            //List<Master_University> MappingList = new List<Master_University>();
            List <EducationCategoryUniversityBoardMapping> ListMapping = new List <EducationCategoryUniversityBoardMapping>();


            if (EducationCategoryID > 0)
            {
                int _EducationCategoryID = Convert.ToInt32(EducationCategoryID);

                List        = _IUniversityService.GetAll(null, null, "").ToList();
                ListMapping = _IEducationCategoryUniversityBoardMappingService.GetAll(null, null, "").Where(x => x.EducationCategoryID == _EducationCategoryID).ToList();
            }

            var MappingList = (from A in List join B in ListMapping on A.UniversityID equals B.UniversityID select new { A.UniversityID, A.University }).ToList();
            var other       = (from A in List where A.University == "Other" select new { A.UniversityID, A.University }).FirstOrDefault();

            MappingList.Add(other);


            SelectList selList = new SelectList(MappingList, "UniversityID", "University");

            return(selList);
        }
Exemplo n.º 2
0
 public IEnumerable <UniversityViewModel> GetAll()
 {
     return(_service.GetAll().Select(p => new UniversityViewModel {
         UniversityId = p.UniversityId, Name = p.Name, Address = p.Address
     }).ToList());
 }
Exemplo n.º 3
0
 // GET api/<controller>
 public List <UniversityDTO> Get()
 {
     return(uniService.GetAll());
 }
Exemplo n.º 4
0
        public async Task <IActionResult> GetAll()
        {
            var result = await _universityService.GetAll();

            return(Ok(result));
        }
 public IHttpActionResult Get()
 {
     return(Content(HttpStatusCode.OK, _universityService.GetAll()));
 }
 public virtual async Task <ActionResult> GetUniversitiesList()
 {
     return(Json(await _universityService.GetAll(), JsonRequestBehavior.AllowGet));
 }