public ActionResult Create(hubs_admins a, FormCollection f) { string Hubvalue = f["h"].ToString(); a.hub_id = int.Parse(Hubvalue); if (ModelState.IsValid) { db.hubs_admins.Add(a); db.SaveChanges(); return(RedirectToAction("Details", new { id = a.Id })); } return(View()); }
public ActionResult Edit(hubs_admins a, FormCollection f) { string Hubvalue = f["Hubs"].ToString(); if (ModelState.IsValid) { a.hub_id = int.Parse(Hubvalue); var entry = db.Entry(a); entry.State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(a)); }