public async Task <IActionResult> Edit(int id, [Bind("Id,Text,Subject,URLImage")] Sag sag) { if (id != sag.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sag); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SagExists(sag.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sag)); }
public async Task <IActionResult> Create([Bind("Id,Text,Subject,URLImage")] Sag sag) { if (ModelState.IsValid) { _context.Add(sag); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(sag)); }
private void Sager_Click(object sender, EventArgs e) { Form f = new Sag(); f.Show(); }