Ejemplo n.º 1
0
 public ActionResult Create(DeptWithInsListViewModel dept)
 {
     try {
         // TODO: Add insert logic here
         //  dept.Department.InstrutorId = dept.InsList.SelectedInstructorId;
         _departmentService.AddOrUpdateDepartment(dept.Department);
         return(RedirectToAction("Index"));
     }
     catch {
         return(View());
     }
 }
Ejemplo n.º 2
0
        // GET: Department/Create
        //public ActionResult Create() {

        //    return View();
        //}

        public ActionResult Create()
        {
            // prepare the instructorlist for view display
            InstructorSelectList inslist = new InstructorSelectList()
            {
                _instructors = _instructorService.GetAllInstructors()
            };
            DeptWithInsListViewModel depwithInsList = new DeptWithInsListViewModel()
            {
                InsList = inslist
            };

            return(View(depwithInsList));
        }