Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Id_mercado,Id_producto,Cantidad")] Compra compra)
        {
            if (ModelState.IsValid)
            {
                _context.Add(compra);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(compra));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Estado")] Ciudad ciudad)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ciudad);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ciudad));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Unidad_de_Medida,Estado")] Producto producto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(producto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(producto));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Id,Fecha_creacion,Estado")] Mercado_ mercado_)
        {
            if (ModelState.IsValid)
            {
                _context.Add(mercado_);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(mercado_));
        }
        public async Task <IActionResult> Create([Bind("Id,Nombre,Direccion,telefono,Estado")] Unidad_Residencial unidad_Residencial)
        {
            if (ModelState.IsValid)
            {
                _context.Add(unidad_Residencial);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(unidad_Residencial));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("Id,ApartamentoID,Nombre,Apellido,telefono")] Propietario propietario)
        {
            if (ModelState.IsValid)
            {
                _context.Add(propietario);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ApartamentoID"] = new SelectList(_context.Apartamento, "Id", "Id", propietario.ApartamentoID);
            return(View(propietario));
        }
Ejemplo n.º 7
0
 public void Adicionar(TEntity entity)
 {
     MercadoContext.Add(entity);
 }