Esempio n. 1
0
        public IActionResult AssignToBatch(StudentBatchViewModel model)
        {
            var Selected     = model.StudentId;
            int modelBatchId = model.BatchId;

            foreach (var item in Selected)
            {
                StudentInBatch sb = new StudentInBatch()
                {
                    BatchesId  = modelBatchId,
                    EmployeeId = int.Parse(item)
                };
                _programmes.AssignStudentToBatch(sb);
            }
            return(RedirectToAction("listbatch"));
        }
Esempio n. 2
0
        public ViewResult ListBatch()
        {
            List <Batches>        batches          = _programmes.GetABatch().ToList();
            List <Employee>       studentList      = _students.GetEmployees().ToList();
            List <StudentInBatch> studentbatchList = _programmes.GetAllStudentInBatch().ToList();



            StudentBatchViewModel sbvm = new StudentBatchViewModel
            {
                Batches          = batches,
                Students         = studentList,
                AssignedStudents = studentbatchList
            };

            return(View(sbvm));
        }