public ActionResult Edit([Bind(Include = "JobSectorCategoryId,SectorName")] JobSectorCategory jobSectorCategory) { if (ModelState.IsValid) { db.Entry(jobSectorCategory).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobSectorCategory)); }
public ActionResult Create([Bind(Include = "JobSectorCategoryId,SectorName")] JobSectorCategory jobSectorCategory) { if (ModelState.IsValid) { // add and save the new insyance to the db db.JobSectors.Add(jobSectorCategory); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobSectorCategory)); }
// GET: JobSector/Edit/5 /// <summary> /// The getter for editng a current Jon Sector Value /// </summary> /// <param name="id">Identifier for Job Sector</param> /// <returns></returns> public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } // Finf Job Sector from parameter id JobSectorCategory jobSectorCategory = db.JobSectors.Find(id); if (jobSectorCategory == null) { return(HttpNotFound()); } return(View(jobSectorCategory)); }