public ActionResult DeleteConfirmed(int id) { profile profile = db.profiles.Find(id); db.profiles.Remove(profile); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "pId,uid,address,city,province,country,pic_url")] profile profile) { if (ModelState.IsValid) { db.Entry(profile).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.uid = new SelectList(db.users, "uId", "UName", profile.uid); return(View(profile)); }
// GET: profiles/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } profile profile = db.profiles.Find(id); if (profile == null) { return(HttpNotFound()); } return(View(profile)); }
// GET: profiles/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } profile profile = db.profiles.Find(id); if (profile == null) { return(HttpNotFound()); } ViewBag.uid = new SelectList(db.users, "uId", "UName", profile.uid); return(View(profile)); }