public ActionResult Create([Bind(Include = "ShortId,Username,password,Role")] User user) { if (ModelState.IsValid) { db.Users.Add(user); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Create([Bind(Include = "JobId,JobPosition,JobType,PostedDate,PostedBy,numberofPostions,SupervisoryOrganisation,fulfilldate,JobStatus")] Job job) { if (ModelState.IsValid) { db.Jobs.Add(job); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(job)); }
public ActionResult Create([Bind(Include = "JobId,Locationname")] Location location) { if (ModelState.IsValid) { db.Locations.Add(location); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.JobId = new SelectList(db.Jobs, "JobId", "JobId", location.JobId); return(View(location)); }