Example #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            empleados empleados = await db.empleados.FindAsync(id);

            db.empleados.Remove(empleados);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Example #2
0
        public async Task <ActionResult> Edit([Bind(Include = "ID,Cargo,Nombre,Apellidos,Genero,Edad")] empleados empleados)
        {
            if (ModelState.IsValid)
            {
                db.Entry(empleados).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(empleados));
        }
Example #3
0
        public async Task <ActionResult> Create([Bind(Include = "ID,Cargo,Nombre,Apellidos,Genero,Edad")] empleados empleados)
        {
            if (ModelState.IsValid)
            {
                db.empleados.Add(empleados);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(empleados));
        }
Example #4
0
        // GET: empleados/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            empleados empleados = await db.empleados.FindAsync(id);

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