public async Task <bool> Delete(KpiPeriod KpiPeriod) { if (await ValidateId(KpiPeriod)) { } return(KpiPeriod.IsValidated); }
public KpiItem_KpiPeriodDTO(KpiPeriod KpiPeriod) { this.Id = KpiPeriod.Id; this.Code = KpiPeriod.Code; this.Name = KpiPeriod.Name; this.Errors = KpiPeriod.Errors; }
public KpiGeneralEmployeeReport_KpiPeriodDTO(KpiPeriod KpiPeriod) { this.Id = KpiPeriod.Id; this.Code = KpiPeriod.Code; this.Name = KpiPeriod.Name; this.Errors = KpiPeriod.Errors; }
public async Task <KpiPeriod> Get(long Id) { KpiPeriod KpiPeriod = await UOW.KpiPeriodRepository.Get(Id); if (KpiPeriod == null) { return(null); } return(KpiPeriod); }
public async Task<ActionResult> GetKpi(KpiPeriod period) { using (ProfileSession.Current.Step("database")) using (var session = AsyncSessionFactory.QuerySession(UserId, OrgId)) { var result = await session.Query<Donation>() .WithinPeriod(period) .Where(d => d.FundedUtc != null) .ToListAsync(); return Json(new { count = result.Count(), total = result.Sum(x => x.Amount) }); } }
public async Task <KpiPeriod> Get(long Id) { KpiPeriod KpiPeriod = await DataContext.KpiPeriod.AsNoTracking() .Where(x => x.Id == Id) .Select(x => new KpiPeriod() { Id = x.Id, Code = x.Code, Name = x.Name, }).FirstOrDefaultAsync(); if (KpiPeriod == null) { return(null); } return(KpiPeriod); }
public async Task <bool> ValidateId(KpiPeriod KpiPeriod) { KpiPeriodFilter KpiPeriodFilter = new KpiPeriodFilter { Skip = 0, Take = 10, Id = new IdFilter { Equal = KpiPeriod.Id }, Selects = KpiPeriodSelect.Id }; int count = await UOW.KpiPeriodRepository.Count(KpiPeriodFilter); if (count == 0) { KpiPeriod.AddError(nameof(KpiPeriodValidator), nameof(KpiPeriod.Id), ErrorCode.IdNotExisted); } return(count == 1); }
public async Task <bool> Create(KpiPeriod KpiPeriod) { return(KpiPeriod.IsValidated); }