Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] CourseType courseType)
        {
            if (id != courseType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(courseType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CourseTypeExists(courseType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(courseType));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Desc,CourseTypeId,CenterId")] Course course)
        {
            if (id != course.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(course);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CourseExists(course.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CenterId"]     = new SelectList(_context.Center, "Id", "Id", course.CenterId);
            ViewData["CourseTypeId"] = new SelectList(_context.CourseType, "Id", "Id", course.CourseTypeId);
            return(View(course));
        }
 public void Update(CourseTime courseTime)
 {
     _context.Update(courseTime);
 }
Beispiel #4
0
 public void Update(Weekday weekday)
 {
     _context.Update(weekday);
 }
Beispiel #5
0
 public void Update(Center center)
 {
     _context.Update(center);
 }