Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("TeachersOwnListId,courseId,completeCourse,PointPerCourses,NumberofClassPerCourses,NumberofDoneClassPerCourses,PickUpAmmount")] TeachersOwnList teachersOwnList)
        {
            if (id != teachersOwnList.TeachersOwnListId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(teachersOwnList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TeachersOwnListExists(teachersOwnList.TeachersOwnListId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(teachersOwnList));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("TeachersOwnListId,courseId,completeCourse,PointPerCourses,NumberofClassPerCourses,NumberofDoneClassPerCourses,PickUpAmmount")] TeachersOwnList teachersOwnList)
        {
            if (ModelState.IsValid)
            {
                _context.Add(teachersOwnList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(teachersOwnList));
        }