Exemple #1
0
        public IActionResult Index()
        {
            ViewBag.userCount          = _userManager.Users.Count();
            ViewBag.confirmedUserCount = _userManager.Users.Where(i => i.EmailConfirmed == true).Count();
            ViewBag.ilanCount          = _ilanService.GetIlanlar("").Count();
            ViewBag.enÇokIlanVerilenIl = _ilService.enÇokIlanVerilenIl();
            ViewBag.enAzIlanVerilenIl  = _ilService.enAzIlanVerilenIl();

            return(View());
        }
        public IActionResult List(string url)
        {
            var model = new IlanListViewModel()
            {
                ilanlar = _ilanService.GetIlanlar(url),
            };

            ViewBag.markaurl = (RouteData.Values["url"] == null) ? "" : RouteData.Values["url"];
            ViewBag.iller    = _ilService.GetIller();
            return(View(model));
        }
Exemple #3
0
        public async Task <IActionResult> Profile()
        {
            var user = await _userManager.GetUserAsync(User);

            var ilanlar = _ilanService.GetIlanlar("").Where(i => i.userId == Convert.ToString(user.Id)).ToList();
            var favs    = _favService.GetFavByUserId(_userManager.GetUserId(User));

            ViewBag.favs       = favs.Count();
            ViewBag.ilansayisi = ilanlar.Count();
            var model = new UserProfileModel()
            {
                UserName       = user.UserName,
                FirstName      = user.FirstName,
                LastName       = user.LastName,
                Address        = user.Address,
                PhoneNumber    = user.PhoneNumber,
                Email          = user.Email,
                MembershipDate = user.MembershipDate.ToString().TrimEnd('0', ':'),
            };

            return(View(model));
        }