Пример #1
0
        public async Task <IEnumerable <GridSetting> > GetAsync(GridSettingSearch option, CancellationToken token = default(CancellationToken))
        {
            var settings = await gridSettingQueryProcessor.GetAsync(option, token);

            var control = await applicationControlByCompanyIdQueryProcessor.GetAsync(option.CompanyId, token);

            return(SetApplicationControlValues(settings, control));
        }
Пример #2
0
        public Task <IEnumerable <GridSetting> > GetAsync(GridSettingSearch option, CancellationToken token = default(CancellationToken))
        {
            var query = option.IsDefault ?
                        @"
SELECT @CompanyId [CompanyId]
     , @LoginUserId [LoginUserId]
     , gsb.GridId
     , gsb.ColumnName
     , COALESCE(cn.Alias, gsb.ColumnNameJp) [ColumnNameJp]
     , gsb.DisplayOrder
     , gsb.DisplayWidth
  FROM GridSettingBase gsb
  LEFT JOIN ColumnNameSetting cn
    ON cn.CompanyId = @CompanyId
   AND cn.TableName = CASE WHEN gsb.GridId IN (1, 3, 5) THEN N'Billing'
                           WHEN gsb.GridId IN (2, 4   ) THEN N'Receipt'
                      END
   AND cn.ColumnName = gsb.ColumnName
 WHERE gsb.GridId = COALESCE(@GridId, gsb.GridId)
 ORDER BY gsb.GridId ASC, gsb.DisplayOrder ASC;" :
                        @"
SELECT COALESCE(gs.CompanyId  , @CompanyId)       [CompanyId]
     , COALESCE(gs.LoginUserId, @LoginUserId)     [LoginUserId]
     , gsb.GridId
     , gsb.ColumnName
     , COALESCE(cn.Alias, gsb.ColumnNameJp)  [ColumnNameJp]
     , COALESCE(gs.DisplayOrder, gsb.DisplayOrder)  [DisplayOrder]
     , COALESCE(gs.DisplayWidth, gsb.DisplayWidth)  [DisplayWidth]
     , gs.CreateBy
     , gs.CreateAt
     , gs.UpdateBy
     , gs.UpdateAt
  FROM GridSettingBase  gsb
  LEFT JOIN GridSetting gs
    ON gsb.GridId       = gs.GridId
   AND gsb.ColumnName   = gs.ColumnName
   AND gs.CompanyId     = @CompanyId
   AND gs.LoginUserId   = @LoginUserId
  LEFT JOIN ColumnNameSetting cn
    ON cn.CompanyId     = @CompanyId
   AND cn.TableName     = CASE WHEN gsb.GridId IN (1, 3, 5) THEN N'Billing'
                               WHEN gsb.GridId IN (2, 4   ) THEN N'Receipt'
                          END
   AND cn.ColumnName    = gsb.ColumnName
 WHERE gsb.GridId       = COALESCE(@GridId, gsb.GridId)
 ORDER BY gsb.GridId ASC
, COALESCE(gs.DisplayOrder, gsb.DisplayOrder) ASC;";

            return(dbHelper.GetItemsAsync <GridSetting>(query, option, token));
        }
Пример #3
0
 public async Task <ActionResult <IEnumerable <GridSetting> > > GetItems(GridSettingSearch option, CancellationToken token)
 => (await gridSettingProcessor.GetAsync(option, token)).ToArray();