Ejemplo n.º 1
0
        // GET: Department
        public ActionResult Index()
        {
            IEnumerable <Department> departments = m_repo.GetAllDepartments();

            if (!departments.Any())
            {
                //If there are no buildings, we should provide the ability to create them?
                return(RedirectToAction("Create"));
            }

            //paginate buildings, what if there are 10000, do we want the user to scroll through all of that?
            //look up IPagedList<T>
            return(View(departments.ToList()));
        }
Ejemplo n.º 2
0
        // GET: Employee/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Employee employee = m_repo.GetEmployee(id.Value);

            if (employee == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DepartmentId = new SelectList(m_repo.GetAllDepartments(), "Id", "Name", employee.DepartmentId);
            return(View(employee));
        }
 // GET: EmployeesTest/Create
 public ActionResult Create()
 {
     //  var m_repo = new EmployeesTestController(new PeopleProRepo());
     ViewBag.DepartmentId = new SelectList(m_repo.GetAllDepartments(), "Id", "Name");
     return(View());
 }