public async Task <IActionResult> Create() { var faculty = await _faculty.GetAll(); var department = await _department.GetAll(); //var state = await _state.GetAll(); var facultyList = faculty.Select(f => new SelectListItem() { Value = f.Id.ToString(), Text = f.Name }); var departmentList = department.Select(d => new SelectListItem() { Value = d.Id.ToString(), Text = d.DeptName }); //var stateList = state.Select(s => new SelectListItem() //{ // Value = s.Id.ToString(), // Text = s.Name //}); ViewBag.faculty = facultyList; ViewBag.department = departmentList; //ViewBag.state = stateList; return(View()); }
public async Task <IActionResult> Create() { var fac = await _fac.GetAll(); var FacList = fac.Select(f => new SelectListItem() { Value = f.Id.ToString(), Text = f.FacultyName }); ViewBag.fac = FacList; return(View()); }
public void OnGet() { AdminVM = new AdminViewModel { NoOfCourses = _courseRepo.GetAll().ToList().Count, NoOfDepts = _deptRepo.GetAll().ToList().Count, NoOfFaculties = _facultyRepo.GetAll().Count(), NoOfStudents = _studentRepo.GetAll().Count(), }; }
public async Task <IActionResult> Index() { var model = await _faculty.GetAll(); if (model != null) { return(View(model)); } return(View()); }
public async Task <IActionResult> Index() { /* var grade = await _grade.GetAll(); * var gradeList = grade.Select(a => new SelectListItem() * { * Value = a.Id.ToString(), * Text = a.Level.ToString() * }); */ var gradeName = await _grade.GetAll(); var gradeListName = gradeName.Select(g => new SelectListItem() { Value = g.Id.ToString(), Text = g.GradeName }); var gradeLevel = await _grade.GetAll(); var gradeListLevel = gradeLevel.Select(g => new SelectListItem() { Value = g.Id.ToString(), Text = g.Level.ToString() }); var gradeStep = await _grade.GetAll(); var gradeListStep = gradeStep.Select(g => new SelectListItem() { Value = g.Id.ToString(), Text = g.Step.ToString() }); ViewBag.gradeName = gradeListName; ViewBag.gradeLevel = gradeListLevel; ViewBag.gradeStep = gradeListStep; var fac = await _faculty.GetAll(); var FacList = fac.Select(f => new SelectListItem() { Value = f.Id.ToString(), Text = f.Name }); ViewBag.fac = FacList; var dept = await _dept.GetAll(); var deptList = dept.Select(g => new SelectListItem() { Value = g.Id.ToString(), Text = g.DeptName }); ViewBag.dept = deptList; //ViewBag.faculty = facultyList; //ViewBag.grade = gradeList; return(View(new Salary())); }
public IActionResult GetAllCategory() { var faculties = _facultyRepo.GetAll(); return(Json(new { data = faculties })); }