public ActionResult Create([Bind(Include = "ID,FirstName,LastName,UserName,Password")] User user) { if (ModelState.IsValid) { db.Users.Add(user); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Create([Bind(Include = "ID,Batch1,Year")] Batch batch) { if (ModelState.IsValid) { db.Batches.Add(batch); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(batch)); }
public ActionResult Create([Bind(Include = "ID,CourseName,Duration")] Course course) { if (ModelState.IsValid) { db.Courses.Add(course); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(course)); }
public ActionResult Create([Bind(Include = "ID,FirstName,LastName,nic,Course_ID,Batch_ID,Phone")] Regstration regstration) { if (ModelState.IsValid) { db.Regstrations.Add(regstration); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Batch_ID = new SelectList(db.Batches, "ID", "Batch1", regstration.Batch_ID); ViewBag.Course_ID = new SelectList(db.Courses, "ID", "CourseName", regstration.Course_ID); return(View(regstration)); }