public Task <IEnumerable <Section> > GetAsync(SectionSearch option, CancellationToken token = default(CancellationToken)) { var query = @" SELECT sc.* FROM Section sc WHERE sc.Id = sc.Id"; if (option.CompanyId.HasValue) { query += @" AND sc.CompanyId = @CompanyId"; } if (option.Ids?.Any() ?? false) { query += @" AND sc.Id IN (SELECT Id FROM @Ids)"; } if (option.Codes?.Any() ?? false) { query += @" AND sc.Code IN (SELECT Code FROM @Codes)"; } if (option.PayerCodes?.Any() ?? false) { query += @" AND sc.PayerCode IN (SELECT Code FROM @PayerCodes)"; } if (option.LoginUserId.HasValue) { query += @" AND sc.Id IN ( SELECT DISTINCT swl.SectionId FROM SectionWithLoginUser swl WHERE swl.LoginUserId = @LoginUserId )"; } if (option.CustomerId.HasValue) { query += @" AND sc.Id IN ( SELECT DISTINCT swd.SectionId FROM Customer cs INNER JOIN Staff st ON st.Id = cs.StaffId INNER JOIN SectionWithDepartment swd ON swd.DepartmentId = st.DepartmentId WHERE cs.Id = @CustomerId )"; } query += @" ORDER BY sc.CompanyId ASC , sc.Code ASC"; return(dbHelper.GetItemsAsync <Section>(query, new { option.CompanyId, option.LoginUserId, option.CustomerId, Ids = option.Ids.GetTableParameter(), Codes = option.Codes.GetTableParameter(), PayerCodes = option.PayerCodes.GetTableParameter(), }, token)); }
private int createProcessC = 0; //T= C>1 #endregion public IntelliMod(NktProcess process) { processID = process.Id; winProc = Process.GetProcessById(processID); nktProc = process; this.searcher = new SectionSearch(process, false); //Set the timer to trigger decay() every x seconds timer.Elapsed += decay; timer.Interval = 20000; timer.Enabled = true; }
public async Task <SectionsResult> GetItemsAsync(string SessionKey, int CompanyId, SectionSearch SectionSearch) { return(await authorizationProcessor.DoAuthorizeAsync(SessionKey, async token => { var result = (await sectionProcessor.GetAsync(SectionSearch, token)).ToList(); return new SectionsResult { ProcessResult = new ProcessResult { Result = true }, Sections = result, }; }, logger)); }
public async Task <ActionResult <IEnumerable <Section> > > GetItems(SectionSearch option, CancellationToken token) => (await sectionProcessor.GetAsync(option, token)).ToArray();
public async Task <IEnumerable <Section> > GetAsync(SectionSearch option, CancellationToken token = default(CancellationToken)) => await sectionQueryProcessor.GetAsync(option, token);