Esempio n. 1
0
        public ActionResult DeleteConfirm(int Id)
        {
            AgentRepresentative agentRepresentative = db.AgentRepresentatives.Find(Id);

            db.AgentRepresentatives.Remove(agentRepresentative);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 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));
 }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        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));
        }