コード例 #1
0
 public async Task <bool> Delete(OpportunityResultType OpportunityResultType)
 {
     if (await ValidateId(OpportunityResultType))
     {
     }
     return(OpportunityResultType.IsValidated);
 }
コード例 #2
0
        public Contact_OpportunityResultTypeDTO(OpportunityResultType OpportunityResultType)
        {
            this.Id = OpportunityResultType.Id;

            this.Code = OpportunityResultType.Code;

            this.Name = OpportunityResultType.Name;

            this.Errors = OpportunityResultType.Errors;
        }
コード例 #3
0
        public async Task <OpportunityResultType> Get(long Id)
        {
            OpportunityResultType OpportunityResultType = await UOW.OpportunityResultTypeRepository.Get(Id);

            if (OpportunityResultType == null)
            {
                return(null);
            }
            return(OpportunityResultType);
        }
コード例 #4
0
        public async Task <OpportunityResultType> Get(long Id)
        {
            OpportunityResultType OpportunityResultType = await DataContext.OpportunityResultType.AsNoTracking()
                                                          .Where(x => x.Id == Id)
                                                          .Select(x => new OpportunityResultType()
            {
                Id   = x.Id,
                Code = x.Code,
                Name = x.Name,
            }).FirstOrDefaultAsync();

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

            return(OpportunityResultType);
        }
コード例 #5
0
        public async Task <bool> ValidateId(OpportunityResultType OpportunityResultType)
        {
            OpportunityResultTypeFilter OpportunityResultTypeFilter = new OpportunityResultTypeFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = OpportunityResultType.Id
                },
                Selects = OpportunityResultTypeSelect.Id
            };

            int count = await UOW.OpportunityResultTypeRepository.Count(OpportunityResultTypeFilter);

            if (count == 0)
            {
                OpportunityResultType.AddError(nameof(OpportunityResultTypeValidator), nameof(OpportunityResultType.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
コード例 #6
0
 public async Task <bool> Create(OpportunityResultType OpportunityResultType)
 {
     return(OpportunityResultType.IsValidated);
 }