Example #1
0
      public ActionResult DeleteConfirmed(string id)
      {
          TopicAssign topicAssign = db.TopicAssigns.Find(id);

          db.TopicAssigns.Remove(topicAssign);
          db.SaveChanges();
          return(RedirectToAction("Index"));
      }
Example #2
0
 public ActionResult Edit([Bind(Include = "TopicAssignID,TopicID,CourseID")] TopicAssign topicAssign)
 {
     if (ModelState.IsValid)
     {
         db.Entry(topicAssign).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CourseID = new SelectList(db.Courses, "CourseID", "CourseName", topicAssign.CourseID);
     ViewBag.TopicID  = new SelectList(db.Topics, "TopicID", "TopicName", topicAssign.TopicID);
     return(View(topicAssign));
 }
Example #3
0
      // GET: TopicAssigns/Details/5
      public ActionResult Details(string id)
      {
          if (id == null)
          {
              return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
          }
          TopicAssign topicAssign = db.TopicAssigns.Find(id);

          if (topicAssign == null)
          {
              return(HttpNotFound());
          }
          return(View(topicAssign));
      }
Example #4
0
      // GET: TopicAssigns/Edit/5
      public ActionResult Edit(string id)
      {
          if (id == null)
          {
              return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
          }
          TopicAssign topicAssign = db.TopicAssigns.Find(id);

          if (topicAssign == null)
          {
              return(HttpNotFound());
          }
          ViewBag.CourseID = new SelectList(db.Courses, "CourseID", "CourseName", topicAssign.CourseID);
          ViewBag.TopicID  = new SelectList(db.Topics, "TopicID", "TopicName", topicAssign.TopicID);
          return(View(topicAssign));
      }