예제 #1
0
        public bool updateRate(int userid, string questionid, int rate)
        {
            LessonBL lessonbl = new LessonBL();

            ctx = new ST_LMSEntities();
            Result getRate = ctx.Results.Where(x => x.user_id == userid && x.question_id == questionid).FirstOrDefault();

            if (getRate.pre == null)
            {
                getRate.pre = rate;
                ctx.SaveChanges();
                return(true);
            }
            else
            if (getRate.post == null)
            {
                getRate.post     = rate;
                getRate.complete = true;
                ctx.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
        public Result getUserLesson(int userid, string lessonid)
        {
            ctx = new ST_LMSEntities();
            Result getResult = ctx.Results.Where(x => x.user_id == userid && x.lesson_id == lessonid).FirstOrDefault();

            return(getResult);
        }
예제 #3
0
        protected void btnStart_Click(object sender, EventArgs e)
        {
            ctx = new ST_LMSEntities();
            Cours  SelectedCourses = (Cours)Session["SelectedCourses"];
            string CourseID        = SelectedCourses.course_id.ToString();

            Session["SelectedCourseID"] = CourseID;

            Response.Redirect("LessonForm.aspx");
        }
예제 #4
0
        public User getLoginUser(string userName, string password)
        {
            ctx = new ST_LMSEntities();
            User getUser = ctx.Users.Where(x => x.user_name == userName && x.password == password).FirstOrDefault();

            if (getUser != null)
            {
                return(getUser);
            }
            else
            {
                return(null);
            }
        }
예제 #5
0
        public bool checkLoginUser(string userName, string password)
        {
            ctx = new ST_LMSEntities();
            User login = ctx.Users.Where(x => x.user_name == userName && x.password == password).FirstOrDefault();

            if (login == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
예제 #6
0
        public bool updateincrease(int userid, string questionid)
        {
            LessonBL lessonbl = new LessonBL();

            ctx = new ST_LMSEntities();
            Result getRate = ctx.Results.Where(x => x.user_id == userid && x.question_id == questionid).FirstOrDefault();

            if (getRate.complete == true)
            {
                int increase = Convert.ToInt32(getRate.post) - Convert.ToInt32(getRate.pre);
                getRate.increase = increase;
                ctx.SaveChanges();
                return(true);
            }
            else
            {
                return(true);
            }
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ctx = new ST_LMSEntities();
            Cours SelectedCourses = (Cours)Session["SelectedCourses"];

            int userid = Convert.ToInt32(SelectedCourses.user_id);



            lblCourseName.Text  = SelectedCourses.course_name.ToString();
            lblDescription.Text = SelectedCourses.description.ToString();
            lblUpdateDate.Text  = SelectedCourses.update_date.ToString();
            lblDuration.Text    = SelectedCourses.duration.ToString();

            User author = CourseBl.getUser(userid);

            lblContactNo.Text = author.contact_no.ToString();
            lblEmail.Text     = author.email.ToString();
            lblUserName.Text  = author.user_name.ToString();
        }
예제 #8
0
 public List <Lesson> getLessonList(string course_id)
 {
     ctx = new ST_LMSEntities();
     return(ctx.Lessons.Where(x => x.course_id == course_id).ToList());
 }
예제 #9
0
 public Lesson getLesson(string lesson_id)
 {
     ctx = new ST_LMSEntities();
     return(ctx.Lessons.Where(x => x.lesson_id == lesson_id).FirstOrDefault());
 }
예제 #10
0
 public List <Cours> getCourseList(string role)
 {
     ctx = new ST_LMSEntities();
     return(ctx.Courses.Where(x => x.role == role).ToList());
 }
예제 #11
0
 public User getUser(int userID)
 {
     ctx = new ST_LMSEntities();
     return((User)ctx.Users.Where(x => x.user_id == userID).FirstOrDefault());
 }
예제 #12
0
 public Cours courseList(string courseID)
 {
     ctx = new ST_LMSEntities();
     return((Cours)ctx.Courses.Where(x => x.course_id == courseID));
 }