Exemplo n.º 1
0
        public ActionResult Index()
        {
            Dashboard dashboard = new Dashboard
            {
                NumberOfColleges   = _collegeService.GetAll().Count(),
                NumberOfCourses    = _courseService.GetAll().Count(),
                NumberOfDepartment = _departmentService.GetAll().Count(),
                NumberOfLecturers  = _lecturerService.GetAll().Count(),
                NumberOfStudents   = _studentService.GetAll().Count(),
                NumberOfStudies    = _studyService.GetAll().Count()
            };

            return(View(dashboard));
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            ViewBag.dashboard = "active";
            var lecturer  = _lecturerService.GetAll().First(x => x.AppUserID == User.Identity.GetUserId());
            var dashboard = new Dashboard
            {
                NumberOfCourses = lecturer.Courses.Count,
                NumberOfStudies = lecturer.Courses
                                  .SelectMany(x => x.Studies)
                                  .Where(x => x.CreatedBy == User.Identity.Name).Count(),
            };

            return(View(dashboard));
        }
Exemplo n.º 3
0
        private void PopulateCbxSearchLecturer()
        {
            List <Lecturer> lecturerList = _lecturerService.GetAll();

            lecturerList.Insert(0, new Lecturer {
                FirstName = "Select", MiddleName = "Lecturer", LastName = "", LecturerID = "Select Lecturer"
            });
            DataTable lecturer = FunctionBase.ToDataTable(lecturerList);

            lecturer.Columns.Add("FullName", typeof(string), "FirstName +' '+ MiddleName +' '+ LastName");
            cbxSearchLecturer.DataSource         = lecturer;
            cbxSearchLecturer.DisplayMember      = "FullName";
            cbxSearchLecturer.ValueMember        = "LecturerID";
            cbxSearchLecturer.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
            cbxSearchLecturer.AutoCompleteSource = AutoCompleteSource.ListItems;
        }
Exemplo n.º 4
0
        public async Task <StatisticsData> GetAll()
        {
            var stastics = new StatisticsData();

            var users = await _accountService.GetAll();

            var courses = await _courseServices.GetAll();

            var lectuers = await _lecturerServices.GetAll();

            var students = await _studentService.GetAll();

            var registrations = await _registrationService.GetAll();

            var attendances = await _attendanceService.GetAll();

            var sections = await _courseServices.GetAllSections();

            stastics.Users            = users.Count();
            stastics.Courses          = courses.Count();
            stastics.Lecturers        = lectuers.Count();
            stastics.Students         = students.Count();
            stastics.Registrations    = registrations.Count();
            stastics.StudentFaceAdded = students.Where(s => s.FaceAdded == true).ToList().Count();
            stastics.Attendances      = attendances.Count();
            int percent = (100 * (attendances.Where(at => at.AttendanceType == 1).ToList().Count())) / stastics.Attendances;

            stastics.AttendancePercent = percent;
            stastics.LastUpdate        = DateTime.Now;
            stastics.Sections          = sections.Count();
            return(stastics);
        }
Exemplo n.º 5
0
        public IActionResult Index()
        {
            var lecturer   = _chamaContext.Lecturer.ToList();
            var lectureres = _lecturerService.GetAll();



            return(View());
        }
        public async void LoadLecturer()
        {
            var lecturers = await lecturserService.GetAll();

            foreach (var lecturer in lecturers)
            {
                Items.Add(new LecturerListItemViewModel {
                    Id                = lecturer.Id,
                    Name              = lecturer.User.Name,
                    Faculty           = lecturer.Faculty,
                    Initials          = GetInitials(lecturer.User.Name),
                    ProfilePictureRGB = RandomRGBColor(),
                    CourseCount       = lecturer.Sections.Count(),
                    JoinDate          = lecturer.User.CreatedAt,
                });;
            }
        }
Exemplo n.º 7
0
        public async Task <ActionResult> Download()
        {
            var result = await _lecturerService.GetAll();

            return(Ok(result.ToLecturerViewModels()));
        }
Exemplo n.º 8
0
 public IEnumerable <LecturerDto> GetAll()
 {
     return(lecturerService.GetAll());
 }
Exemplo n.º 9
0
 private void LoadLecturers()
 {
     dgwLecturers.DataSource = _lecturerService.GetAll();
 }
Exemplo n.º 10
0
 public async Task <ActionResult <IEnumerable <LecturerViewModel> > > GetLecturers()
 {
     return(await Task.FromResult(_lecturerService.GetAll()));
 }