public ActionResult Create() { CATHEDRA cATHEDRA = new CATHEDRA(); SelectList items = new SelectList(ctx.DEPARTMENT, "ID", "D_NAME"); ViewBag.Departments = items; return(View(cATHEDRA)); }
public ActionResult DepartmentCreate(CATHEDRA c) { try { if (ModelState.IsValid) { ctx.CATHEDRA.Add(c); ctx.SaveChanges(); return(RedirectToAction("Index")); } } catch { } return(View(c)); }