public void crearGastos(Gastos gasto) { var bd = new DBContxt(); bd.Gastos.Add(gasto); bd.SaveChanges(); }
public void crearCuenta(Cuenta cuenta) { var DBContext = new DBContxt(); DBContext.Cuentas.Add(cuenta); DBContext.SaveChanges(); }
public void crearIngresos(Ingresos ingresos) { var bd = new DBContxt(); bd.Ingresos.Add(ingresos); bd.SaveChanges(); }
public ActionResult Crear(int idCuenta) { var DBContext = new DBContxt(); ViewBag.Cuentas = DBContext.Cuentas.Where(a => a.idCuenta == idCuenta); return(View(new Gastos())); }
public ActionResult Index() { var DBContext = new DBContxt(); var cuentas = ic.MostrarCuenta(); return(View(cuentas)); }
public ActionResult Crear(Gastos gasto) { var DBContext = new DBContxt(); ViewBag.Cuentas = DBContext.Cuentas; iv.validarGastos(gasto, ModelState); if (iv.IsValid()) { ig.crearGastos(gasto); return(RedirectToActionPermanent("Index", "Cuenta")); } return(View("Crear")); }
public ActionResult Crear(Ingresos ingresos) { var DBContext = new DBContxt(); ViewBag.Cuentas = DBContext.Cuentas; iv.validarIngresos(ingresos, ModelState); if (iv.IsValid()) { igre.crearIngresos(ingresos); return(RedirectToActionPermanent("Index", "Cuenta")); } return(View("Crear")); }
public List <Cuenta> MostrarCuenta() { var DBContext = new DBContxt(); return(DBContext.Cuentas.Include(a => a.Gastos).Include(a => a.Ingresos).ToList()); }