Ejemplo n.º 1
0
        protected virtual async Task UpdateAsync(CreateOrEditDesiredLocationJobDto input)
        {
            var entity = await locationJobRepository.GetAll()
                         .FirstOrDefaultAsync(p => p.Id == input.Id);

            ObjectMapper.Map(input, entity);
            await locationJobRepository.UpdateAsync(entity);
        }
Ejemplo n.º 2
0
        protected virtual async Task CreateUserAsync(CreateOrEditDesiredLocationJobDto input)
        {
            var entity = ObjectMapper.Map <DesiredLocationJob>(input);

            await locationJobRepository.InsertAndGetIdAsync(entity);

            await CurrentUnitOfWork.SaveChangesAsync();
        }
Ejemplo n.º 3
0
 //[AbpAuthorize(PermissionNames.AdminPage_DesiredLocationJob)]
 public async Task CreateOrUpdate(CreateOrEditDesiredLocationJobDto input)
 {
     if (input.Id != 0)
     {
         await UpdateAsync(input);
     }
     else
     {
         await CreateUserAsync(input);
     }
 }
Ejemplo n.º 4
0
        public async Task <CreateOrEditDesiredLocationJobDto> GetForEdit(int?id)
        {
            var model = new CreateOrEditDesiredLocationJobDto();

            if (id == null)
            {
                return(model);
            }

            var entity = await locationJobRepository.GetAll()
                         .FirstOrDefaultAsync(p => p.Id == id);

            entity.MapTo(model);
            //model = model.Translations
            //    .Concat(translations)
            //    .DistinctBy(p => p.Language)
            //    .ToList();
            return(model);
        }