示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("ct_id,tour_id,dd_id,ct_thutu")] Tour_chitiet tour_chitiet)
        {
            if (id != tour_chitiet.ct_id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tour_chitiet);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Tour_chitietExists(tour_chitiet.ct_id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tour_chitiet));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("ct_id,tour_id,dd_id,ct_thutu")] Tour_chitiet tour_chitiet)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tour_chitiet);
                await _context.SaveChangesAsync();

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