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

            this.Code = CustomerLeadLevel.Code;

            this.Name = CustomerLeadLevel.Name;

            this.Errors = CustomerLeadLevel.Errors;
        }
        public Company_CustomerLeadLevelDTO(CustomerLeadLevel CustomerLeadLevel)
        {
            this.Id = CustomerLeadLevel.Id;

            this.Code = CustomerLeadLevel.Code;

            this.Name = CustomerLeadLevel.Name;

            this.Errors = CustomerLeadLevel.Errors;
        }
Exemple #4
0
        public async Task <CustomerLeadLevel> Get(long Id)
        {
            CustomerLeadLevel CustomerLeadLevel = await UOW.CustomerLeadLevelRepository.Get(Id);

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

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

            return(CustomerLeadLevel);
        }
Exemple #6
0
        public async Task <bool> ValidateId(CustomerLeadLevel CustomerLeadLevel)
        {
            CustomerLeadLevelFilter CustomerLeadLevelFilter = new CustomerLeadLevelFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = CustomerLeadLevel.Id
                },
                Selects = CustomerLeadLevelSelect.Id
            };

            int count = await UOW.CustomerLeadLevelRepository.Count(CustomerLeadLevelFilter);

            if (count == 0)
            {
                CustomerLeadLevel.AddError(nameof(CustomerLeadLevelValidator), nameof(CustomerLeadLevel.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
Exemple #7
0
 public async Task <bool> Create(CustomerLeadLevel CustomerLeadLevel)
 {
     return(CustomerLeadLevel.IsValidated);
 }