Esempio n. 1
0
 public ActionResult Edit(Level_type level_type)
 {
     if (ModelState.IsValid)
     {
         dm.Level_Type_Edit(level_type);
         dm.Save();
         return RedirectToAction("Index");
     }
     return View(level_type);
 }
Esempio n. 2
0
        public ActionResult Create(Level_type level_type)
        {
            if (ModelState.IsValid)
            {
                level_type.ID = Guid.NewGuid();
                dm.Level_Type_Create(level_type);
                dm.Save();
                return RedirectToAction("Index");
            }

            return View(level_type);
        }
Esempio n. 3
0
 public Level_type Level_Type_Edit(Level_type obj)
 {
     db.Entry(obj).State = EntityState.Modified;
     db.SaveChanges();
     obj = db.Level_type.SingleOrDefault(o => o.ID == obj.ID);
     return obj;
 }
Esempio n. 4
0
 public Level_type Level_Type_Delete(Level_type obj)
 {
     Level_type level_type = db.Level_type.SingleOrDefault(o => o.ID == obj.ID);
     db.Level_type.Remove(level_type);
     db.SaveChanges();
     return level_type;
 }
Esempio n. 5
0
 public Level_type Level_Type_Create(Level_type obj)
 {
     obj.ID = Guid.NewGuid();
     db.Level_type.Add(obj);
     db.SaveChanges();
     obj = db.Level_type.FirstOrDefault(o => o.ID == obj.ID);
     return obj;
 }
Esempio n. 6
0
 public ActionResult DeleteConfirmed(Level_type level_type)
 {
     dm.Level_Type_Delete(level_type);
     return RedirectToAction("Index");
 }