コード例 #1
0
        public async Task <IActionResult> Edit(string id, [Bind("XpMa,XpTen")] Xaphuong xaphuong)
        {
            if (id != xaphuong.XpMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(xaphuong);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!XaphuongExists(xaphuong.XpMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(xaphuong));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(string id, [Bind("ThMa,ThTen")] Tiethoc tiethoc)
        {
            if (id != tiethoc.ThMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tiethoc);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TiethocExists(tiethoc.ThMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tiethoc));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(string id, [Bind("TkbMa,LopLopMa,MonhocMhMa,ThuThuMa,TiethocThMa,CanboCbMa,HockyHkMa")] Thoikhoabieu thoikhoabieu)
        {
            if (id != thoikhoabieu.TkbMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(thoikhoabieu);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ThoikhoabieuExists(thoikhoabieu.TkbMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CanboCbMa"]   = new SelectList(_context.Canbo, "CbMa", "CbMa", thoikhoabieu.CanboCbMa);
            ViewData["HockyHkMa"]   = new SelectList(_context.Hocky, "HkMa", "HkMa", thoikhoabieu.HockyHkMa);
            ViewData["LopLopMa"]    = new SelectList(_context.Lop, "LopMa", "LopMa", thoikhoabieu.LopLopMa);
            ViewData["MonhocMhMa"]  = new SelectList(_context.Monhoc, "MhMa", "MhMa", thoikhoabieu.MonhocMhMa);
            ViewData["ThuThuMa"]    = new SelectList(_context.Thu, "ThuMa", "ThuMa", thoikhoabieu.ThuThuMa);
            ViewData["TiethocThMa"] = new SelectList(_context.Tiethoc, "ThMa", "ThMa", thoikhoabieu.TiethocThMa);
            return(View(thoikhoabieu));
        }
コード例 #4
0
        public async Task <IActionResult> Edit(string id, [Bind("MhMa,MhTen,ChitietdanhgiaCtdgMa")] Monhoc monhoc)
        {
            if (id != monhoc.MhMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(monhoc);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MonhocExists(monhoc.MhMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ChitietdanhgiaCtdgMa"] = new SelectList(_context.Chitietdanhgia, "CtdgMa", "CtdgMa", monhoc.ChitietdanhgiaCtdgMa);
            return(View(monhoc));
        }
コード例 #5
0
        public async Task <IActionResult> Edit(string id, [Bind("SdgMa,SdgDiem,SdgGhichu,NamhocNhMa")] Sodanhgia sodanhgia)
        {
            if (id != sodanhgia.SdgMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sodanhgia);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SodanhgiaExists(sodanhgia.SdgMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["NamhocNhMa"] = new SelectList(_context.Namhoc, "NhMa", "NhMa", sodanhgia.NamhocNhMa);
            return(View(sodanhgia));
        }
コード例 #6
0
        public async Task <IActionResult> Edit(string id, [Bind("LopMa,LopTen")] Lop lop)
        {
            if (id != lop.LopMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lop);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LopExists(lop.LopMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(lop));
        }
コード例 #7
0
        public async Task <IActionResult> Edit(string id, [Bind("KhoiMa,KhoiTen")] Khoi khoi)
        {
            if (id != khoi.KhoiMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(khoi);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KhoiExists(khoi.KhoiMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(khoi));
        }
コード例 #8
0
        public async Task <IActionResult> Edit(string id, [Bind("CvMa,CvTen")] Chucvu chucvu)
        {
            if (id != chucvu.CvMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(chucvu);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChucvuExists(chucvu.CvMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(chucvu));
        }
コード例 #9
0
        public async Task <IActionResult> Edit(string id, [Bind("CtdgMa,CtdgNgaydg,SodanhgiaSdgMa,HocsinhHsMa")] Chitietdanhgia chitietdanhgia)
        {
            if (id != chitietdanhgia.CtdgMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(chitietdanhgia);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ChitietdanhgiaExists(chitietdanhgia.CtdgMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["HocsinhHsMa"]    = new SelectList(_context.Hocsinh, "HsMa", "HsMa", chitietdanhgia.HocsinhHsMa);
            ViewData["SodanhgiaSdgMa"] = new SelectList(_context.Sodanhgia, "SdgMa", "SdgMa", chitietdanhgia.SodanhgiaSdgMa);
            return(View(chitietdanhgia));
        }
コード例 #10
0
        public async Task <IActionResult> Edit(string id, [Bind("HkMa,HkTen")] Hocky hocky)
        {
            if (id != hocky.HkMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(hocky);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HockyExists(hocky.HkMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(hocky));
        }
コード例 #11
0
        public async Task <IActionResult> Edit(string id, [Bind("KlMa,KlHinhthuc,KlNgaykyluat")] Kyluat kyluat)
        {
            if (id != kyluat.KlMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(kyluat);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KyluatExists(kyluat.KlMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(kyluat));
        }
コード例 #12
0
        public async Task <IActionResult> Edit(string id, [Bind("QhMa,QhTen")] Quanhuyen quanhuyen)
        {
            if (id != quanhuyen.QhMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(quanhuyen);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!QuanhuyenExists(quanhuyen.QhMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(quanhuyen));
        }
コード例 #13
0
        public async Task <IActionResult> Edit(string id, [Bind("CbMa,CbHoten,CbGioitinh,CbDiachi,CbNgaysinh,CbCmnd,CoquanCqMa,KyluatcbKlcbMa,KhenthuongcbKtcbMa")] Canbo canbo)
        {
            if (id != canbo.CbMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try {
                    _context.Update(canbo);
                    await _context.SaveChangesAsync();
                } catch (DbUpdateConcurrencyException) {
                    if (!CanboExists(canbo.CbMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CoquanCqMa"]         = new SelectList(_context.Coquan, "CqMa", "CqMa", canbo.CoquanCqMa);
            ViewData["KhenthuongcbKtcbMa"] = new SelectList(_context.Khenthuongcb, "KtcbMa", "KtcbMa", canbo.KhenthuongcbKtcbMa);
            ViewData["KyluatcbKlcbMa"]     = new SelectList(_context.Kyluatcb, "KlcbMa", "KlcbMa", canbo.KyluatcbKlcbMa);
            return(View(canbo));
        }
コード例 #14
0
        public async Task <IActionResult> Edit(string id, [Bind("KtMa,KtThanhtich,KtNgaykhenthuong,KtGhichu")] Khenthuong khenthuong)
        {
            if (id != khenthuong.KtMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(khenthuong);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KhenthuongExists(khenthuong.KtMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(khenthuong));
        }
コード例 #15
0
        public async Task <IActionResult> Edit(string id, [Bind("HsMa,HsHoten,HsGioitinh,HsNgaysinh,HsTongiao,TinhthanhTtMa,XaphuongXpMa,KyluatKlMa,KhenthuongKtMa,QuanhuyenQhMa,DantocDtMa,LopLopMa,KhoiKhoiMa")] Hocsinh hocsinh)
        {
            if (id != hocsinh.HsMa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(hocsinh);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!HocsinhExists(hocsinh.HsMa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DantocDtMa"]     = new SelectList(_context.Dantoc, "DtMa", "DtMa", hocsinh.DantocDtMa);
            ViewData["KhenthuongKtMa"] = new SelectList(_context.Khenthuong, "KtMa", "KtMa", hocsinh.KhenthuongKtMa);
            ViewData["KhoiKhoiMa"]     = new SelectList(_context.Khoi, "KhoiMa", "KhoiMa", hocsinh.KhoiKhoiMa);
            ViewData["KyluatKlMa"]     = new SelectList(_context.Kyluat, "KlMa", "KlMa", hocsinh.KyluatKlMa);
            ViewData["LopLopMa"]       = new SelectList(_context.Lop, "LopMa", "LopMa", hocsinh.LopLopMa);
            ViewData["QuanhuyenQhMa"]  = new SelectList(_context.Quanhuyen, "QhMa", "QhMa", hocsinh.QuanhuyenQhMa);
            ViewData["TinhthanhTtMa"]  = new SelectList(_context.Tinhthanh, "TtMa", "TtMa", hocsinh.TinhthanhTtMa);
            ViewData["XaphuongXpMa"]   = new SelectList(_context.Xaphuong, "XpMa", "XpMa", hocsinh.XaphuongXpMa);
            return(View(hocsinh));
        }