public async Task <IActionResult> Edit(int id, [Bind("Id,Type,Tematic,NumberOfPeople,Date,hour,Colors,FullPackage,Details")] EventQuotation eventQuotation) { if (id != eventQuotation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(eventQuotation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventQuotationExists(eventQuotation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(eventQuotation)); }
public async Task <IActionResult> Create([Bind("Id,Type,Tematic,NumberOfPeople,Date,hour,Colors,FullPackage,Details")] EventQuotation eventQuotation) { if (ModelState.IsValid) { _context.Add(eventQuotation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(eventQuotation)); }