Example #1
0
        public ActionResult Create([Bind(Include = "area_id,nom_area")] area area)
        {
            if (ModelState.IsValid)
            {
                db.area.Add(area);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(area));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "emp_id,nom_empleado,ap_pat, ap_mat,email,area_id")] empleado empleado)
        {
            if (ModelState.IsValid)

            {
                db.empleado.Add(empleado);
                db.SaveChanges();
                RedirectToAction("Index");
            }

            ViewBag.area_id = new SelectList(db.area, "area_id", "nom_area", empleado.area_id);
            return(View(empleado));
        }