Пример #1
0
        public IActionResult Login(int login)
        {
            if (login == 0)
            {
                var items   = pmRepo.GetNotPolicemanUsers();
                var results = mapper.Map <ProfileViewModel[]>(items);

                var item = new PolicemanViewModel()
                {
                    CitizenUserProfiles = results, ProfileVM = null
                };

                return(View(item));
            }
            else if (login == 1)
            {
                var items   = pmRepo.GetPolicemanUsers();
                var results = mapper.Map <ProfileViewModel[]>(items);

                var item = new PolicemanViewModel()
                {
                    CitizenUserProfiles = results, ProfileVM = new ProfileViewModel()
                };
                return(View(item));
            }

            return(NotFound());
        }
Пример #2
0
        public IActionResult Index(int profileId)
        {
            var profile = mapper.Map <ProfileViewModel>(cuRepo.Get(profileId));

            var userItems = pmRepo.GetNotPolicemanUsers();
            var users     = mapper.Map <ProfileViewModel[]>(userItems);

            var item = new PolicemanViewModel()
            {
                CitizenUserProfiles = users, ProfileVM = profile
            };

            return(View(item));
        }