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)); }
public ActionResult DeleteConfirmed(int id) { Thoikhoabieu thoikhoabieu = db.Thoikhoabieu.Find(id); db.Thoikhoabieu.Remove(thoikhoabieu); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,manganh,monhoc,thu,phong,naybatdau,ngayketthuc,giaoviengiangday")] Thoikhoabieu thoikhoabieu) { if (ModelState.IsValid) { db.Entry(thoikhoabieu).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.manganh = new SelectList(db.Nganh, "manganh", "tennganh", thoikhoabieu.manganh); return(View(thoikhoabieu)); }
// GET: admin/Thoikhoabieux/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Thoikhoabieu thoikhoabieu = db.Thoikhoabieu.Find(id); if (thoikhoabieu == null) { return(HttpNotFound()); } return(View(thoikhoabieu)); }
// GET: admin/Thoikhoabieux/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Thoikhoabieu thoikhoabieu = db.Thoikhoabieu.Find(id); if (thoikhoabieu == null) { return(HttpNotFound()); } ViewBag.manganh = new SelectList(db.Nganh, "manganh", "tennganh", thoikhoabieu.manganh); return(View(thoikhoabieu)); }
public async Task <IActionResult> Create([Bind("TkbMa,LopLopMa,MonhocMhMa,ThuThuMa,TiethocThMa,CanboCbMa,HockyHkMa")] Thoikhoabieu thoikhoabieu) { if (ModelState.IsValid) { _context.Add(thoikhoabieu); await _context.SaveChangesAsync(); 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)); }