public ActionResult DeleteConfirmed(int id)
        {
            Cal_Nomina cal_Nomina = db.Cal_Nomina.Find(id);

            db.Cal_Nomina.Remove(cal_Nomina);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        // GET: Cal_Nomina/Create
        public ActionResult Create()
        {
            ViewBag.EmpleadosId = new SelectList(db.Empleados, "Id", "Nombre");
            Cal_Nomina cargo = new Cal_Nomina();

            cargo.Monto_Total   = Convert.ToInt32(db.Empleados.Sum(a => a.Salario));
            ViewBag.TotalNomina = db.Empleados.Sum(a => a.Salario);
            return(View());
        }
 public ActionResult Edit([Bind(Include = "Id,Ano,Mes,Monto_Total,EmpleadosId")] Cal_Nomina cal_Nomina)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cal_Nomina).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmpleadosId = new SelectList(db.Empleados, "Id", "Nombre", cal_Nomina.EmpleadosId);
     return(View(cal_Nomina));
 }
        // GET: Cal_Nomina/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Cal_Nomina cal_Nomina = db.Cal_Nomina.Find(id);

            if (cal_Nomina == null)
            {
                return(HttpNotFound());
            }
            return(View(cal_Nomina));
        }
        // GET: Cal_Nomina/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Cal_Nomina cal_Nomina = db.Cal_Nomina.Find(id);

            if (cal_Nomina == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EmpleadosId = new SelectList(db.Empleados, "Id", "Nombre", cal_Nomina.EmpleadosId);
            return(View(cal_Nomina));
        }