Esempio n. 1
0
        public ActionResult Create()
        {
            CATHEDRA   cATHEDRA = new CATHEDRA();
            SelectList items    = new SelectList(ctx.DEPARTMENT, "ID", "D_NAME");

            ViewBag.Departments = items;
            return(View(cATHEDRA));
        }
Esempio n. 2
0
 public ActionResult DepartmentCreate(CATHEDRA c)
 {
     try
     {
         if (ModelState.IsValid)
         {
             ctx.CATHEDRA.Add(c);
             ctx.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     catch
     {
     }
     return(View(c));
 }