public async Task <List <StudentBM> > GetAllStudents(int RowCount, String AppRootPath) { List <StudentBM> result = new List <StudentBM>(); var oStudents = await _DBStudentRepository.GetAllStudents(RowCount).ConfigureAwait(false); if (oStudents != null && oStudents.Count > 0) { foreach (var item in oStudents) { result.Add(new StudentBM { Id = item.Id, UserAvatar = _AppDirectoryFileService.GetAppUserAvatarPath(item.RegNo.ToString()), Name = item.Name, RegNo = item.RegNo, Address = item.Address, ContactNo = item.ContactNo, Email = item.Email, StandardId = item.StandardId, Action = item.Id.ToString(), CreatedOn = item.CreatedOn, CreatedBy = item.CreatedBy }); } ; } return(result); }
public async Task <List <TeacherBM> > GetAllTeachers(int RowCount, string AppRootPath) { List <TeacherBM> result = new List <TeacherBM>(); var oTeachers = await _DBTeacherRepository.GetAllTeachers(RowCount).ConfigureAwait(false); if (oTeachers != null && oTeachers.Count > 0) { foreach (var item in oTeachers) { result.Add(new TeacherBM { Id = item.Id, UserAvatar = _AppDirectoryFileService.GetAppUserAvatarPath(item.Id.ToString()), RegNo = item.RegNo, Name = item.Name, Address = item.Address, ContactNo = item.ContactNo, Email = item.Email, EducationalQualification = item.EducationalQualification, Action = item.Id.ToString(), CreatedOn = item.CreatedOn, }); } ; } return(result); }
public async Task <List <AppUserBM> > GetAllAppUsers(int RowCount, String AppRootPath) { List <AppUserBM> result = new List <AppUserBM>(); var oUsers = await _DBUserRepository.GetAllUser(RowCount).ConfigureAwait(false); if (oUsers != null && oUsers.Count > 0) { foreach (var item in oUsers) { result.Add(new AppUserBM { Id = item.Id, UserAvatar = _AppDirectoryFileService.GetAppUserAvatarPath(item.UserId), Name = item.Name, UserId = item.UserId, UserType = item.UserType, Gender = item.Gender, Email = item.Email, IsActive = item.IsActive, Action = item.Id.ToString() }); } ; } return(result); }
public async Task <List <ClassMemberInfo> > GetAllClassMembers(int RowCount, string MemberType) { List <ClassMemberInfo> Result = new List <ClassMemberInfo>(); if (MemberType.ToLower().Equals("teacher")) { var oTeachers = await _DBTeacherRepository.GetAllTeacherEx(RowCount).ConfigureAwait(false); if (oTeachers != null && oTeachers.Count > 0) { foreach (var item in oTeachers) { ClassMemberInfo CMI = new ClassMemberInfo { Id = item.Id, RegNo = item.RegNo, Name = item.Name, Description = item.EducationalQualification, Avatar = _AppDirectoryFileService.GetAppUserAvatarPath(item.UserAvatar) }; Result.Add(CMI); } ; } } else { var oStudents = await _DBStudentRepository.GetAllStudentsInfo(RowCount).ConfigureAwait(false); if (oStudents != null && oStudents.Count > 0) { foreach (var item in oStudents) { //item.Avatar = string.Format("~/AppFileRepo/StudentAvatar/{0}.{1}?r={2}", item.RegNo, "jpg", DateTime.Now.Ticks.ToString()); ClassMemberInfo CMI = new ClassMemberInfo { Id = (int)item.Id, RegNo = item.RegNo, Name = item.Name, Description = item.Description, Avatar = _AppDirectoryFileService.GetAppUserAvatarPath(item.Avatar) }; Result.Add(CMI); } ; } } return(Result); }