public ActionResult RectorMessage() { var result = _universityInfo.GetAll(); List <UniversityInfoViewModel> model = new List <UniversityInfoViewModel>(); foreach (var item in result) { model.Add(new UniversityInfoViewModel { RectorMessage = item.RectorMessage }); } return(View(model)); }
public ActionResult AddFacultyInfo() { var result = (from user in db.Users select new UserViewModel() { Id = user.Id, FirstName = user.FirstName, LastName = user.LastName, RectorNameSurname = user.FirstName + " " + user.LastName }).ToList(); ViewBag.Dean = new SelectList(result, "Id", "RectorNameSurname"); var university = _universityBusiness.GetAll().ToList(); ViewBag.University = new SelectList(university, "Id", "Name"); return(View()); }
public ActionResult ListUniversityInfo() { var result = _universityInfo.GetAll().Select(x => new UniversityInfoViewModel() { Id = x.Id, Name = x.Name, Address = x.Address, Phone = x.Phone, FaxNo = x.FaxNo, Email = x.Email }); return(View(result)); }
public ActionResult AddNews() { var result = _universityBusiness.GetAll().ToList(); List <UniversityInfoViewModel> model = new List <UniversityInfoViewModel>(); foreach (var item in result) { model.Add(new UniversityInfoViewModel { Id = item.Id, Name = item.Name }); } ViewBag.University = new SelectList(result, "Id", "Name"); return(View()); }
public IHttpActionResult GetAll() { var result = _universityInfo.GetAll().Select(model => new UniversityInfoViewModel { Id = model.Id, Name = model.Name, History = model.History, Mission = model.Mission, Vission = model.Vission, Address = model.Address, Phone = model.Phone, FaxNo = model.FaxNo, Email = model.Email, RectorId = model.ApplicationUserrId, RectorMessage = model.RectorMessage }); return(Ok(result)); }