Example #1
0
 public async Task <bool> Delete(ConsultingService ConsultingService)
 {
     if (await ValidateId(ConsultingService))
     {
     }
     return(ConsultingService.IsValidated);
 }
Example #2
0
        public Store_ConsultingServiceDTO(ConsultingService ConsultingService)
        {
            this.Id = ConsultingService.Id;


            this.Name = ConsultingService.Name;

            this.Errors = ConsultingService.Errors;
        }
        public async Task <ConsultingService> Get(long Id)
        {
            ConsultingService ConsultingService = await UOW.ConsultingServiceRepository.Get(Id);

            if (ConsultingService == null)
            {
                return(null);
            }
            return(ConsultingService);
        }
        public async Task <ConsultingService> Get(long Id)
        {
            ConsultingService ConsultingService = await DataContext.ConsultingService.AsNoTracking()
                                                  .Where(x => x.Id == Id)
                                                  .Select(x => new ConsultingService()
            {
                Id   = x.Id,
                Code = x.Code,
                Name = x.Name,
            }).FirstOrDefaultAsync();

            if (ConsultingService == null)
            {
                return(null);
            }

            return(ConsultingService);
        }
Example #5
0
        public async Task <bool> ValidateId(ConsultingService ConsultingService)
        {
            ConsultingServiceFilter ConsultingServiceFilter = new ConsultingServiceFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = ConsultingService.Id
                },
                Selects = ConsultingServiceSelect.Id
            };

            int count = await UOW.ConsultingServiceRepository.Count(ConsultingServiceFilter);

            if (count == 0)
            {
                ConsultingService.AddError(nameof(ConsultingServiceValidator), nameof(ConsultingService.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
Example #6
0
 public ConsultingController()
 {
     ConsultingService = new ConsultingService(new LawyersEntities());
 }
Example #7
0
 public Store_StoreConsultingServiceMappingDTO(StoreConsultingServiceMapping StoreConsultingServiceMapping)
 {
     this.StoreId             = StoreConsultingServiceMapping.StoreId;
     this.ConsultingServiceId = StoreConsultingServiceMapping.ConsultingServiceId;
     this.ConsultingService   = StoreConsultingServiceMapping.ConsultingService;
 }
Example #8
0
 public async Task <bool> Create(ConsultingService ConsultingService)
 {
     return(ConsultingService.IsValidated);
 }