public ActionResult subclassDelete(int sid, int cid, class_subject obj)
 {
     if (Session["id"] == null)
         return RedirectToAction("signin", "Home");
     class_subject sb = (from sub in db.class_subject where sub.classId == cid && sub.subjectId == sid select sub).FirstOrDefault<class_subject>();
     db.class_subject.DeleteObject(sb);
     db.SaveChanges();
     return RedirectToAction("SubjectClass");
 }
 public ActionResult subclassCreate(class_subject obj)
 {
     if (Session["id"] == null)
         return RedirectToAction("signin", "Home");
     try
     {
         db.class_subject.AddObject(obj);
         db.SaveChanges();
     }
     catch (Exception E)
     {
         Console.WriteLine(E);
     }
     return RedirectToAction("SubjectClass");
 }
 /// <summary>
 /// Create a new class_subject object.
 /// </summary>
 /// <param name="csId">Initial value of the csId property.</param>
 /// <param name="subjectId">Initial value of the subjectId property.</param>
 /// <param name="classId">Initial value of the classId property.</param>
 /// <param name="totalMarks">Initial value of the totalMarks property.</param>
 /// <param name="passingMarks">Initial value of the passingMarks property.</param>
 public static class_subject Createclass_subject(global::System.Int32 csId, global::System.Int32 subjectId, global::System.Int32 classId, global::System.Int32 totalMarks, global::System.Int32 passingMarks)
 {
     class_subject class_subject = new class_subject();
     class_subject.csId = csId;
     class_subject.subjectId = subjectId;
     class_subject.classId = classId;
     class_subject.totalMarks = totalMarks;
     class_subject.passingMarks = passingMarks;
     return class_subject;
 }
 public ActionResult subclassCreate(int id)
 {
     if (Session["id"] == null)
         return RedirectToAction("signin", "Home");
     class_subject myobject = new class_subject();
     myobject.classId = id;
     return View(myobject);
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the class_subject EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToclass_subject(class_subject class_subject)
 {
     base.AddObject("class_subject", class_subject);
 }