Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("ID,TenKhoa")] Khoa khoa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(khoa);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(khoa));
        }
        public async Task <IActionResult> Create([Bind("ID,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("ID,HoTen,Namsinh,Phone,LopHocPhanID")] SinhVien sinhVien)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sinhVien);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LopHocPhanID"] = new SelectList(_context.LopHocPhans, "ID", "ID", sinhVien.LopHocPhanID);
            return(View(sinhVien));
        }
        public async Task <IActionResult> Create([Bind("ID,NamHoc,HocKi,Mon,DiemGK,DiemCK,KhoaID,MonHocID")] LopHocPhan lopHocPhan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lopHocPhan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KhoaID"]   = new SelectList(_context.Khoas, "ID", "ID", lopHocPhan.KhoaID);
            ViewData["MonHocID"] = new SelectList(_context.MonHocs, "ID", "ID", lopHocPhan.MonHocID);
            return(View(lopHocPhan));
        }
Esempio n. 5
0
 public async Task Add(MonHoc monhoc)
 {
     context.Add(monhoc);
     await context.SaveChangesAsync();
 }
Esempio n. 6
0
 public async Task Add(LopHocPhan lop)
 {
     context.Add(lop);
     await context.SaveChangesAsync();
 }
Esempio n. 7
0
 public async Task Add(Khoa khoa)
 {
     context.Add(khoa);
     await context.SaveChangesAsync();
 }
 public async Task Add(SinhVien sinhvien)
 {
     context.Add(sinhvien);
     await context.SaveChangesAsync();
 }