Beispiel #1
0
        public int SelectedCourse(Coursedetail detail)
        {
            int userid = Int32.Parse(Session["loggedinusernameid"].ToString());
            int result = sql.SelectCourse(detail.id, userid);

            return(result);
        }
Beispiel #2
0
        public ActionResult SubjectView(Coursedetail topic)
        {
            int courseid = Int32.Parse(Session["loggedinusercourseid"].ToString());
            int userid   = Int32.Parse(Session["loggedinusernameid"].ToString());
            int result   = sql.CheckIfAddedTopic(userid);
            int addtopic = 0;

            if (result == 1)
            {
                addtopic = sql.AddTopic(topic, courseid, userid);
            }
            else
            {
                addtopic = sql.UpdateTopic(topic, courseid, userid);
            }

            return(RedirectToAction("SubjectView", "Teacher"));
        }