public ActionResult Index(string currentFilter, string searchString, int page = 1, int pageSize = 15) { if (searchString != null) { page = 1; } else { searchString = currentFilter; } ViewBag.CurrentFilter = searchString; var profiles = _profileRepo.GetAll().OrderByDescending(o => o.Id).ToList(); if (!String.IsNullOrEmpty(searchString)) { profiles = profiles.Where(s => s.NRIC.ToUpper().Contains(searchString.ToUpper()) || s.FirstName.ToUpper().Contains(searchString.ToUpper()) || s.LastName.ToUpper().Contains(searchString.ToUpper()) || s.MiddleName.ToUpper().Contains(searchString.ToUpper()) ).ToList(); } var viewModel = new ProfileListViewModel(profiles); PagedList <ProfileViewModel> model = new PagedList <ProfileViewModel>(viewModel.Profiles.ToList(), page, pageSize); return(View(model)); }
public async Task <IActionResult> Index() { var users = await _userService.GetAllAsync(); if (!users.Any()) { return(NotFound()); } var profilesVM = users.Select(user => new ProfileViewModel { Username = user.UserName, FirstName = user.FirstName, LastName = user.LastName, Email = user.Email, PhoneNumber = user.PhoneNumber, IsEmailConfirmed = user.EmailConfirmed, ProfileImageUrl = user.ProfileImageUrl, MemberSince = user.MemberSince }); var viewMod = new ProfileListViewModel() { Profiles = profilesVM }; return(View(viewMod)); }
public async Task <IActionResult> List(string login, string key) { var profile = await dbContext.Profiles .Include(p => p.AnimeListSet).ThenInclude(l => l.Anime).ThenInclude(a => a.Anime) .Include(p => p.MangaListSet).ThenInclude(l => l.Manga).ThenInclude(m => m.Manga) .FirstOrDefaultAsync(p => string.Equals(p.Login, login, StringComparison.OrdinalIgnoreCase)); if (profile == null) { return(NotFound()); } IEnumerable <UserList> lists; if (key == "Anime") { lists = profile.AnimeListSet; } else if (key == "Manga") { lists = profile.MangaListSet; } else { lists = (profile.AnimeListSet.Where(l => l.Key == key) as IEnumerable <UserList>).Concat(profile.MangaListSet.Where(l => l.Key == key)).ToList(); } if (lists.Count() == 0) { return(NotFound()); } var model = new ProfileListViewModel().Initialize(profile, lists); return(View(model)); }
public ActionResult Index() { using (var mealProfilerContext = new MealProfilerContext()) { var profileList = new ProfileListViewModel { //Convert each Person to a PersonViewModel Profiles = mealProfilerContext.Profiles.Select(p => new ProfileViewModel { ProfileId = p.ProfileId, MealGoal = p.MealGoal, PrepTime = p.PrepTime, MealCost = p.MealCost, MealAuthor = p.MealAuthor, SpinachQuantity = p.SpinachQuantity, TomatoQuantity = p.TomatoQuantity, SpinachCheckbox = p.SpinachCheckbox, TomatoCheckbox = p.TomatoCheckbox, Notes = p.Notes }).ToList() }; profileList.TotalProfiles = profileList.Profiles.Count; return(View(profileList)); } }
/// <summary> /// Метод отображает список анкет /// </summary> /// <param name="filter"></param> /// <param name="options"></param> /// <returns></returns> public ActionResult ShowCandidates(JobseekersFilter filter, FetchOptions options) { var model = new ProfileListViewModel { Profiles = jobseekerRepository.GetAllWithSort(options) }; return(View(model)); }
public ActionResult Index(int?page) { var model = db.UserProfiles .Where(x => x.Visibility == VisibilityState.Public) .ToList() .Select(u => ProfileListViewModel.CreateViewModel(u)) .OrderByDescending(u => u.Id); return(View(model)); }
public IActionResult List() { IEnumerable <Branch> branchList = _branchrDataService.GetAll(); IEnumerable <Profile> ProfileList = _profileDataService.GetAll(); ProfileListViewModel vm = new ProfileListViewModel { Profiles = ProfileList, Branches = branchList }; return(View(vm)); }
public ActionResult Search(string searchString) { var result = db.UserProfiles .Where(x => ( x.FirstName.StartsWith(searchString) || x.LastName.StartsWith(searchString)) && x.Visibility == VisibilityState.Public ) .ToList() .Select(u => ProfileListViewModel.CreateViewModel(u)); return(PartialView("_SearchResults", result)); }
public ActionResult GetList() { int userId = Convert.ToInt16(Session["kullaniciId"]); List <List> watch = db.List.Include("Films").Where(l => l.LUId == userId && l.LType == 0).ToList(); List <List> likes = db.List.Include("Films").Where(l => l.LUId == userId && l.LType == 1).ToList(); List <List> dislikes = db.List.Include("Films").Where(l => l.LUId == userId && l.LType == -1).ToList(); ProfileListViewModel vm = new ProfileListViewModel(); vm.watch = watch; vm.likes = likes; vm.dislikes = dislikes; return(View(vm)); }
/* * Method to view 5 profiles on the home page */ public ActionResult ViewProfiles() { var list = new ProfileListViewModel(); if (User.Identity.IsAuthenticated) { var ctx = new ZinderUserDbContext(); list = new ProfileListViewModel { Profiles = ctx.Profiles.Take(5).ToList() }; } return(PartialView(list)); }
/// <summary> /// Позволяет HR найти анкету, подходящую по параметрам вакансии /// </summary> /// <param name="Id"></param> /// <returns></returns> public ActionResult FindCandidate(long Id) { var exp = employerRepository.Load(Id).Requirements; List <long> list = new List <long>(); foreach (var e in exp) { list.Add(e.Id); } var model = new ProfileListViewModel { Profiles = jobseekerRepository.FindSuitableCandidate(list) }; return(View("ShowCandidates", "", model)); }
public IActionResult Index() { var profiles = _userService.GetAll() .OrderByDescending(user => user.Rating) .Select(u => new ProfileViewModel { Nickname = u.Nickname, ProfileImageUrl = u.ProfileImageUrl, UserRating = u.Rating.ToString(), MemeberSince = u.MemberSince, }); var model = new ProfileListViewModel { Profiles = profiles }; return(View(model)); }
public static ProfileListViewModel Initialize(this ProfileListViewModel model, Profile profile, IEnumerable <UserList> userLists) { model.UserLogin = profile.Login; model.Lists = userLists .Select(l => { if (l is UserAnimeList) { return(new ProfileListPartialViewModel().Initialize(l as UserAnimeList)); } else { return(new ProfileListPartialViewModel().Initialize(l as UserMangaList)); } }) .ToList(); return(model); }
public IActionResult Index() { var profiles = userService.GetAll() .OrderByDescending(user => user.Rating) .Select(u => new ProfileViewModel { Email = u.Email, Username = u.UserName, ProfileImageUrl = u.ProfileImageUrl, UserRating = u.Rating.ToString(), MemberSince = u.MemberSince }); var viewMod = new ProfileListViewModel() { Profiles = profiles }; return(View(viewMod)); }
public IActionResult Index() { var profiles = userService.GetAll() .Select(user => new ProfileViewModel { Username = user.UserName, FirstName = user.FirstName, LastName = user.LastName, Email = user.Email, PhoneNumber = user.PhoneNumber, IsEmailConfirmed = user.EmailConfirmed, DateJoined = user.DateJoined }); var viewMod = new ProfileListViewModel() { Profiles = profiles }; return(View(viewMod)); }
public ProfileListView() { InitializeComponent(); _vm = new ProfileListViewModel(); this.BindingContext = _vm; }