Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "OccupationGroupId,OccupationGroupTitle")] EntityOccupationGroup entityOccupationGroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(entityOccupationGroup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(entityOccupationGroup));
 }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "OccupationGroupId,OccupationGroupTitle")] EntityOccupationGroup entityOccupationGroup)
        {
            if (ModelState.IsValid)
            {
                db.EntityOccupationGroups.Add(entityOccupationGroup);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(entityOccupationGroup));
        }
Ejemplo n.º 3
0
        // GET: EntityOccupationGroup/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EntityOccupationGroup entityOccupationGroup = db.EntityOccupationGroups.Find(id);

            if (entityOccupationGroup == null)
            {
                return(HttpNotFound());
            }
            return(View(entityOccupationGroup));
        }
Ejemplo n.º 4
0
        public ActionResult DeleteConfirmed(int id)
        {
            EntityOccupationGroup entityOccupationGroup = db.EntityOccupationGroups.Find(id);

            try
            {
                db.EntityOccupationGroups.Remove(entityOccupationGroup);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch (SqlException)
            {
                throw new Exception("error");
            }
        }