Tenant ve Branch ilişkisi sebebiyle yapılan güncellemler
This commit is contained in:
parent
e03de27b85
commit
8633f0a3f8
10 changed files with 222 additions and 407 deletions
|
|
@ -186,7 +186,7 @@ public class ListFormSelectAppService : PlatformAppService, IListFormSelectAppSe
|
||||||
{
|
{
|
||||||
result.TotalCount = await dynamicDataRepository.ExecuteScalarAsync<int>(selectQueryManager.TotalCountQuery, connectionString, param);
|
result.TotalCount = await dynamicDataRepository.ExecuteScalarAsync<int>(selectQueryManager.TotalCountQuery, connectionString, param);
|
||||||
}
|
}
|
||||||
else if(queryParams.Chart && !string.IsNullOrEmpty(selectQueryManager.ChartQuery))
|
else if (queryParams.Chart && !string.IsNullOrEmpty(selectQueryManager.ChartQuery))
|
||||||
{
|
{
|
||||||
result.Data = await dynamicDataRepository.QueryAsync(selectQueryManager.ChartQuery, connectionString, param);
|
result.Data = await dynamicDataRepository.QueryAsync(selectQueryManager.ChartQuery, connectionString, param);
|
||||||
}
|
}
|
||||||
|
|
@ -377,7 +377,7 @@ public class ListFormSelectAppService : PlatformAppService, IListFormSelectAppSe
|
||||||
if (field != null && !field.LookupJson.IsNullOrEmpty() && field.CanRead)
|
if (field != null && !field.LookupJson.IsNullOrEmpty() && field.CanRead)
|
||||||
{
|
{
|
||||||
var lookup = JsonSerializer.Deserialize<LookupDto>(field.LookupJson);
|
var lookup = JsonSerializer.Deserialize<LookupDto>(field.LookupJson);
|
||||||
if (!string.IsNullOrWhiteSpace(lookup.LookupQuery))
|
if (!string.IsNullOrWhiteSpace(lookup?.LookupQuery))
|
||||||
{
|
{
|
||||||
var lookupQuery = defaultValueHelper.GetDefaultValue(lookup.LookupQuery);
|
var lookupQuery = defaultValueHelper.GetDefaultValue(lookup.LookupQuery);
|
||||||
var parameters = new Dictionary<string, object>();
|
var parameters = new Dictionary<string, object>();
|
||||||
|
|
|
||||||
|
|
@ -44,20 +44,116 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
|
|
||||||
public async Task SeedAsync(DataSeedContext context)
|
public async Task SeedAsync(DataSeedContext context)
|
||||||
{
|
{
|
||||||
var lookupQueryLanguageKeyValues = $"SELECT \"{SelectCommandByTableName("LanguageKey")}\".\"Key\", CONCAT(\"{SelectCommandByTableName("LanguageKey")}\".\"Key\", ' (', \"{SelectCommandByTableName("LanguageText")}\".\"Value\", ')') AS \"Name\" FROM \"{SelectCommandByTableName("LanguageKey")}\" LEFT OUTER JOIN \"{SelectCommandByTableName("LanguageText")}\" ON \"{SelectCommandByTableName("LanguageKey")}\".\"Key\" = \"{SelectCommandByTableName("LanguageText")}\".\"Key\" AND \"{SelectCommandByTableName("LanguageKey")}\".\"ResourceName\" = \"{SelectCommandByTableName("LanguageText")}\".\"ResourceName\" WHERE \"{SelectCommandByTableName("LanguageKey")}\".\"IsDeleted\" = 'false' AND \"{SelectCommandByTableName("LanguageText")}\".\"IsDeleted\" = 'false' AND \"{SelectCommandByTableName("LanguageText")}\".\"CultureName\" = 'tr' ORDER BY \"{SelectCommandByTableName("LanguageKey")}\".\"Key\";";
|
var lookupQueryLanguageKeyValues =
|
||||||
var lookupQueryCultureValues = $"SELECT \"CultureName\" AS \"Key\", \"DisplayName\" AS \"Name\", \"CreationTime\" FROM \"{SelectCommandByTableName("Language")}\" WHERE \"IsEnabled\" = 'true' and \"IsDeleted\" = 'false'";
|
$"SELECT " +
|
||||||
|
$"\"{SelectCommandByTableName("LanguageKey")}\".\"Key\", " +
|
||||||
|
$"CONCAT(" +
|
||||||
|
$"\"{SelectCommandByTableName("LanguageKey")}\".\"Key\", " +
|
||||||
|
$"' (', " +
|
||||||
|
$"\"{SelectCommandByTableName("LanguageText")}\".\"Value\", " +
|
||||||
|
$"')'" +
|
||||||
|
$") AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("LanguageKey")}\" " +
|
||||||
|
$"LEFT OUTER JOIN \"{SelectCommandByTableName("LanguageText")}\" " +
|
||||||
|
$"ON \"{SelectCommandByTableName("LanguageKey")}\".\"Key\" = \"{SelectCommandByTableName("LanguageText")}\".\"Key\" " +
|
||||||
|
$"AND \"{SelectCommandByTableName("LanguageKey")}\".\"ResourceName\" = \"{SelectCommandByTableName("LanguageText")}\".\"ResourceName\" " +
|
||||||
|
$"WHERE " +
|
||||||
|
$"\"{SelectCommandByTableName("LanguageKey")}\".\"IsDeleted\" = 'false' " +
|
||||||
|
$"AND \"{SelectCommandByTableName("LanguageText")}\".\"IsDeleted\" = 'false' " +
|
||||||
|
$"AND \"{SelectCommandByTableName("LanguageText")}\".\"CultureName\" = 'tr' " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("LanguageKey")}\".\"Key\";";
|
||||||
|
|
||||||
var lookupQueryCountryValues = $"SELECT \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\"";
|
var lookupQueryCultureValues =
|
||||||
var lookupQueryCityValues = $"SELECT \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\" WHERE \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL ORDER BY \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\"";
|
$"SELECT " +
|
||||||
var lookupQueryDistrictValues = $"SELECT \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" AS \"Key\", \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" WHERE (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"City\" = @param1 OR @param1 IS NULL) GROUP BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" ORDER BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\"";
|
$"\"CultureName\" AS \"Key\", " +
|
||||||
var lookupQueryStreetValues = $"SELECT \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" AS \"Key\", \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" as \"Name\" FROM \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" WHERE (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"City\" = @param1 OR @param1 IS NULL) AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" = @param2 OR @param2 IS NULL) GROUP BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" ORDER BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\"";
|
$"\"DisplayName\" AS \"Name\", " +
|
||||||
|
$"\"CreationTime\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("Language")}\" " +
|
||||||
|
$"WHERE " +
|
||||||
|
$"\"IsEnabled\" = 'true' " +
|
||||||
|
$"AND \"IsDeleted\" = 'false';";
|
||||||
|
|
||||||
var lookupQueryTenantValues = $"SELECT \"AbpTenants\".\"Id\" AS \"Key\", \"AbpTenants\".\"Name\" as \"Name\" FROM \"AbpTenants\" ORDER BY \"AbpTenants\".\"Name\"";
|
var lookupQueryCountryValues =
|
||||||
var lookupQueryBranchValues = $"SELECT \"{SelectCommandByTableName("Branch")}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("Branch")}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Branch")}\" ORDER BY \"{SelectCommandByTableName("Branch")}\".\"Name\"";
|
$"SELECT " +
|
||||||
//var lookupQueryBranchValues = $"SELECT \"{SelectCommandByTableName("Branch")}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("Branch")}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Branch")}\" WHERE \"{SelectCommandByTableName("Branch")}\".\"TenantId\" = '@TENANTID' ORDER BY \"{SelectCommandByTableName("Branch")}\".\"Name\"";
|
$"\"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\" AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\" " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("Country", Prefix.DbTableDefinition)}\".\"Name\";";
|
||||||
|
|
||||||
var lookupQueryRegistrationTypeValues = $"SELECT \"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\".\"Name\"";
|
var lookupQueryCityValues =
|
||||||
var lookupQueryClassTypeValues = $"SELECT \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"Name\"";
|
$"SELECT " +
|
||||||
|
$"\"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Code\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\" AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\" " +
|
||||||
|
$"WHERE " +
|
||||||
|
$"\"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Country\" = @param0 " +
|
||||||
|
$"OR @param0 IS NULL " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("City", Prefix.DbTableDefinition)}\".\"Name\";";
|
||||||
|
|
||||||
|
var lookupQueryDistrictValues =
|
||||||
|
$"SELECT " +
|
||||||
|
$"\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" " +
|
||||||
|
$"WHERE " +
|
||||||
|
$"(\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL) " +
|
||||||
|
$"AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"City\" = @param1 OR @param1 IS NULL) " +
|
||||||
|
$"GROUP BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\";";
|
||||||
|
|
||||||
|
var lookupQueryStreetValues =
|
||||||
|
$"SELECT " +
|
||||||
|
$"\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" " +
|
||||||
|
$"WHERE " +
|
||||||
|
$"(\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL) " +
|
||||||
|
$"AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"City\" = @param1 OR @param1 IS NULL) " +
|
||||||
|
$"AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" = @param2 OR @param2 IS NULL) " +
|
||||||
|
$"GROUP BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\";";
|
||||||
|
|
||||||
|
var lookupQueryTenantValues =
|
||||||
|
$"SELECT * FROM (" +
|
||||||
|
$"SELECT NULL AS \"Key\", 'Host' AS \"Name\" " +
|
||||||
|
$"UNION ALL " +
|
||||||
|
$"SELECT " +
|
||||||
|
$"\"AbpTenants\".\"Id\" AS \"Key\", " +
|
||||||
|
$"\"AbpTenants\".\"Name\" AS \"Name\" " +
|
||||||
|
$"FROM \"AbpTenants\"" +
|
||||||
|
$") AS \"List\" " +
|
||||||
|
$"ORDER BY \"Name\"";
|
||||||
|
|
||||||
|
|
||||||
|
var lookupQueryBranchValues =
|
||||||
|
$"SELECT \"{SelectCommandByTableName("Branch")}\".\"Id\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("Branch")}\".\"Name\" as \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("Branch")}\" " +
|
||||||
|
$"WHERE \"{SelectCommandByTableName("Branch")}\".\"TenantId\" = '@TENANTID' " +
|
||||||
|
$"AND \"{SelectCommandByTableName("Branch")}\".\"Id\" IN ( " +
|
||||||
|
$"SELECT [BranchId] " +
|
||||||
|
$"FROM [PBranchUsers] " +
|
||||||
|
$"WHERE [UserId] = '@USERID' " +
|
||||||
|
$") " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("Branch")}\".\"Name\"";
|
||||||
|
|
||||||
|
var lookupQueryRegistrationTypeValues =
|
||||||
|
$"SELECT " +
|
||||||
|
$"\"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\".\"Name\" AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\" " +
|
||||||
|
$"WHERE " +
|
||||||
|
$"(\"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\".\"BranchId\" = @param0 OR @param0 IS NULL) " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\".\"Name\";";
|
||||||
|
|
||||||
|
var lookupQueryClassTypeValues =
|
||||||
|
$"SELECT " +
|
||||||
|
$"\"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", " +
|
||||||
|
$"\"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"Name\" AS \"Name\" " +
|
||||||
|
$"FROM \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\" " +
|
||||||
|
$"WHERE " +
|
||||||
|
$"(\"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"BranchId\" = @param0 OR @param0 IS NULL) " +
|
||||||
|
$"ORDER BY \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\".\"Name\";";
|
||||||
|
|
||||||
var htmlEditorOptions = "{\"toolbar\": {\"multiline\": true, \"items\": [{\"name\": \"undo\"},{\"name\": \"redo\"},{\"name\": \"separator\"},{\"name\": \"size\",\"acceptedValues\": [\"8pt\",\"10pt\",\"12pt\",\"14pt\",\"18pt\",\"24pt\",\"36pt\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font size\"}}},{\"name\": \"font\",\"acceptedValues\": [\"Arial\",\"Courier New\",\"Georgia\",\"Impact\",\"Lucida Console\",\"Tahoma\",\"Times New Roman\",\"Verdana\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"bold\"},{\"name\": \"italic\"},{\"name\": \"strike\"},{\"name\": \"underline\"},{\"name\": \"separator\"},{\"name\": \"alignLeft\"},{\"name\": \"alignCenter\"},{\"name\": \"alignRight\"},{\"name\": \"alignJustify\"},{\"name\": \"separator\"},{\"name\": \"orderedList\"},{\"name\": \"bulletList\"},{\"name\": \"separator\"},{\"name\": \"header\",\"acceptedValues\": [false,1,2,3,4,5],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"color\"},{\"name\": \"background\"},{\"name\": \"separator\"},{\"name\": \"link\"},{\"name\": \"image\"},{\"name\": \"separator\"},{\"name\": \"clear\"},{\"name\": \"codeBlock\"},{\"name\": \"blockquote\"},{\"name\": \"separator\"},{\"name\": \"insertTable\"},{\"name\": \"deleteTable\"},{\"name\": \"insertRowAbove\"},{\"name\": \"insertRowBelow\"},{\"name\": \"deleteRow\"},{\"name\": \"insertColumnLeft\"},{\"name\": \"insertColumnRight\"},{\"name\": \"deleteColumn\"}]}}";
|
var htmlEditorOptions = "{\"toolbar\": {\"multiline\": true, \"items\": [{\"name\": \"undo\"},{\"name\": \"redo\"},{\"name\": \"separator\"},{\"name\": \"size\",\"acceptedValues\": [\"8pt\",\"10pt\",\"12pt\",\"14pt\",\"18pt\",\"24pt\",\"36pt\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font size\"}}},{\"name\": \"font\",\"acceptedValues\": [\"Arial\",\"Courier New\",\"Georgia\",\"Impact\",\"Lucida Console\",\"Tahoma\",\"Times New Roman\",\"Verdana\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"bold\"},{\"name\": \"italic\"},{\"name\": \"strike\"},{\"name\": \"underline\"},{\"name\": \"separator\"},{\"name\": \"alignLeft\"},{\"name\": \"alignCenter\"},{\"name\": \"alignRight\"},{\"name\": \"alignJustify\"},{\"name\": \"separator\"},{\"name\": \"orderedList\"},{\"name\": \"bulletList\"},{\"name\": \"separator\"},{\"name\": \"header\",\"acceptedValues\": [false,1,2,3,4,5],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"color\"},{\"name\": \"background\"},{\"name\": \"separator\"},{\"name\": \"link\"},{\"name\": \"image\"},{\"name\": \"separator\"},{\"name\": \"clear\"},{\"name\": \"codeBlock\"},{\"name\": \"blockquote\"},{\"name\": \"separator\"},{\"name\": \"insertTable\"},{\"name\": \"deleteTable\"},{\"name\": \"insertRowAbove\"},{\"name\": \"insertRowBelow\"},{\"name\": \"deleteRow\"},{\"name\": \"insertColumnLeft\"},{\"name\": \"insertColumnRight\"},{\"name\": \"deleteColumn\"}]}}";
|
||||||
var showClearButton = "{ \"showClearButton\" : true }";
|
var showClearButton = "{ \"showClearButton\" : true }";
|
||||||
|
|
@ -767,7 +863,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ColSpan = 2,
|
ColSpan = 2,
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items = [
|
Items = [
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "IdentifierCode", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox},
|
new EditingFormItemDto { Order = 4, DataField = "IdentifierCode", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox},
|
||||||
|
|
@ -817,7 +912,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
SourceDbType = DbType.Guid,
|
SourceDbType = DbType.Guid,
|
||||||
FieldName = "Id",
|
FieldName = "Id",
|
||||||
Width = 100,
|
Width = 100,
|
||||||
ListOrderNo = 0,
|
ListOrderNo = 1,
|
||||||
Visible = false,
|
Visible = false,
|
||||||
IsActive = true,
|
IsActive = true,
|
||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
|
|
@ -839,37 +934,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
IsPivot = true
|
IsPivot = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = formBank.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
RoleId = null,
|
|
||||||
UserId = null,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.Bank + ".Create",
|
|
||||||
R = AppCodes.Definitions.Bank,
|
|
||||||
U = AppCodes.Definitions.Bank + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
@ -2800,7 +2864,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
{
|
{
|
||||||
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
|
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order=1, DataField="TenantId", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order=1, DataField="TenantId", ColSpan=2, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order=2, DataField="Code", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order=2, DataField="Code", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order=3, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order=3, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order=4, DataField="VknTckn", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
new EditingFormItemDto { Order=4, DataField="VknTckn", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
||||||
|
|
@ -23418,7 +23482,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
new EditingFormItemDto { Order = 4, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
||||||
|
|
@ -23474,39 +23537,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
}),
|
}),
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = listFormRegistrationType.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
|
||||||
{
|
|
||||||
new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) }
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.RegistrationType + ".Create",
|
|
||||||
R = AppCodes.Definitions.RegistrationType,
|
|
||||||
U = AppCodes.Definitions.RegistrationType + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
@ -23704,7 +23734,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "RegistrationTypeId", IsRequired = true, ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 3, DataField = "RegistrationTypeId", IsRequired = true, ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
|
|
@ -23760,39 +23789,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
}),
|
}),
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = listFormRegistrationMethod.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
|
||||||
{
|
|
||||||
new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) }
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.RegistrationMethod + ".Create",
|
|
||||||
R = AppCodes.Definitions.RegistrationMethod,
|
|
||||||
U = AppCodes.Definitions.RegistrationMethod + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
@ -23810,6 +23806,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
ValueExpr = "Key",
|
||||||
LookupQuery = lookupQueryBranchValues,
|
LookupQuery = lookupQueryBranchValues,
|
||||||
|
CascadeEmptyFields = "RegistrationTypeId"
|
||||||
}),
|
}),
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
||||||
{
|
{
|
||||||
|
|
@ -23843,6 +23840,9 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
ValueExpr = "Key",
|
||||||
LookupQuery = lookupQueryRegistrationTypeValues,
|
LookupQuery = lookupQueryRegistrationTypeValues,
|
||||||
|
CascadeRelationField = "BranchId",
|
||||||
|
CascadeFilterOperator="=",
|
||||||
|
CascadeParentFields = "BranchId",
|
||||||
}),
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
|
|
@ -24019,7 +24019,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "RegistrationTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 3, DataField = "RegistrationTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
|
|
@ -24080,39 +24079,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
},
|
},
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
|
||||||
ListFormCode = listFormClassType.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
|
||||||
{
|
|
||||||
new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) }
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.ClassType + ".Create",
|
|
||||||
R = AppCodes.Definitions.ClassType,
|
|
||||||
U = AppCodes.Definitions.ClassType + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
|
||||||
new()
|
|
||||||
{
|
{
|
||||||
ListFormCode = listFormClassType.ListFormCode,
|
ListFormCode = listFormClassType.ListFormCode,
|
||||||
CultureName = LanguageCodes.En,
|
CultureName = LanguageCodes.En,
|
||||||
|
|
@ -24128,6 +24094,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
ValueExpr = "Key",
|
||||||
LookupQuery = lookupQueryBranchValues,
|
LookupQuery = lookupQueryBranchValues,
|
||||||
|
CascadeEmptyFields = "RegistrationTypeId"
|
||||||
}),
|
}),
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
||||||
{
|
{
|
||||||
|
|
@ -24161,6 +24128,9 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
ValueExpr = "Key",
|
||||||
LookupQuery = lookupQueryRegistrationTypeValues,
|
LookupQuery = lookupQueryRegistrationTypeValues,
|
||||||
|
CascadeRelationField = "BranchId",
|
||||||
|
CascadeFilterOperator="=",
|
||||||
|
CascadeParentFields = "BranchId",
|
||||||
}),
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
|
|
@ -24383,7 +24353,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "ClassTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 3, DataField = "ClassTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
|
|
@ -24439,39 +24408,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
}),
|
}),
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = listFormClass.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 2,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
|
||||||
{
|
|
||||||
new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) }
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.Class + ".Create",
|
|
||||||
R = AppCodes.Definitions.Class,
|
|
||||||
U = AppCodes.Definitions.Class + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
@ -24489,6 +24425,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
ValueExpr = "Key",
|
||||||
LookupQuery = lookupQueryBranchValues,
|
LookupQuery = lookupQueryBranchValues,
|
||||||
|
CascadeEmptyFields = "ClassTypeId"
|
||||||
}),
|
}),
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
||||||
{
|
{
|
||||||
|
|
@ -24522,6 +24459,9 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
ValueExpr = "Key",
|
||||||
LookupQuery = lookupQueryClassTypeValues,
|
LookupQuery = lookupQueryClassTypeValues,
|
||||||
|
CascadeRelationField = "BranchId",
|
||||||
|
CascadeFilterOperator="=",
|
||||||
|
CascadeParentFields = "BranchId",
|
||||||
}),
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
|
|
@ -24698,7 +24638,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "ClassTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 3, DataField = "ClassTypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
|
|
@ -24758,39 +24697,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
}),
|
}),
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = listFormLevel.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
|
||||||
{
|
|
||||||
new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) }
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.Level + ".Create",
|
|
||||||
R = AppCodes.Definitions.Level,
|
|
||||||
U = AppCodes.Definitions.Level + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
@ -24808,6 +24714,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
ValueExpr = "Key",
|
||||||
LookupQuery = lookupQueryBranchValues,
|
LookupQuery = lookupQueryBranchValues,
|
||||||
|
CascadeEmptyFields = "ClassTypeId"
|
||||||
}),
|
}),
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
||||||
{
|
{
|
||||||
|
|
@ -24841,6 +24748,9 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
DisplayExpr = "Name",
|
DisplayExpr = "Name",
|
||||||
ValueExpr = "Key",
|
ValueExpr = "Key",
|
||||||
LookupQuery = lookupQueryClassTypeValues,
|
LookupQuery = lookupQueryClassTypeValues,
|
||||||
|
CascadeRelationField = "BranchId",
|
||||||
|
CascadeFilterOperator="=",
|
||||||
|
CascadeParentFields = "BranchId",
|
||||||
}),
|
}),
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||||
{
|
{
|
||||||
|
|
@ -25109,7 +25019,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Day", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "Day", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
|
|
@ -25162,40 +25071,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
}),
|
}),
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = listFormLessonPeriod.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
SortIndex = 1,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]
|
|
||||||
{
|
|
||||||
new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) }
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.LessonPeriod + ".Create",
|
|
||||||
R = AppCodes.Definitions.LessonPeriod,
|
|
||||||
U = AppCodes.Definitions.LessonPeriod + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
@ -25529,7 +25404,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group",
|
Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "StartTime", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 4, DataField = "StartTime", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||||
|
|
@ -25648,34 +25522,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
}),
|
}),
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new() {
|
|
||||||
ListFormCode = listFormSchedule.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.Schedule + ".Create",
|
|
||||||
R = AppCodes.Definitions.Schedule,
|
|
||||||
U = AppCodes.Definitions.Schedule + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new() {
|
new() {
|
||||||
ListFormCode = listFormSchedule.ListFormCode,
|
ListFormCode = listFormSchedule.ListFormCode,
|
||||||
|
|
@ -26250,7 +26096,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
ItemType = "group",
|
ItemType = "group",
|
||||||
Items =
|
Items =
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Date", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox },
|
new EditingFormItemDto { Order = 3, DataField = "Date", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "Breakfast", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea },
|
new EditingFormItemDto { Order = 4, DataField = "Breakfast", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea },
|
||||||
|
|
@ -26318,35 +26163,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
}),
|
}),
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = listFormMeal.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.Meal + ".Create",
|
|
||||||
R = AppCodes.Definitions.Meal,
|
|
||||||
U = AppCodes.Definitions.Meal + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
@ -26589,7 +26405,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
||||||
new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items=
|
new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items=
|
||||||
[
|
[
|
||||||
new EditingFormItemDto { Order = 1, DataField = "TenantId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
|
||||||
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||||
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
|
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
|
||||||
new EditingFormItemDto { Order = 4, DataField = "IdentifierCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox},
|
new EditingFormItemDto { Order = 4, DataField = "IdentifierCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox},
|
||||||
|
|
@ -26672,37 +26487,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc
|
||||||
IsPivot = true
|
IsPivot = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// TenantId
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
ListFormCode = listFormBank.ListFormCode,
|
|
||||||
CultureName = LanguageCodes.En,
|
|
||||||
RoleId = null,
|
|
||||||
UserId = null,
|
|
||||||
SourceDbType = DbType.Guid,
|
|
||||||
FieldName = "TenantId",
|
|
||||||
Width = 150,
|
|
||||||
ListOrderNo = 1,
|
|
||||||
Visible = true,
|
|
||||||
IsActive = true,
|
|
||||||
IsDeleted = false,
|
|
||||||
LookupJson = JsonSerializer.Serialize(new LookupDto {
|
|
||||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
|
||||||
DisplayExpr = "Name",
|
|
||||||
ValueExpr = "Key",
|
|
||||||
LookupQuery = lookupQueryTenantValues,
|
|
||||||
}),
|
|
||||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
|
||||||
{
|
|
||||||
C = AppCodes.Definitions.Bank + ".Create",
|
|
||||||
R = AppCodes.Definitions.Bank,
|
|
||||||
U = AppCodes.Definitions.Bank + ".Update",
|
|
||||||
E = true,
|
|
||||||
I = true,
|
|
||||||
Deny = false
|
|
||||||
}),
|
|
||||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true })
|
|
||||||
},
|
|
||||||
// BranchId
|
// BranchId
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace Kurs.Platform.Entities;
|
||||||
|
|
||||||
public class Branch : FullAuditedEntity<Guid>
|
public class Branch : FullAuditedEntity<Guid>
|
||||||
{
|
{
|
||||||
public Guid TenantId { get; set; }
|
public Guid? TenantId { get; set; }
|
||||||
|
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -130,31 +130,31 @@ public class ListFormManager : PlatformDomainService, IListFormManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listForm.IsBranch)
|
// if (listForm.IsBranch)
|
||||||
{
|
// {
|
||||||
var ids = await branchUsersRepository.GetListAsync((a) => a.UserId == CurrentUser.Id.Value);
|
// var ids = await branchUsersRepository.GetListAsync((a) => a.UserId == CurrentUser.Id.Value);
|
||||||
if (ids.Count > 0)
|
// if (ids.Count > 0)
|
||||||
{
|
// {
|
||||||
fields.Add("BranchId", $"IN ({string.Join(",", ids.Select(a => $"'{a.BranchId}'"))})");
|
// fields.Add("BranchId", $"IN ({string.Join(",", ids.Select(a => $"'{a.BranchId}'"))})");
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
fields.Add("BranchId", $"IN ('{Guid.Empty}')");
|
// fields.Add("BranchId", $"IN ('{Guid.Empty}')");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (listForm.IsOrganizationUnit)
|
// if (listForm.IsOrganizationUnit)
|
||||||
{
|
// {
|
||||||
var ids = await ouRepository.GetOrganizationUnitIdsWithChildren(CurrentUser.Id.Value);
|
// var ids = await ouRepository.GetOrganizationUnitIdsWithChildren(CurrentUser.Id.Value);
|
||||||
if (ids.Count > 0)
|
// if (ids.Count > 0)
|
||||||
{
|
// {
|
||||||
fields.Add("OrganizationUnitId", $"IN ({string.Join(",", ids.Select(a => $"'{a}'"))})");
|
// fields.Add("OrganizationUnitId", $"IN ({string.Join(",", ids.Select(a => $"'{a}'"))})");
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
fields.Add("OrganizationUnitId", $"IN ('{Guid.Empty}')");
|
// fields.Add("OrganizationUnitId", $"IN ('{Guid.Empty}')");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
foreach (var item in defaultFields)
|
foreach (var item in defaultFields)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ using Volo.Abp.Users;
|
||||||
|
|
||||||
public class DefaultValueHelper : ITransientDependency
|
public class DefaultValueHelper : ITransientDependency
|
||||||
{
|
{
|
||||||
private ICurrentUser _currentUser;
|
private readonly ICurrentUser _currentUser;
|
||||||
private ICurrentTenant _currentTenant;
|
private readonly ICurrentTenant _currentTenant;
|
||||||
|
|
||||||
public DefaultValueHelper(
|
public DefaultValueHelper(
|
||||||
ICurrentUser currentUser,
|
ICurrentUser currentUser,
|
||||||
|
|
@ -24,11 +24,33 @@ public class DefaultValueHelper : ITransientDependency
|
||||||
if (string.IsNullOrEmpty(strValue))
|
if (string.IsNullOrEmpty(strValue))
|
||||||
return strValue;
|
return strValue;
|
||||||
|
|
||||||
return strValue
|
// 🔹 TenantId değişimi özel ele alınacak
|
||||||
.Replace(PlatformConsts.DefaultValues.UserId, _currentUser.Id.ToString())
|
var result = strValue
|
||||||
.Replace(PlatformConsts.DefaultValues.UserName, _currentUser.UserName)
|
.Replace(PlatformConsts.DefaultValues.UserId, _currentUser.Id?.ToString() ?? Guid.Empty.ToString())
|
||||||
.Replace(PlatformConsts.DefaultValues.Roles, string.Join("','", _currentUser.Roles))
|
.Replace(PlatformConsts.DefaultValues.UserName, _currentUser.UserName ?? string.Empty)
|
||||||
.Replace(PlatformConsts.DefaultValues.Now, DateTime.UtcNow.ToString("o", CultureInfo.InvariantCulture))
|
.Replace(PlatformConsts.DefaultValues.Roles, string.Join("','", _currentUser.Roles ?? Array.Empty<string>()))
|
||||||
.Replace(PlatformConsts.DefaultValues.TenantId, _currentTenant.Id.HasValue ? _currentTenant.Id.ToString() : Guid.Empty.ToString());
|
.Replace(PlatformConsts.DefaultValues.Now, DateTime.UtcNow.ToString("o", CultureInfo.InvariantCulture));
|
||||||
|
|
||||||
|
// 🔹 TenantId özel durumu: NULL => IS NULL, varsa => = 'GUID'
|
||||||
|
if (result.Contains(PlatformConsts.DefaultValues.TenantId))
|
||||||
|
{
|
||||||
|
if (_currentTenant.Id.HasValue)
|
||||||
|
{
|
||||||
|
result = result.Replace(
|
||||||
|
$"= '{PlatformConsts.DefaultValues.TenantId}'",
|
||||||
|
$"= '{_currentTenant.Id}'"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Boşsa: TenantId IS NULL yaz
|
||||||
|
result = result.Replace(
|
||||||
|
$"= '{PlatformConsts.DefaultValues.TenantId}'",
|
||||||
|
"IS NULL"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,17 @@ public class QueryHelper
|
||||||
switch (fieldDbSource)
|
switch (fieldDbSource)
|
||||||
{
|
{
|
||||||
case DbType.Guid:
|
case DbType.Guid:
|
||||||
var guidValues = values.Select(a => Guid.Parse(a.ToString())).ToArray();
|
var guidValues = values.Select(a =>
|
||||||
|
{
|
||||||
|
if (a == null)
|
||||||
|
return (Guid?)null;
|
||||||
|
|
||||||
|
var str = a.ToString();
|
||||||
|
if (string.IsNullOrWhiteSpace(str))
|
||||||
|
return (Guid?)null;
|
||||||
|
|
||||||
|
return Guid.TryParse(str, out var g) ? g : (Guid?)null;
|
||||||
|
}).ToArray();
|
||||||
value = isArray ? guidValues : guidValues[0];
|
value = isArray ? guidValues : guidValues[0];
|
||||||
break;
|
break;
|
||||||
case DbType.String:
|
case DbType.String:
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,6 @@ public class PlatformDbContext :
|
||||||
b.ToTable(Prefix.DbTableDefault + nameof(Branch), Prefix.DbSchema);
|
b.ToTable(Prefix.DbTableDefault + nameof(Branch), Prefix.DbSchema);
|
||||||
b.ConfigureByConvention();
|
b.ConfigureByConvention();
|
||||||
|
|
||||||
b.Property(a => a.TenantId).IsRequired();
|
|
||||||
b.Property(a => a.Code).IsRequired().HasMaxLength(64);
|
b.Property(a => a.Code).IsRequired().HasMaxLength(64);
|
||||||
b.Property(a => a.Name).IsRequired().HasMaxLength(128);
|
b.Property(a => a.Name).IsRequired().HasMaxLength(128);
|
||||||
b.Property(a => a.VknTckn).IsRequired();
|
b.Property(a => a.VknTckn).IsRequired();
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
||||||
namespace Kurs.Platform.Migrations
|
namespace Kurs.Platform.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PlatformDbContext))]
|
[DbContext(typeof(PlatformDbContext))]
|
||||||
[Migration("20251007120118_Initial")]
|
[Migration("20251008085215_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
@ -1336,7 +1336,7 @@ namespace Kurs.Platform.Migrations
|
||||||
.HasMaxLength(128)
|
.HasMaxLength(128)
|
||||||
.HasColumnType("nvarchar(128)");
|
.HasColumnType("nvarchar(128)");
|
||||||
|
|
||||||
b.Property<Guid>("TenantId")
|
b.Property<Guid?>("TenantId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<long>("VknTckn")
|
b.Property<long>("VknTckn")
|
||||||
|
|
@ -1272,7 +1272,7 @@ namespace Kurs.Platform.Migrations
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||||
Code = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
Code = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
||||||
VknTckn = table.Column<long>(type: "bigint", nullable: false),
|
VknTckn = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
|
@ -1333,7 +1333,7 @@ namespace Kurs.Platform.Migrations
|
||||||
.HasMaxLength(128)
|
.HasMaxLength(128)
|
||||||
.HasColumnType("nvarchar(128)");
|
.HasColumnType("nvarchar(128)");
|
||||||
|
|
||||||
b.Property<Guid>("TenantId")
|
b.Property<Guid?>("TenantId")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<long>("VknTckn")
|
b.Property<long>("VknTckn")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue