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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }