Пример #1
0
        public ActionResult viewonlinetest()
        {
            if (Session["Student"] == null)
            {
                return(RedirectToAction("Login", "Account", new { area = "" }));
            }

            int    studentid = Convert.ToInt32(Session["Student"]);
            int    tempclassid;
            int    originalclassid;
            string Regno;
            var    getstudentid = db.Students.Find(studentid);

            tempclassid = getstudentid.Class_Id;
            Regno       = getstudentid.RegNo;
            var classid = db.Tbl_Class.Where(x => x.Class_Id == tempclassid).SingleOrDefault();

            originalclassid = classid.Class_Id;
            //AB enroll course wala dropdown ajayega
            CourseDBHandle gc = new CourseDBHandle();

            List <tblEnrollStudentInCourseValidation> list = gc.GetSudentEnrollCourse(Regno, originalclassid);

            ViewBag.course = new SelectList(list, "courseId", "courseName");


            return(View());
        }
Пример #2
0
        public ActionResult addfeedback()
        {
            if (Session["Student"] == null)
            {
                return(RedirectToAction("Login", "Account", new { area = "" }));
            }
            try
            {
                int    studentid = Convert.ToInt32(Session["Student"]);
                int    tempclassid;
                int    schoolid;
                int    originalclassid;
                string Regno;
                var    getstudentid = db.Students.Find(studentid);
                tempclassid = getstudentid.Class_Id;
                schoolid    = getstudentid.School_Id;
                Regno       = getstudentid.RegNo;
                var classid = db.Tbl_Class.Where(x => x.Class_Id == tempclassid).SingleOrDefault();
                originalclassid = classid.Class_Id;

                CourseDBHandle gc = new CourseDBHandle();

                List <tblEnrollStudentInCourseValidation> list = gc.GetSudentEnrollCourse(Regno, originalclassid);
                ViewBag.course = new SelectList(list, "courseId", "courseName");
                //ViewBag.Product_CategoryID = new SelectList(db.Courses, "courseId", "courseName");
                return(View());
            }
            catch (Exception ex)
            {
                ViewBag.Message = "There is some error in processing";
                return(View());
            }
        }
Пример #3
0
        public ActionResult viewtest(tblEnrollStudentInCourseValidation testing)
        {
            try
            {
                int    studentid = Convert.ToInt32(Session["Student"]);
                int    tempclassid;
                int    originalclassid;
                string Regno;
                var    getstudentid = db.Students.Find(studentid);
                tempclassid = getstudentid.Class_Id;
                Regno       = getstudentid.RegNo;
                var classid = db.Tbl_Class.Where(x => x.Class_Id == tempclassid).SingleOrDefault();
                originalclassid = classid.Class_Id;

                CourseDBHandle gc = new CourseDBHandle();

                List <tblEnrollStudentInCourseValidation> list = gc.GetSudentEnrollCourse(Regno, originalclassid);
                ViewBag.course = new SelectList(list, "courseId", "courseName");


                return(RedirectToAction("viewuploadedtest", new { courseid = testing.courseId }));
            }
            catch (Exception ex)
            {
                ViewBag.Message = "Please try later";
                return(View());
            }
        }
Пример #4
0
        public ActionResult viewdiscussion(tblEnrollStudentInCourseValidation testing)
        {
            try
            {
                int    studentid = Convert.ToInt32(Session["Student"]);
                int    tempclassid;
                int    originalclassid;
                string Regno;
                var    getstudentid = dbContext.Students.Find(studentid);
                tempclassid = getstudentid.Class_Id;
                Regno       = getstudentid.RegNo;
                var classid = dbContext.Tbl_Class.Where(x => x.Class_Id == tempclassid).SingleOrDefault();
                originalclassid = classid.Class_Id;
                //AB enroll course wala dropdown ajayega
                CourseDBHandle gc = new CourseDBHandle();

                List <tblEnrollStudentInCourseValidation> list = gc.GetSudentEnrollCourse(Regno, originalclassid);
                ViewBag.course = new SelectList(list, "courseId", "courseName");
                //TempData["course"] = testing.courseId;

                //var data = db.SchoolAssignments.ToList();
                return(RedirectToAction("Index", new { courseid = testing.courseId }));
            }
            catch (Exception ex)
            {
                ViewBag.Message = "Please try later";
                return(View());
            }
        }
Пример #5
0
        public ActionResult PostMessage(MessageReplyViewModel vm)
        {
            //var username = User.Identity.Name;
            //string fullName = "";
            int msgid = 0;

            int    teacherid = Convert.ToInt32(Session["Student"]);
            int    tempclassid;
            int    originalclassid;
            string Regno;
            var    getteacherid = dbContext.Students.Find(teacherid);

            tempclassid = getteacherid.Class_Id;
            Regno       = getteacherid.RegNo;
            var classid1 = dbContext.Tbl_Class.Where(x => x.Class_Id == tempclassid).SingleOrDefault();

            originalclassid = classid1.Class_Id;
            //AB enroll course wala dropdown ajayega
            CourseDBHandle gc = new CourseDBHandle();

            List <tblEnrollStudentInCourseValidation> list = gc.GetSudentEnrollCourse(Regno, originalclassid);

            ViewBag.course = new SelectList(list, "courseId", "courseName");
            int schoolid;
            int classid;

            schoolid = getteacherid.School_Id;
            classid  = getteacherid.Class_Id;

            //if (!string.IsNullOrEmpty(username))
            //{
            //    var user = dbContext.loginTables.SingleOrDefault(u => u.Name == username);
            //    fullName = string.Concat(new string[] { user.Name });
            //}
            Message messagetoPost = new Message();

            if (vm.Message.Subject != string.Empty && vm.Message.MessageToPost != string.Empty)
            {
                messagetoPost.DatePosted    = DateTime.Now;
                messagetoPost.Subject       = vm.Message.Subject;
                messagetoPost.MessageToPost = vm.Message.MessageToPost;
                messagetoPost.From          = Session["StudentName"].ToString();
                messagetoPost.Class_Id      = classid;
                messagetoPost.Role_ID       = 4;
                messagetoPost.UserId        = teacherid;
                messagetoPost.courseId      = vm.Message.courseId;


                messagetoPost.SchoolId = schoolid;
                dbContext.Messages.Add(messagetoPost);
                dbContext.SaveChanges();
                msgid = messagetoPost.Id;
            }

            return(RedirectToAction("Index", "Message", new { Id = msgid, courseid = vm.Message.courseId }));
        }
Пример #6
0
        public ActionResult addfeedback(tbl_FeedbackValidation fv)
        {
            try
            {
                int    studentid = Convert.ToInt32(Session["Student"]);
                int    tempclassid;
                int    schoolid;
                int    originalclassid;
                string Regno;
                var    getstudentid = db.Students.Find(studentid);
                tempclassid = getstudentid.Class_Id;
                schoolid    = getstudentid.School_Id;
                Regno       = getstudentid.RegNo;
                var classid = db.Tbl_Class.Where(x => x.Class_Id == tempclassid).SingleOrDefault();
                originalclassid = classid.Class_Id;

                fv.SchoolId = schoolid;
                CourseDBHandle gc = new CourseDBHandle();

                List <tblEnrollStudentInCourseValidation> list = gc.GetSudentEnrollCourse(Regno, originalclassid);
                ViewBag.course = new SelectList(list, "courseId", "courseName");
                UserFeedback f = new UserFeedback();
                f.CourseId    = fv.CourseId;
                f.Description = fv.Description;
                f.CreatedDate = DateTime.Now;
                f.UserId      = Convert.ToInt32(Session["Student"]);
                f.RoleId      = 4;
                f.SchoolId    = fv.SchoolId;

                db.UserFeedbacks.Add(f);
                db.SaveChanges();


                ModelState.Clear();

                ViewBag.Message = "Data Submitted";
            }
            catch (Exception ex)
            {
                ViewBag.Message = "Not Submitted";
                return(View());
            }
            return(View());
        }
Пример #7
0
        public ActionResult Create()
        {
            MessageReplyViewModel vm = new MessageReplyViewModel();
            int    teacherid         = Convert.ToInt32(Session["Student"]);
            int    tempclassid;
            int    originalclassid;
            string Regno;
            var    getteacherid = dbContext.Students.Find(teacherid);

            tempclassid = getteacherid.Class_Id;
            Regno       = getteacherid.RegNo;
            var classid1 = dbContext.Tbl_Class.Where(x => x.Class_Id == tempclassid).SingleOrDefault();

            originalclassid = classid1.Class_Id;
            //AB enroll course wala dropdown ajayega
            CourseDBHandle gc = new CourseDBHandle();

            List <tblEnrollStudentInCourseValidation> list = gc.GetSudentEnrollCourse(Regno, originalclassid);

            ViewBag.course = new SelectList(list, "courseId", "courseName");
            return(View(vm));
        }
Пример #8
0
        public ActionResult notesviewer(tblEnrollStudentInCourseValidation testing)
        {
            int    studentid = Convert.ToInt32(Session["Student"]);
            int    tempclassid;
            int    originalclassid;
            string Regno;
            var    getstudentid = db.Students.Find(studentid);

            tempclassid = getstudentid.Class_Id;
            Regno       = getstudentid.RegNo;
            var classid = db.Tbl_Class.Where(x => x.Class_Id == tempclassid).SingleOrDefault();

            originalclassid = classid.Class_Id;

            CourseDBHandle gc = new CourseDBHandle();

            List <tblEnrollStudentInCourseValidation> list = gc.GetSudentEnrollCourse(Regno, originalclassid);

            ViewBag.course = new SelectList(list, "courseId", "courseName");


            return(RedirectToAction("notesview", new { courseid = testing.courseId }));
        }