コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Person_Details person_Details = db.Person_Details.Find(id);

            db.Person_Details.Remove(person_Details);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,EntityId,PhoneNumber1,PhoneNumber2,EmailId,Occupation,OccupativeAddress,Salary,Person_TypeId")] Person_Details person_Details)
 {
     if (ModelState.IsValid)
     {
         db.Entry(person_Details).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Person_TypeId = new SelectList(db.Person_Type, "Id", "Father", person_Details.Person_TypeId);
     return(View(person_Details));
 }
コード例 #3
0
        // GET: Person_Details/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Person_Details person_Details = db.Person_Details.Find(id);

            if (person_Details == null)
            {
                return(HttpNotFound());
            }
            return(View(person_Details));
        }
コード例 #4
0
        // GET: Person_Details/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Person_Details person_Details = db.Person_Details.Find(id);

            if (person_Details == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Person_TypeId = new SelectList(db.Person_Type, "Id", "Father", person_Details.Person_TypeId);
            return(View(person_Details));
        }