예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            StaffTbl staffTbl = db.StaffTbls.Find(id);

            db.StaffTbls.Remove(staffTbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "S_Id,S_Name,S_Responsibilities")] StaffTbl staffTbl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(staffTbl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(staffTbl));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "S_Id,S_Name,S_Responsibilities")] StaffTbl staffTbl)
        {
            if (ModelState.IsValid)
            {
                db.StaffTbls.Add(staffTbl);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(staffTbl));
        }
예제 #4
0
        // GET: StaffTbls/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StaffTbl staffTbl = db.StaffTbls.Find(id);

            if (staffTbl == null)
            {
                return(HttpNotFound());
            }
            return(View(staffTbl));
        }