Пример #1
0
        public async Task <IActionResult> Create([Bind("Id,SuckleTime,Side")] Suckle suckle)
        {
            if (ModelState.IsValid)
            {
                _context.Add(suckle);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(suckle));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,Tipo,Matricula")] Bus bus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bus);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bus));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("TravelItemId,Name,IsDone")] TravelItem travelItem)
        {
            if (ModelState.IsValid)
            {
                _context.Add(travelItem);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(travelItem));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("Id,Numero,Piso,Bloque,Estado")] Apartamento apartamento)
        {
            if (ModelState.IsValid)
            {
                _context.Add(apartamento);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(apartamento));
        }
Пример #5
0
        public async Task <IActionResult> Create([Bind("ID,Name")] Director director)
        {
            if (ModelState.IsValid)
            {
                _context.Add(director);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(director));
        }
Пример #6
0
        public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Genre,Price,Rating")] Movie movie) //Comprueba si la película tiene errores de validación, si no los tiene guarda la película en la base de datos
        {
            if (ModelState.IsValid)
            {
                _context.Add(movie);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(movie));
        }
Пример #7
0
        public async Task <IActionResult> Create([Bind("Id,Name,Lastname,Phone,Genre,Email,Birthdate")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Пример #8
0
        public async Task <IActionResult> Create([Bind("Id,Name,ReleaseDate,Type,ContactInfo,Address")] EventCenter eventCenter)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eventCenter);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventCenter));
        }
Пример #9
0
        public async Task <IActionResult> Create([Bind("TipsId,Title,Content,LinkImage")] Tips tips)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tips);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tips));
        }
Пример #10
0
        public async Task <IActionResult> Create([Bind("Name,Comment,MovieId")] Review reviewModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(reviewModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index), "Movies"));
            }
            return(View(reviewModel));
        }
Пример #11
0
        public async Task <IActionResult> Create([Bind("HistoryItemId,IsDone,IconPath")] HistoryItem histotyItem)
        {
            if (ModelState.IsValid)
            {
                _context.Add(histotyItem);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(histotyItem));
        }
Пример #12
0
        public async Task <IActionResult> Create([Bind("solicitud,tipoEvento,lugar,invitados,detalles")] Evento evento)
        {
            if (ModelState.IsValid)
            {
                _context.Add(evento);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(evento));
        }
Пример #13
0
        public async Task <IActionResult> Create([Bind("ID,Title,ReleaseDate,Genre,Price")] Company company)
        {
            if (ModelState.IsValid)
            {
                _context.Add(company);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(company));
        }
Пример #14
0
        public async Task <IActionResult> Create([Bind("Id,Model,ProductionDate,Type,Price")] Car car)
        {
            if (ModelState.IsValid)
            {
                _context.Add(car);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(car));
        }
Пример #15
0
        public async Task <IActionResult> Create([Bind("Id,Poster,Title,PostDate,Topic,Content,Votes")] Post post)
        {
            if (ModelState.IsValid)
            {
                _context.Add(post);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(post));
        }
Пример #16
0
        public async Task <IActionResult> Create([Bind("ReviewID,MovieID,ReviewerName,Comment")] Review review)
        {
            if (ModelState.IsValid)
            {
                _context.Add(review);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Details", "Movies", new { id = review.MovieID }));
            }
            return(View(review));
        }
        public async Task <IActionResult> Create([Bind("Id,MovieId,DateEntered,SellerId,Price")] MoviePrice moviePrice)
        {
            if (ModelState.IsValid)
            {
                _context.Add(moviePrice);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(moviePrice));
        }
Пример #18
0
        public async Task <IActionResult> Create([Bind("w_code,w_name,w_amount,w_location")] Warehouse warehouse)
        {
            if (ModelState.IsValid)
            {
                _context.Add(warehouse);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(warehouse));
        }
Пример #19
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Estado")] Pais pais)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pais);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(pais));
        }
Пример #20
0
        public async Task <IActionResult> Create([Bind("ID,Email,Password")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(user));
        }
Пример #21
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Unidad_De_Medida,Boolean")] Producto producto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(producto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(producto));
        }
        public async Task <IActionResult> Create([Bind("PositionId,PositionName")] Position position)
        {
            if (ModelState.IsValid)
            {
                _context.Add(position);
                await _context.SaveChangesAsync();

                return(PartialView("_PositionList", _context.Position.ToList()));
            }
            return(View(position));
        }
Пример #23
0
        public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Genre,Price,Rating")] Games games)
        {
            if (ModelState.IsValid)
            {
                _context.Add(games);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(games));
        }
Пример #24
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));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,ReleaseDate,Description,Price")] Conference conference)
        {
            if (ModelState.IsValid)
            {
                _context.Add(conference);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(conference));
        }
Пример #26
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Apellido,Telefono,Apartamento_ID")] Propietario propietario)
        {
            if (ModelState.IsValid)
            {
                _context.Add(propietario);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(propietario));
        }
Пример #27
0
        public async Task <IActionResult> Create([Bind("ID,Title,ReleaseDate,Genre,Price")] Movie movie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(movie);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(movie));
        }
Пример #28
0
        public async Task <IActionResult> Create([Bind("ID,Name,DueBy,IsDone,StartDate")] DayItem dayItem)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dayItem);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(dayItem));
        }
Пример #29
0
 public IActionResult Create([Bind("OrderDate, Store, Item1, Item2, Item3, Customer")] Order order)
 {
     order.OrderDate = DateTime.Today;
     if (ModelState.IsValid)
     {
         _context.Add(order);
         _context.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     return(View(order));
 }
        public async Task <IActionResult> Create([Bind("GenreID,Description")] Genre genre)
        {
            if (ModelState.IsValid)
            {
                _context.Add(genre);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(genre));
        }