public async Task <bool> Delete(CustomerLeadStatus CustomerLeadStatus)
 {
     if (await ValidateId(CustomerLeadStatus))
     {
     }
     return(CustomerLeadStatus.IsValidated);
 }
Exemplo n.º 2
0
        public async Task <CustomerLeadStatus> Get(long Id)
        {
            CustomerLeadStatus CustomerLeadStatus = await UOW.CustomerLeadStatusRepository.Get(Id);

            if (CustomerLeadStatus == null)
            {
                return(null);
            }
            return(CustomerLeadStatus);
        }
Exemplo n.º 3
0
        public CustomerLead_CustomerLeadStatusDTO(CustomerLeadStatus CustomerLeadStatus)
        {
            this.Id = CustomerLeadStatus.Id;

            this.Code = CustomerLeadStatus.Code;

            this.Name = CustomerLeadStatus.Name;

            this.Errors = CustomerLeadStatus.Errors;
        }
Exemplo n.º 4
0
        public async Task <CustomerLeadStatus> Get(long Id)
        {
            CustomerLeadStatus CustomerLeadStatus = await DataContext.CustomerLeadStatus.AsNoTracking()
                                                    .Where(x => x.Id == Id)
                                                    .Select(x => new CustomerLeadStatus()
            {
                Id   = x.Id,
                Code = x.Code,
                Name = x.Name,
            }).FirstOrDefaultAsync();

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

            return(CustomerLeadStatus);
        }
        public async Task <bool> ValidateId(CustomerLeadStatus CustomerLeadStatus)
        {
            CustomerLeadStatusFilter CustomerLeadStatusFilter = new CustomerLeadStatusFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = CustomerLeadStatus.Id
                },
                Selects = CustomerLeadStatusSelect.Id
            };

            int count = await UOW.CustomerLeadStatusRepository.Count(CustomerLeadStatusFilter);

            if (count == 0)
            {
                CustomerLeadStatus.AddError(nameof(CustomerLeadStatusValidator), nameof(CustomerLeadStatus.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
 public async Task <bool> Create(CustomerLeadStatus CustomerLeadStatus)
 {
     return(CustomerLeadStatus.IsValidated);
 }