public async Task <IActionResult> AgencyGetAllAsync()
        {
            var req    = new ReportADPMainRequest();
            var result = await _adpMainManager.GetAllAsync(req);

            return(Ok(result));
        }
 public async Task<ReportADPMainResponse> GetAllAsync(ReportADPMainRequest req)
 {
     using (var conn = new SqlConnection(_connectionSettings.DefaultConnection))
     {
         var result = new ReportADPMainResponse();
         const string storeproc = @"[dbo].[uspADPMainGetList_New]";
         await conn.OpenAsync();
         var rawResult = await conn.QueryAsync<ReportMainDTO>(storeproc, null, null, null, CommandType.StoredProcedure);
         result.Data = rawResult.ToList();
         return result;
     }
 }
예제 #3
0
        public async Task <ReportADPMainResponse> GetAllAsync(ReportADPMainRequest req)
        {
            var result = await _repos.GetAllAsync(req);

            if (result != null && result.Data.Any())
            {
                result.Data.ToList().ForEach(x =>
                {
                    if (x.EffectiveDate != null && x.EffectiveDate > DateTime.MinValue && x.EffectiveDate < DateTime.MaxValue)
                    {
                        x.EffectiveDateStr = x.EffectiveDate.ToString("MM/dd/yyyy");
                    }
                });
            }
            return(result);
        }