Esempio n. 1
0
 public async Task <bool> Delete(SaleStage SaleStage)
 {
     if (await ValidateId(SaleStage))
     {
     }
     return(SaleStage.IsValidated);
 }
Esempio n. 2
0
        public OpportunityReport_SaleStageDTO(SaleStage SaleStage)
        {
            this.Id = SaleStage.Id;

            this.Code = SaleStage.Code;

            this.Name = SaleStage.Name;

            this.Errors = SaleStage.Errors;
        }
Esempio n. 3
0
        public Contract_SaleStageDTO(SaleStage SaleStage)
        {
            this.Id = SaleStage.Id;

            this.Code = SaleStage.Code;

            this.Name = SaleStage.Name;

            this.Errors = SaleStage.Errors;
        }
Esempio n. 4
0
        public async Task <SaleStage> Get(long Id)
        {
            SaleStage SaleStage = await UOW.SaleStageRepository.Get(Id);

            if (SaleStage == null)
            {
                return(null);
            }
            return(SaleStage);
        }
        public CustomerLead_SaleStageDTO(SaleStage SaleStage)
        {
            this.Id = SaleStage.Id;

            this.Code = SaleStage.Code;

            this.Name = SaleStage.Name;

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

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

            return(SaleStage);
        }
Esempio n. 7
0
        public LeadHistoryRecord FindLeadHistoryRecord(SaleStage saleStage)
        {
            List <LeadHistoryRecord> historyRecords = new List <LeadHistoryRecord>(LeadHistoryRecords);
            LeadHistoryRecord        result         = null;

            foreach (LeadHistoryRecord record in historyRecords)
            {
                if (record.SaleStage == saleStage)
                {
                    if (result != null)
                    {
                        throw new InvalidOperationException("Lead history item is duplicated.");
                    }
                    result = record;
                }
            }
            return(result);
        }
Esempio n. 8
0
        public async Task <bool> ValidateId(SaleStage SaleStage)
        {
            SaleStageFilter SaleStageFilter = new SaleStageFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = SaleStage.Id
                },
                Selects = SaleStageSelect.Id
            };

            int count = await UOW.SaleStageRepository.Count(SaleStageFilter);

            if (count == 0)
            {
                SaleStage.AddError(nameof(SaleStageValidator), nameof(SaleStage.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
Esempio n. 9
0
 public async Task <bool> Create(SaleStage SaleStage)
 {
     return(SaleStage.IsValidated);
 }