public List <Gender> GetAllGender()
        {
            //List <GenderViewModel> gvm = null;
            //var config = new MapperConfiguration(cfg =>
            //{
            //    cfg.CreateMap<Gender, GenderViewModel>();
            //});

            //IMapper mapper = config.CreateMapper();

            //gvm = mapper.Map<List<Gender>, List<GenderViewModel>>(g);

            return(genderrepo.GetGenders());
        }
示例#2
0
        public IActionResult Add()
        {
            EmployeeViewModel employeeviewmodel = new EmployeeViewModel();

            ViewBag.NationalityId  = new SelectList(_nationality.GetNationalities(), "Id", "Name");
            ViewBag.GenderId       = new SelectList(_gender.GetGenders(), "Id", "Name");
            ViewBag.SocialStatusId = new SelectList(_socialstatus.GetSocialStatuss(), "Id", "Name");
            ViewBag.ReligionId     = new SelectList(_religion.GetReligions(), "Id", "Name");
            ViewBag.JobTypeId      = new SelectList(_jobtype.GetJobTypes(), "Id", "Name");;
            //ViewBag.ForeignAgencyId = new SelectList(_foreignagency.GetAgencies(), "Id", "OfficeName"); ;

            var test = DateTime.UtcNow.ToString("dd/MM/yyyy",
                                                CultureInfo.InvariantCulture);

            return(View(employeeviewmodel));
        }
示例#3
0
 public GenderViewModel GetGenders()
 {
     return(new GenderViewModel()
     {
         genders = _genderRepository.GetGenders()
     });
 }
示例#4
0
 public async Task <ActionResult <Gender> > GetListOfGenders()
 {
     try
     {
         return(Ok(await _repository.GetGenders()));
     }
     catch (System.Exception)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError,
                           "There were error in retrieving the data from the database!"));
     }
 }
示例#5
0
        public async Task <List <Gender> > GetGenders()
        {
            try
            {
                var items = await _repository.GetGenders();

                return(items);
            }
            catch (OzoneException ex)
            {
                throw new OzoneException(ex.Message, ex.InnerException);
            }
        }
示例#6
0
        public JsonResult GetAll()
        {
            var resuList = _genderRepository.GetGenders();

            return(Json(resuList, JsonRequestBehavior.AllowGet));
        }
示例#7
0
 public ICollection <GenderModel> GetGenders()
 {
     return(_genderRepository.GetGenders());
 }
示例#8
0
 public async Task <IEnumerable <Gender> > GetGenders()
 {
     return(await _genderRepository.GetGenders());
 }
示例#9
0
 public List <GenderModel> GetGenders()
 {
     return(_genderRepository.GetGenders().Select(x => new GenderModel(x.GenderId, x.Name)).ToList());
 }
示例#10
0
 public async Task OnGet()
 {
     Genders = (await _repository.GetGenders()).ToList();
 }