public ActionResult Registrar_Nomina(nomina n) { string error = "false"; if (ModelState.IsValid == false) { error = "true"; ViewData["error"] = error; ViewData["cant_empleados"] = getTotalEmpleados(); n.total = getTotalNomina(); return(View("CalculoNomina", n)); } else { try { db.nomina.Add(n); db.SaveChanges(); ViewData["error"] = error; n.total = getTotalNomina(); ViewData["cant_empleados"] = getTotalEmpleados(); return(View("CalculoNomina", n)); } catch (Exception e) { error = "true"; ViewData["error"] = error; ViewData["cant_empleados"] = getTotalEmpleados(); n.total = getTotalNomina(); return(View("CalculoNomina")); } } }
public ActionResult DeleteConfirmed(int id) { nomina nomina = db.nomina.Find(id); db.nomina.Remove(nomina); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_nomina,año,mes,montoTotal")] nomina nomina) { if (ModelState.IsValid) { db.Entry(nomina).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(nomina)); }
public ActionResult Create([Bind(Include = "id_nomina,año,mes,montoTotal")] nomina nomina) { if (ModelState.IsValid) { db.nomina.Add(nomina); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(nomina)); }
// GET: Procesos public ActionResult CalculoNomina() { nomina n = new nomina(); n.fecha = DateTime.Now; n.total = getTotalNomina(); ViewData["cant_empleados"] = getTotalEmpleados(); ViewData["error"] = ""; return(View(n)); }
// GET: nominas/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } nomina nomina = db.nomina.Find(id); if (nomina == null) { return(HttpNotFound()); } return(View(nomina)); }
public void FiltrarMes(nomina ca) { var almacen = from rr in mant.Calculo_nomina where rr.mes == ca.mesfiltro select rr; var f = almacen.FirstOrDefault(x => x.mes == ca.mesfiltro); ca.mesfiltro = f.mes; ca.añofiltro = f.año; ca.montototalfiltro = f.monto_total; }
public void FiltroNomina(nomina ca) { var almacen = from rr in mant.Calculo_nomina where rr.año == ca.añofiltro select rr; var f = almacen.FirstOrDefault(x => x.año == ca.añofiltro); ca.añofiltro = f.año; //nomi.ID_Nomina = f.ID_Nomina; ca.mesfiltro = f.mes; ca.montototalfiltro = f.monto_total; }
public void FiltrarMes(nomina elemen) { eje.FiltrarMes(elemen); }
public void FiltroNomina(nomina elemen) { eje.FiltroNomina(elemen); }
public void Guardar(nomina elemen) { eje.Guardar(elemen); }
// Nomina public void PagoNomina(nomina nom) { db.nomina.Add(nom); db.SaveChanges(); }
public void Guardar(nomina ca) { mant.nomina.Add(ca); mant.SaveChanges(); }
// Nominas public void Nominas(nomina num) { data.PagoNomina(num); }