コード例 #1
0
        public ActionResult SearchResult(string query)
        {
            //get courses based on query
            var result = courseRepo.getData();

            result = result.Where(e => e.CourseName.Contains(query)).ToList();

            //store logged in user data in viewbag
            if (User != null && User.IsInRole("Student"))
            {
                string  userId = User.Identity.GetUserId();
                Student user   = context.Students.Where(e => e.UserId == userId).FirstOrDefault();
                ViewBag.loggedInUser = user.StudentRowId;
            }

            return(View(result));
        }
コード例 #2
0
        // GET: Product
        public ActionResult Index()
        {
            var result = productRepo.getData();

            return(View(result));
        }
コード例 #3
0
        // GET: Student
        public ActionResult Index()
        {
            var result = studentRepo.getData();

            return(View(result));
        }
コード例 #4
0
        // GET: Trainer
        public ActionResult Index()
        {
            var result = trainerRepo.getData();

            return(View(result));
        }
コード例 #5
0
        // GET: Course
        public ActionResult Index()
        {
            var result = courseRepo.getData();

            return(View(result));
        }
        // GET: AreaOfInterest
        public ActionResult Index()
        {
            var result = areaOfInterestRepo.getData();

            return(View(result));
        }