Exemplo n.º 1
0
        public ActionResult DeanMessage()
        {
            var result = _facultyInfo.GetAll().Take(1);
            List <FacultyInfoViewModel> model = new List <FacultyInfoViewModel>();

            foreach (var item in result)
            {
                model.Add(new FacultyInfoViewModel
                {
                    DeanMessage = item.DeanMessage
                });
            }

            return(View(model));
        }
        public ActionResult ListFacultyInfo()
        {
            var result = _facultyInfo.GetAll().Select(x => new FacultyInfoViewModel
            {
                Id             = x.Id,
                Name           = x.Name,
                Address        = x.Address,
                Phone          = x.Phone,
                FaxNo          = x.FaxNo,
                Email          = x.Email,
                UniversityInfo = x.UniversityInfo
            });

            return(View(result));
        }
Exemplo n.º 3
0
        public IHttpActionResult GetAll()
        {
            var result = _facultyInfo.GetAll().Select(model => new FacultyInfoViewModel
            {
                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,
                DeanId      = model.ApplicationUserrId,
                DeanMessage = model.DeanMessage
            });

            return(Ok(result));
        }
        public ActionResult AddDepartmentInfo()
        {
            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.HeadOfDepart = new SelectList(result, "Id", "RectorNameSurname");

            var facultuy = _facultyInfo.GetAll().ToList();

            ViewBag.Faculty = new SelectList(facultuy, "Id", "Name");


            return(View());
        }