public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Surname,Email,Number,Message,Tour,DateTime")] SimpleInformation simpleInformation) { if (id != simpleInformation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(simpleInformation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SimpleInformationExists(simpleInformation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(simpleInformation)); }
public async Task <IActionResult> Create([Bind("Id,Name,Surname,Email,Number,Message,Tour,DateTime")] SimpleInformation simpleInformation) { if (ModelState.IsValid) { _context.Add(simpleInformation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(simpleInformation)); }
public async Task <IActionResult> YanarDag(SimpleInformation bron) { if (ModelState.IsValid) { await _toursDbContext.AddAsync(bron); await _toursDbContext.SaveChangesAsync(); } else { return(RedirectToAction("Error")); } return(Json(new { Result = "Success", Message = "Send Successfully" })); }