Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            employees_tbl employees_tbl = db.employees_tbl.Find(id);

            db.employees_tbl.Remove(employees_tbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "ID,FirstName,LastName,Gender,Salary")] employees_tbl employees_tbl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employees_tbl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(employees_tbl));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "ID,FirstName,LastName,Gender,Salary")] employees_tbl employees_tbl)
        {
            if (ModelState.IsValid)
            {
                db.employees_tbl.Add(employees_tbl);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(employees_tbl));
        }
Пример #4
0
        // GET: employees_tbl/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            employees_tbl employees_tbl = db.employees_tbl.Find(id);

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