public async Task <IActionResult> Edit(int id, [Bind("ProyeccionesId,Fecha,ProVentasNetas,ProCostosVentas,ProGastosAdmin,ProGastosVentas,ProGastosOperativos,ProOtrosGastos,ModeloProyeccionId")] Proyecciones proyecciones) { if (id != proyecciones.ProyeccionesId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(proyecciones); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProyeccionesExists(proyecciones.ProyeccionesId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ModeloProyeccionId"] = new SelectList(_context.ModeloProyeccion, "ModeloProyeccionId", "ModeloProyeccionId", proyecciones.ModeloProyeccionId); return(View(proyecciones)); }
public async Task <IActionResult> Create([Bind("Fecha,ProVentasNetas,ProCostosVentas,ProGastosAdmin,ProGastosVentas,ProGastosOperativos,ProOtrosGastos,proUtilidad,proIR,proUtilidadNeta")] Proyecciones proyecciones) { var model = _context.ModeloProyeccion.Include(m => m.ListaProyecciones).FirstOrDefault(m => m.ModeloProyeccionId == 1); model.ListaProyecciones.Add(proyecciones); _context.ModeloProyeccion.Update(model); _context.SaveChanges(); return(RedirectToAction()); }
public List <Proyeccion> obtenerProyeccionDe(Pelicula pelicula) { return(Proyecciones .Where(proyeccion => proyeccion.Pelicula == pelicula) .ToList()); }
public List <Proyeccion> obtenerProyecciones() => Proyecciones. Include(p => p.Entradas). Include(p => p.Pelicula). Include(p => p.Sala). ToList();
public void agregarProyeccion(Proyeccion proyeccion) { Proyecciones.Add(proyeccion); SaveChanges(); }
public List <Proyeccion> ProyeccionesEn(Sala sala) { return(Proyecciones.Where(x => x.Sala == sala).Include(p => p.Sala == sala).ToList()); }
public List <Proyeccion> ProyeccionDe(Pelicula pelicula) => Proyecciones. Include(p => p.Sala). Where(p => p.Pelicula.id == pelicula.id). ToList();
public void actualizar(Proyeccion proyeccion) { Proyecciones.Update(proyeccion); SaveChanges(); }