public ActionResult DeleteConfirmed(int id) { AspNetBusiness aspNetBusiness = db.AspNetBusinesses.Find(id); db.AspNetBusinesses.Remove(aspNetBusiness); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,Name,Value,Address")] AspNetBusiness aspNetBusiness) { if (ModelState.IsValid) { db.Entry(aspNetBusiness).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aspNetBusiness)); }
// GET: Business/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AspNetBusiness aspNetBusiness = db.AspNetBusinesses.Find(id); if (aspNetBusiness == null) { return(HttpNotFound()); } return(View(aspNetBusiness)); }
public ActionResult Create([Bind(Include = "Name,Value,Address")] AspNetBusiness aspNetBusiness) { if (ModelState.IsValid) { db.AspNetBusinesses.Add(aspNetBusiness); db.AspNetBusinessUsers.Add(new AspNetBusinessUser { UserId = User.Identity.GetUserId(), BusinessId = aspNetBusiness.id }); db.SaveChanges(); return(RedirectToAction("/Details/" + aspNetBusiness.id)); } return(View(aspNetBusiness)); }