public async Task <IActionResult> Create([Bind("MaMon,TenMon,SoTinChi")] MonHoc monHoc)
        {
            if (ModelState.IsValid)
            {
                _context.Add(monHoc);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(monHoc));
        }
        public async Task <IActionResult> Create([Bind("MaKhoa,TenKhoa")] Khoa khoa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(khoa);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(khoa));
        }
Exemple #3
0
        public async Task <IActionResult> Create([Bind("MaLHP,NamHoc,HocKy,MaMon,DiemGK,DiemCuoiKy")] LopHocPhan lopHocPhan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lopHocPhan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MaMon"] = new SelectList(_context.MonHocs, "MaMon", "MaMon", lopHocPhan.MaMon);
            return(View(lopHocPhan));
        }
        public async Task <IActionResult> Create([Bind("MaSV,HoTen,NgaySinh,DienThoai,MaKhoa")] SinhVien sinhVien)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sinhVien);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MaKhoa"] = new SelectList(_context.Khoas, "MaKhoa", "MaKhoa", sinhVien.MaKhoa);
            return(View(sinhVien));
        }