public ActionResult DeleteConfirm(int Id) { AgentRepresentative agentRepresentative = db.AgentRepresentatives.Find(Id); db.AgentRepresentatives.Remove(agentRepresentative); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AgentRepresentativeID,FirstMidName,LastName,ContactNumber,EmailAddress")] AgentRepresentative agentRepresentative) { if (ModelState.IsValid) { db.Entry(agentRepresentative).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(agentRepresentative)); }
public ActionResult Create([Bind(Include = "FirstMidName,LastName,ContactNumber,EmailAddress,FullName")] AgentRepresentative agentRepresentative) { if (ModelState.IsValid) { db.AgentRepresentatives.Add(agentRepresentative); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(agentRepresentative)); }
public ActionResult Details(int?Id) { if (Id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AgentRepresentative agentRepresentative = db.AgentRepresentatives.Find(Id); if (agentRepresentative == null) { return(HttpNotFound()); } return(View(agentRepresentative)); }