public ActionResult Edit([Bind(Include = "CompanyId,CompanyName,CompanyAdress,CompanyDescription")] Company company) { if (ModelState.IsValid) { db.Entry(company).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(company)); }
public ActionResult Edit([Bind(Include = "JobId,JobName,JobDescription,JobLocation,JobPosiotion,CompanyId,JobPublishedDate")] Job job) { if (ModelState.IsValid) { db.Entry(job).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CompanyId = new SelectList(db.Companies, "CompanyId", "CompanyName", job.CompanyId); return(View(job)); }