Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CS_Departments cS_Departments = db.CS_Departments.Find(id);

            db.CS_Departments.Remove(cS_Departments);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ID,Name,Id_name")] CS_Departments cS_Departments)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cS_Departments).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cS_Departments));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "ID,Name,Id_name")] CS_Departments cS_Departments)
        {
            if (ModelState.IsValid)
            {
                db.CS_Departments.Add(cS_Departments);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cS_Departments));
        }
Beispiel #4
0
        // GET: CS_Departments/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CS_Departments cS_Departments = db.CS_Departments.Find(id);

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