コード例 #1
0
        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));
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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());
        }
コード例 #5
0
        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));
        }