public ActionResult Checkingscr(int scr) { DataModelContext db = new DataModelContext(); PaperScore p = db.PaperScores.Find(TempData["id"]); p.Marks = scr; db.SaveChanges(); return(RedirectToAction("Check")); }
public ActionResult Add_Paper(List <CheckModelPaper> list) { DataModelContext db = new DataModelContext(); List <Paper> l = new List <Paper>(); foreach (var i in list) { Paper p; if (i.check == true) { p = db.Papers.SingleOrDefault(x => x.Id == i.Id); p.exam = db.Exams.Find(Session["eid"]); } } db.SaveChanges(); return(RedirectToAction("Add_Paper")); }
public int Add_Faculty(string name, string branch, string EQ, string email, string password, string Dob) { f.Name = name; f.EducationalQualifications = EQ; f.Email = email; f.Password = password; f.DOB = Dob; f.BranchId = 1; try { db.Facultys.Add(f); db.SaveChanges(); return(1); } catch (Exception e) { Console.WriteLine(e); return(-1); } }
public int Create_Student(string name, string password, string dob, int Sem, string Email, string phone) { s.Name = name; s.Password = password; s.DOB = dob; s.Sem = Sem; s.Email = Email; s.Phone = phone; s.BranchId = 1; s.Branch = null; try { db.Students.Add(s); db.SaveChanges(); return(1); } catch (Exception e) { Console.WriteLine(e); return(-1); } }
public int Create_Exam() { db.Exams.Add(e); db.SaveChanges(); return(db.Exams.SingleOrDefault(x => x.date == e.date).Exam_Id); }