public async Task <ActionResult> DeleteConfirmed(string id) { TruongNganhMonthi truongNganhMonthi = await db.TruongNganhMonthis.FindAsync(id); db.TruongNganhMonthis.Remove(truongNganhMonthi); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "MaTruong,MaNganh,idMon1,idMon2,idMon3,Nam,Diem,SoLuongTruyCap")] TruongNganhMonthi truongNganhMonthi) { if (ModelState.IsValid) { db.Entry(truongNganhMonthi).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.MaNganh = new SelectList(db.Nganhs, "MaNganh", "Ten", truongNganhMonthi.MaNganh); ViewBag.MaTruong = new SelectList(db.Truongs, "MaTruong", "Ten", truongNganhMonthi.MaTruong); return(View(truongNganhMonthi)); }
// GET: TruongNganhMonthis/Details/5 public async Task <ActionResult> Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TruongNganhMonthi truongNganhMonthi = await db.TruongNganhMonthis.FindAsync(id); if (truongNganhMonthi == null) { return(HttpNotFound()); } return(View(truongNganhMonthi)); }
// GET: TruongNganhMonthis/Edit/5 public async Task <ActionResult> Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TruongNganhMonthi truongNganhMonthi = await db.TruongNganhMonthis.FindAsync(id); if (truongNganhMonthi == null) { return(HttpNotFound()); } ViewBag.MaNganh = new SelectList(db.Nganhs, "MaNganh", "Ten", truongNganhMonthi.MaNganh); ViewBag.MaTruong = new SelectList(db.Truongs, "MaTruong", "Ten", truongNganhMonthi.MaTruong); return(View(truongNganhMonthi)); }