public async Task <IActionResult> Create([Bind("Id,MaNv,Pass,TenNv,Ngayvaolam,MaKhoa,HinhNv,Gioitinh,Cmnd,Diachi")] NhanVien nhanVien) { if (ModelState.IsValid) { _context.Add(nhanVien); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MaKhoa"] = new SelectList(_context.Khoa, "MaKhoa", "TenKhoa", nhanVien.MaKhoa); return(View(nhanVien)); }
public async Task <IActionResult> Create([Bind("MaKhoa,TenKhoa,Nam,ThongTinKhoa")] Khoa khoa) { if (ModelState.IsValid) { _context.Add(khoa); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(khoa)); }
public async Task <IActionResult> Create([Bind("MaMh,TenMh,Tinchi,MaKhoa")] Monhoc monhoc) { if (ModelState.IsValid) { _context.Add(monhoc); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MaKhoa"] = new SelectList(_context.Khoa, "MaKhoa", "TenKhoa", monhoc.MaKhoa); return(View(monhoc)); }
public async Task <IActionResult> Create([Bind("MaHp,MaMh,Hocky,Nam,Giangvien")] Hocphan hocphan) { if (ModelState.IsValid) { _context.Add(hocphan); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MaMh"] = new SelectList(_context.Monhoc, "MaMh", "MaMh", hocphan.MaMh); return(View(hocphan)); }
public async Task <IActionResult> Create([Bind("Id,MaSv,Pass,TenSv,Nam,MaKhoa,HinhSv,Gioitinh,Cmnd,Diachi")] Sinhvien sinhvien) { if (ModelState.IsValid) { _context.Add(sinhvien); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MaKhoa"] = new SelectList(_context.Khoa, "MaKhoa", "TenKhoa", sinhvien.MaKhoa); return(RedirectToAction("UploadFile")); }
public async Task <IActionResult> Create([Bind("MaSvc,MaHp,Diem")] Ketqua ketqua) { if (ModelState.IsValid) { _context.Add(ketqua); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MaHp"] = new SelectList(_context.Hocphan, "MaHp", "MaHp", ketqua.MaHp); ViewData["MaSvc"] = new SelectList(_context.Sinhvien, "MaSv", "MaSv", ketqua.MaSvc); return(View(ketqua)); }