public async Task <bool> Delete(SaleStage SaleStage) { if (await ValidateId(SaleStage)) { } return(SaleStage.IsValidated); }
public OpportunityReport_SaleStageDTO(SaleStage SaleStage) { this.Id = SaleStage.Id; this.Code = SaleStage.Code; this.Name = SaleStage.Name; this.Errors = SaleStage.Errors; }
public Contract_SaleStageDTO(SaleStage SaleStage) { this.Id = SaleStage.Id; this.Code = SaleStage.Code; this.Name = SaleStage.Name; this.Errors = SaleStage.Errors; }
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; }
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); }
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); }
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); }
public async Task <bool> Create(SaleStage SaleStage) { return(SaleStage.IsValidated); }