public ActionResult CreateBranch()
        {
            ViewBag.courseList = course.CourseList().ToList();


            return(View());
        }
        public ActionResult CreateSemester()
        {
            ViewBag.courseList = course.CourseList().ToList();


            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult CreateStudent()
        {
            var gender_Type = new List <DDL_Data> {
                new DDL_Data()
                {
                    vchText = "Male", vchValue = "Male"
                },
                new DDL_Data()
                {
                    vchText = "Female", vchValue = "Famale"
                },
                new DDL_Data()
                {
                    vchText = "Others", vchValue = "Others"
                }
            };

            ViewBag.gender_Type      = gender_Type.ToList();
            ViewBag.courseList       = _course.CourseList().ToList();
            ViewBag.joincategoryList = _joincategory.JoinCategoryList().ToList();

            return(View());
        }
        public ActionResult GetCourse()
        {
            //Draw counter. This is used by DataTables to ensure that the Ajax returns from server-side processing requests are drawn in sequence by DataTables (Ajax requests are asynchronous and thus can return out of sequence).
            var draw = Request.Form.GetValues("draw").FirstOrDefault();

            //Paging first record indicator. This is the start point in the current data set (0 index based - i.e. 0 is the first record)
            var start = Request.Form.GetValues("start").FirstOrDefault();
            //Number of records that the table can display in the current draw.
            var length = Request.Form.GetValues("length").FirstOrDefault();

            //Find Order Column
            var sortColumn    = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault();
            var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault();

            int pageSize = length != null?Convert.ToInt32(length) : 0;

            int skip = start != null?Convert.ToInt32(start) : 0;

            int recordsTotal = 0;

            var courseList = (from a in course.CourseList() select a);

            string search = Request.Form.GetValues("search[value]")[0];

            // Verification.
            if (!string.IsNullOrEmpty(search) &&
                !string.IsNullOrWhiteSpace(search))
            {
                // Apply search
                courseList = courseList.Where(p => p.vchCourseName.ToString().ToLower().Contains(search.ToLower()) ||
                                              p.vchCourseDescription.ToString().ToLower().Contains(search.ToLower()));
            }

            //SORT
            // if (!(string.IsNullOrEmpty(sortColumn) && string.IsNullOrEmpty(sortColumnDir)))
            //{
            //courseList = courseList.OrderBy(sortColumn + " " + sortColumnDir);
            //}


            recordsTotal = courseList.Count();
            var data = courseList.Skip(skip).Take(pageSize).ToList();

            return(Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = data }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult CreateSubject()
        {
            var subject_Type = new List <DDL_Data> {
                new DDL_Data()
                {
                    vchText = "Theory", vchValue = "Theory"
                },
                new DDL_Data()
                {
                    vchText = "Practical", vchValue = "Practical"
                }
            };

            ViewBag.subject_Type = subject_Type.ToList();

            var subject_Category = new List <DDL_Data> {
                new DDL_Data()
                {
                    vchText = "Basic Science Courses", vchValue = "BS"
                },
                new DDL_Data()
                {
                    vchText = "Engineering Science Courses", vchValue = "ES"
                },
                new DDL_Data()
                {
                    vchText = "Professional Core Courses", vchValue = "Prof"
                },
                new DDL_Data()
                {
                    vchText = "Humanities and Social Sciences including Management Courses", vchValue = "Humanities"
                },
                new DDL_Data()
                {
                    vchText = "Mandatory Courses", vchValue = "Mandatory"
                }
            };

            ViewBag.subject_Category = subject_Category.ToList();
            ViewBag.courseList       = course.CourseList().ToList();


            return(View());
        }