コード例 #1
0
ファイル: AdminConceptService.cs プロジェクト: uwrit/leaf
        public async Task <AdminConcept> GetAsync(Guid id)
        {
            using (var cn = new SqlConnection(opts.ConnectionString))
            {
                await cn.OpenAsync();

                var grid = await cn.QueryMultipleAsync(
                    Sql.Get,
                    new { id },
                    commandType : CommandType.StoredProcedure,
                    commandTimeout : opts.DefaultTimeout
                    );

                return(AdminConceptReader.Read(grid));
            }
        }
コード例 #2
0
ファイル: AdminConceptService.cs プロジェクト: uwrit/leaf
        public async Task <AdminConcept> UpdateAsync(AdminConcept c)
        {
            using (var cn = new SqlConnection(opts.ConnectionString))
            {
                await cn.OpenAsync();

                var grid = await cn.QueryMultipleAsync(
                    Sql.Update,
                    new
                {
                    id                           = c.Id,
                    universalId                  = c.UniversalId?.ToString(),
                    parentId                     = c.ParentId,
                    rootId                       = c.RootId,
                    externalId                   = c.ExternalId,
                    externalParentId             = c.ExternalParentId,
                    isPatientCountAutoCalculated = c.IsPatientCountAutoCalculated,
                    isNumeric                    = c.IsNumeric,
                    isParent                     = c.IsParent,
                    isRoot                       = c.IsRoot,
                    isSpecializable              = c.IsSpecializable,
                    sqlSetId                     = c.SqlSetId,
                    sqlSetWhere                  = c.SqlSetWhere,
                    sqlFieldNumeric              = c.SqlFieldNumeric,
                    uiDisplayName                = c.UiDisplayName,
                    uiDisplayText                = c.UiDisplayText,
                    uiDisplaySubtext             = c.UiDisplaySubtext,
                    uiDisplayUnits               = c.UiDisplayUnits,
                    uiDisplayTooltip             = c.UiDisplayTooltip,
                    uiDisplayPatientCount        = c.UiDisplayPatientCount,
                    uiNumericDefaultText         = c.UiNumericDefaultText,
                    constraints                  = ResourceConstraintTable.From(c),
                    specializationGroups         = ConceptSpecializationGroupTable.From(c),
                    user                         = user.UUID
                },
                    commandType : CommandType.StoredProcedure,
                    commandTimeout : opts.DefaultTimeout
                    );

                return(AdminConceptReader.Read(grid));
            }
        }