예제 #1
0
        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));
        }
예제 #2
0
        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));
        }