Esempio n. 1
0
        public IActionResult GetSectorExperienceYearGender()
        {
            GetSectorExperienceYearGenderDto data = new GetSectorExperienceYearGenderDto();
            var sector = _sectorService.GetList();

            if (!sector.Success)
            {
                return(Ok(new ErrorDataResult <GetSectorExperienceYearGenderDto>()));
            }
            var experience = _experienceService.GetList();

            if (!experience.Success)
            {
                return(Ok(new ErrorDataResult <GetSectorExperienceYearGenderDto>()));
            }
            var gender = _genderService.GetList();

            if (!gender.Success)
            {
                return(Ok(new ErrorDataResult <GetSectorExperienceYearGenderDto>()));
            }
            try
            {
                data.Sectors     = _mapper.Map <List <SectorDto> >(sector.Data);
                data.Experiences = _mapper.Map <List <ExperienceDto> >(experience.Data);
                data.Genders     = _mapper.Map <List <GenderDto> >(gender.Data);
            }
            catch (System.Exception)
            {
                //todo:log ex
                return(Ok(new ErrorDataResult <GetSectorExperienceYearGenderDto>()));
            }
            return(Ok(new SuccessDataResult <GetSectorExperienceYearGenderDto>(data)));
        }
Esempio n. 2
0
        public ActionResult Register()
        {
            var model = new AccountViewModel
            {
                Genders = _genderService.GetList(),
                Cities  = _cityService.GetList()
            };

            return(View(model));
        }
Esempio n. 3
0
        public ActionResult MyAccount()
        {
            var personId = HttpContext.Session.GetInt32("personId");

            var locker = Security.Security.CreatLocker();

            var model = new UserUpdateListViewModel
            {
                Person  = _personService.GetById((int)personId), //personId !!
                User    = _userService.GetById((int)personId),   //personId !!
                Genders = _genderService.GetList(),
                Cities  = _cityService.GetList()
            };

            string decryptKey = locker.Decrypt(model.Person.Password);

            model.Person.Password = decryptKey;

            return(View(model));
        }
Esempio n. 4
0
 public IHttpActionResult GetList(string ids)
 {
     return(Ok(_service.GetList(ids)));
 }