public ActionResult Create()
        {
            CreateEditStudentViewModel vm = new CreateEditStudentViewModel
            {
                Student = new Student(),
                Headers = HeaderRepo.ToList()
            };
            return View(vm);

            //return View(new Student());
        }
        public ActionResult Create()
        {
            CreateEditStudentViewModel vm =
                new CreateEditStudentViewModel
                {
                    Student = new Student(),
                    CompetencyHeaders =
                    competencyHeadersRepository.AllIncluding(
                        a => a.Competencies).ToList()
                };

            return View(vm);
        }
 public ActionResult Create(CreateEditStudentViewModel vm, HttpPostedFileBase image)
 {
     if (ModelState.IsValid)
     {
         vm.Student.SaveOrUpdateImage(image, Server.MapPath("~"), "/UserUploads/");
         repo.InsertOrUpdate(vm.Student);
         return View("Thanks");
     }
     else
     {
         return View();
     }
 }
        public ActionResult Create()
        {
            CreateEditStudentViewModel viewModel = new CreateEditStudentViewModel
                {
                    Student = new Student(),
                    Educations = new List<Education>(_educationsRepository.All),
                    CompetencyHeaders = _competencyHeadersRepository.AllIncluding(x => x.Competencies).ToList()
            };

            GetListOfCompetenciesHelper getListOfCompetenciesHelper = new GetListOfCompetenciesHelper();
            ViewBag.Competencies = getListOfCompetenciesHelper.GetAllCompetencyData(_competenciesRepository);

            return View(viewModel);
        }
        public ActionResult Edit(Student student, HttpPostedFileBase image, IEnumerable<int> compIds)
        {
            if (ModelState.IsValid)
            {
                //student.SaveImage(image, Server.MapPath("~"), "/ProfileImages/");
                string path = Server != null ? Server.MapPath("~") : "";
                student.SaveImage(image, path, "/ProfileImages/");

                HandleStudentHelper handleStudentHelper = new HandleStudentHelper(student, compIds);
                handleStudentHelper.HandleStudent(true);

                return RedirectToAction("Index");
            }

            CreateEditStudentViewModel viewModel = new CreateEditStudentViewModel()
            {
                Student = student,
                Educations = _educationsRepository.All.ToList(),
                CompetencyHeaders = _competencyHeadersRepository.AllIncluding(a => a.Competencies).ToList()
            };
            return View(viewModel);
        }
        public ActionResult Edit(int studentId)
        {
            //look up a Student in the db
            Student student = _studentsRepository.Find(studentId);

            PopulateAssignedCompetencyData(student);

            CreateEditStudentViewModel viewModel = new CreateEditStudentViewModel()
            {
                Student = student,
                Educations = _educationsRepository.All.ToList(),
                CompetencyHeaders = _competencyHeadersRepository.AllIncluding(a => a.Competencies).ToList()
            };
            return View(viewModel);
        }
        public ActionResult Edit(int StudentId)
        {
            //look up a student in the repo
            Student student = repo.Find((int) StudentId);

            ViewBag.StudentName = student.Firstname;

            CreateEditStudentViewModel Vm = new CreateEditStudentViewModel
            {
                Student = student,
                Headers = HeaderRepo.All.ToList()

            };

            //Open the Edit view with the chosen student object
            return View(Vm);
        }
 public ActionResult Register()
 {
     CreateEditStudentViewModel vm = new CreateEditStudentViewModel
     {
         Student = new Student(),
         Headers = HeaderRepo.ToList(),
     };
     return View();
 }