public async Task <IActionResult> Edit(Guid id, [Bind("Id")] SalesPersonsPendingTasks salesPersonsPendingTasks) { if (id != salesPersonsPendingTasks.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(salesPersonsPendingTasks); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SalesPersonsPendingTasksExists(salesPersonsPendingTasks.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(salesPersonsPendingTasks)); }
public async Task <IActionResult> Create([Bind("Id")] SalesPersonsPendingTasks salesPersonsPendingTasks) { if (ModelState.IsValid) { salesPersonsPendingTasks.Id = Guid.NewGuid(); _context.Add(salesPersonsPendingTasks); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(salesPersonsPendingTasks)); }