Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "dependentsid,dependents_code,staffid,dependents_first_name,dependents_last_name,dependents_gender,dependents_phone_num,dependents_blood_group,dependents_passport_num,dependents_passport_expiry_date,dependents_notes,dependents_medical_condition")] dependent dependent)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dependent).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.staffid = new SelectList(db.staffs, "staffid", "staff_email", dependent.staffid);
     return(View(dependent));
 }
Ejemplo n.º 2
0
        // GET: /dependent/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            dependent dependent = db.dependents.Find(id);

            if (dependent == null)
            {
                return(HttpNotFound());
            }
            return(View(dependent));
        }
Ejemplo n.º 3
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         dependent dependent = db.dependents.Find(id);
         db.dependents.Remove(dependent);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         return(View(ex));
     }
 }
Ejemplo n.º 4
0
        // GET: /dependent/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            dependent dependent = db.dependents.Find(id);

            if (dependent == null)
            {
                return(HttpNotFound());
            }
            ViewBag.staffid = new SelectList(db.staffs, "staffid", "staff_email", dependent.staffid);
            return(View(dependent));
        }