diff --git a/api/src/Kurs.Platform.Application.Contracts/ListForms/DynamicApi/CreateUpdateTenantInput.cs b/api/src/Kurs.Platform.Application.Contracts/ListForms/DynamicApi/CreateUpdateTenantInput.cs index 177c6fc7..f952b202 100644 --- a/api/src/Kurs.Platform.Application.Contracts/ListForms/DynamicApi/CreateUpdateTenantInput.cs +++ b/api/src/Kurs.Platform.Application.Contracts/ListForms/DynamicApi/CreateUpdateTenantInput.cs @@ -15,11 +15,12 @@ public class CreateUpdateTenantInput public string Founder { get; set; } public long VknTckn { get; set; } public string TaxOffice { get; set; } - public string Address { get; set; } - public string Address2 { get; set; } - public string District { get; set; } public string Country { get; set; } public string City { get; set; } + public string District { get; set; } + public string Street { get; set; } + public string Address { get; set; } + public string Address2 { get; set; } public string PostalCode { get; set; } public long Phone { get; set; } public long Mobile { get; set; } diff --git a/api/src/Kurs.Platform.Application.Contracts/Tenants/CustomTenantDto.cs b/api/src/Kurs.Platform.Application.Contracts/Tenants/CustomTenantDto.cs index e45f2310..c0cdbcf1 100644 --- a/api/src/Kurs.Platform.Application.Contracts/Tenants/CustomTenantDto.cs +++ b/api/src/Kurs.Platform.Application.Contracts/Tenants/CustomTenantDto.cs @@ -12,11 +12,12 @@ public class CustomTenantDto public string Founder { get; set; } public long VknTckn { get; set; } public string TaxOffice { get; set; } - public string Address { get; set; } - public string Address2 { get; set; } - public string District { get; set; } public string Country { get; set; } public string City { get; set; } + public string District { get; set; } + public string Street { get; set; } + public string Address { get; set; } + public string Address2 { get; set; } public string PostalCode { get; set; } public long Phone { get; set; } public long Mobile { get; set; } diff --git a/api/src/Kurs.Platform.Application/ListForms/ListFormDynamicApiAppService.cs b/api/src/Kurs.Platform.Application/ListForms/ListFormDynamicApiAppService.cs index 5b15703e..37c9a352 100644 --- a/api/src/Kurs.Platform.Application/ListForms/ListFormDynamicApiAppService.cs +++ b/api/src/Kurs.Platform.Application/ListForms/ListFormDynamicApiAppService.cs @@ -117,11 +117,12 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic entity.SetFounder(input.Data.Founder); entity.SetVknTckn(input.Data.VknTckn); entity.SetTaxOffice(input.Data.TaxOffice); - entity.SetAddress(input.Data.Address); - entity.SetAddress2(input.Data.Address2); - entity.SetDistrict(input.Data.District); entity.SetCountry(input.Data.Country); entity.SetCity(input.Data.City); + entity.SetDistrict(input.Data.District); + entity.SetStreet(input.Data.Street); + entity.SetAddress(input.Data.Address); + entity.SetAddress2(input.Data.Address2); entity.SetPostalCode(input.Data.PostalCode); entity.SetPhone(input.Data.Phone); entity.SetMobile(input.Data.Mobile); @@ -150,11 +151,12 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic entity.SetFounder(input.Data.Founder); entity.SetVknTckn(input.Data.VknTckn); entity.SetTaxOffice(input.Data.TaxOffice); - entity.SetAddress(input.Data.Address); - entity.SetAddress2(input.Data.Address2); - entity.SetDistrict(input.Data.District); entity.SetCountry(input.Data.Country); entity.SetCity(input.Data.City); + entity.SetDistrict(input.Data.District); + entity.SetStreet(input.Data.Street); + entity.SetAddress(input.Data.Address); + entity.SetAddress2(input.Data.Address2); entity.SetPostalCode(input.Data.PostalCode); entity.SetPhone(input.Data.Phone); entity.SetMobile(input.Data.Mobile); diff --git a/api/src/Kurs.Platform.Application/Tenants/PlatformTenantAppService.cs b/api/src/Kurs.Platform.Application/Tenants/PlatformTenantAppService.cs index 6e75ed9d..7e7cf07e 100644 --- a/api/src/Kurs.Platform.Application/Tenants/PlatformTenantAppService.cs +++ b/api/src/Kurs.Platform.Application/Tenants/PlatformTenantAppService.cs @@ -79,11 +79,12 @@ public class PlatformTenantAppService : TenantAppService, IPlatformTenantAppServ dto.Founder = tenant.GetFounder(); dto.VknTckn = tenant.GetVknTckn(); dto.TaxOffice = tenant.GetTaxOffice(); - dto.Address = tenant.GetAddress(); - dto.Address2 = tenant.GetAddress2(); - dto.District = tenant.GetDistrict(); dto.Country = tenant.GetCountry(); dto.City = tenant.GetCity(); + dto.District = tenant.GetDistrict(); + dto.Street = tenant.GetStreet(); + dto.Address = tenant.GetAddress(); + dto.Address2 = tenant.GetAddress2(); dto.PostalCode = tenant.GetPostalCode(); dto.Phone = tenant.GetPhone(); dto.Mobile = tenant.GetMobile(); diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 6f6ebf33..cd7ffde4 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Data; -using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Kurs.Languages.Languages; @@ -437,8 +436,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Popup = new GridEditingPopupDto() { Title = "Tenant Form", - Width = 500, - Height = 550 + Width = 900, + Height = 450 }, AllowDeleting = true, AllowAdding = true, @@ -447,7 +446,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), EditingFormJson = JsonSerializer.Serialize(new List() { - new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = + new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items = [ new EditingFormItemDto { Order=1, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=2, DataField="InstitutionName", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, @@ -460,16 +459,17 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new EditingFormItemDto { Order=9, DataField="IsActive", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxCheckBox }, ] }, - new() { Order=2, ColCount=1, ColSpan=2, ItemType="group", Items = + new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items = [ - new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, - new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=4, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=5, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=6, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=7, DataField="Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=8, DataField="Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, + new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order=5, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=6, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=7, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=8, DataField="Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=9, DataField="Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, ] } }), @@ -516,7 +516,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency #region Tenants Fields await _listFormFieldRepository.InsertManyAsync( [ - new ListFormField + new ListFormField { ListFormCode = listFormTenants.ListFormCode, RoleId = null, @@ -702,7 +702,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"" + LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"", + CascadeEmptyFields = "City,District,Street" }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { @@ -732,6 +733,17 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsActive = true, IsDeleted = false, AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"", + CascadeRelationField = "Country", + CascadeFilterOperator="=", + CascadeParentFields = "Country", + CascadeEmptyFields = "District,Street" + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = TenantManagementPermissions.Tenants.Create, @@ -760,6 +772,55 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsActive = true, IsDeleted = false, AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Name\" AS \"Key\", \"{DbTablePrefix}District\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Name\" ORDER BY \"{DbTablePrefix}District\".\"Name\"", + CascadeRelationField = "City", + CascadeFilterOperator="=", + CascadeParentFields = "Country,City", + CascadeEmptyFields = "Street", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = TenantManagementPermissions.Tenants.Create, + R = TenantManagementPermissions.Tenants.Default, + U = TenantManagementPermissions.Tenants.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormTenants.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Street", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Street\" AS \"Key\", \"{DbTablePrefix}District\".\"Street\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) AND (\"{DbTablePrefix}District\".\"Name\" = @param2 OR @param2 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Street\" ORDER BY \"{DbTablePrefix}District\".\"Street\"", + CascadeRelationField = "District", + CascadeFilterOperator="=", + CascadeParentFields = "Country,City,District" + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = TenantManagementPermissions.Tenants.Create, @@ -783,34 +844,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "Address", Width = 150, - ListOrderNo = 10, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = TenantManagementPermissions.Tenants.Create, - R = TenantManagementPermissions.Tenants.Default, - U = TenantManagementPermissions.Tenants.Update, - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormTenants.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Address2", - Width = 150, ListOrderNo = 11, Visible = true, IsActive = true, @@ -830,6 +863,34 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency IsPivot = true }) }, + new ListFormField + { + ListFormCode = listFormTenants.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Address2", + Width = 150, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = TenantManagementPermissions.Tenants.Create, + R = TenantManagementPermissions.Tenants.Default, + U = TenantManagementPermissions.Tenants.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, new ListFormField { ListFormCode = listFormTenants.ListFormCode, @@ -839,7 +900,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "PostalCode", Width = 100, - ListOrderNo = 12, + ListOrderNo = 13, Visible = true, IsActive = true, IsDeleted = false, @@ -867,7 +928,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "Email", Width = 170, - ListOrderNo = 13, + ListOrderNo = 14, Visible = true, IsActive = true, IsDeleted = false, @@ -895,7 +956,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "Website", Width = 170, - ListOrderNo = 14, + ListOrderNo = 15, Visible = true, IsActive = true, IsDeleted = false, @@ -923,7 +984,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "Mobile", Width = 100, - ListOrderNo = 15, + ListOrderNo = 16, Visible = true, IsActive = true, IsDeleted = false, @@ -951,7 +1012,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "Phone", Width = 100, - ListOrderNo = 16, + ListOrderNo = 17, Visible = true, IsActive = true, IsDeleted = false, @@ -979,7 +1040,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.String, FieldName = "Fax", Width = 100, - ListOrderNo = 17, + ListOrderNo = 18, Visible = true, IsActive = true, IsDeleted = false, @@ -1007,7 +1068,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.Boolean, FieldName = "IsActive", Width = 100, - ListOrderNo = 18, + ListOrderNo = 19, Visible = true, IsActive = true, IsDeleted = false, @@ -1031,6 +1092,955 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Branche + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Branch)) + { + var listFormBranches = await _listFormRepository.InsertAsync( + new ListForm() + { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Branch, + Name = AppCodes.Branches, + Title = AppCodes.Branches, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Branches, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Branch"), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + D = AppCodes.Branches + ".Delete", + E = AppCodes.Branches + ".Export", + I = AppCodes.Branches + ".Import" + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Branch Form", + Width = 900, + Height = 450 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + 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\" : true }" }, + 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=4, DataField="VknTckn", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order=5, DataField="TaxOffice", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=6, DataField="Mobile", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order=7, DataField="Phone", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order=8, DataField="Fax", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=9, DataField="IsActive", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxCheckBox }, + ] + }, + new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items = + [ + new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, + new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order=5, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=6, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=7, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=8, DataField="Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=9, DataField="Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + ] + } + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}Branch\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new FieldsDefaultValue() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new FieldsDefaultValue() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "IsActive", + FieldDbType = DbType.Boolean, + Value = "true", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) + + } + ); + + #region Branches Fields + await _listFormFieldRepository.InsertManyAsync( + [ + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 500, + ListOrderNo = 0, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "TenantId", + Width = 200, + ListOrderNo = 1, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"AbpTenants\".\"Id\" AS \"Key\", \"AbpTenants\".\"Name\" as \"Name\" FROM \"AbpTenants\" ORDER BY \"AbpTenants\".\"Name\"", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 100, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "VknTckn", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "TaxOffice", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Country", + Width = 100, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"", + CascadeEmptyFields = "City,District,Street" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = TenantManagementPermissions.Tenants.Create, + R = TenantManagementPermissions.Tenants.Default, + U = TenantManagementPermissions.Tenants.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "City", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"", + CascadeRelationField = "Country", + CascadeFilterOperator="=", + CascadeParentFields = "Country", + CascadeEmptyFields = "District,Street" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = TenantManagementPermissions.Tenants.Create, + R = TenantManagementPermissions.Tenants.Default, + U = TenantManagementPermissions.Tenants.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "District", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Name\" AS \"Key\", \"{DbTablePrefix}District\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Name\" ORDER BY \"{DbTablePrefix}District\".\"Name\"", + CascadeRelationField = "City", + CascadeFilterOperator="=", + CascadeParentFields = "Country,City", + CascadeEmptyFields = "Street", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = TenantManagementPermissions.Tenants.Create, + R = TenantManagementPermissions.Tenants.Default, + U = TenantManagementPermissions.Tenants.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Street", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{DbTablePrefix}District\".\"Street\" AS \"Key\", \"{DbTablePrefix}District\".\"Street\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) AND (\"{DbTablePrefix}District\".\"Name\" = @param2 OR @param2 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Street\" ORDER BY \"{DbTablePrefix}District\".\"Street\"", + CascadeRelationField = "District", + CascadeFilterOperator="=", + CascadeParentFields = "Country,City,District" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = TenantManagementPermissions.Tenants.Create, + R = TenantManagementPermissions.Tenants.Default, + U = TenantManagementPermissions.Tenants.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Address", + Width = 150, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Address2", + Width = 150, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PostalCode", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Email", + Width = 170, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Website", + Width = 170, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Mobile", + Width = 100, + ListOrderNo = 15, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone", + Width = 100, + ListOrderNo = 16, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Fax", + Width = 100, + ListOrderNo = 17, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new ListFormField + { + ListFormCode = listFormBranches.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 100, + ListOrderNo = 18, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Branches + ".Create", + R = AppCodes.Branches, + U = AppCodes.Branches + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + ]); + #endregion + } + #endregion + + #region Permission Group + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.PermissionGroup)) + { + var listFormPermissionGroups = await _listFormRepository.InsertAsync( + new ListForm() + { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.PermissionGroup, + Name = AbpIdentity.PermissionGroups.Default, + Title = AbpIdentity.PermissionGroups.Default, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AbpIdentity.PermissionGroups.Default, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = "AbpPermissionGroups", + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto + { + Visible = true + }), + HeaderFilterJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SearchPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + GroupPanelJson = JsonSerializer.Serialize(new + { + Visible = true + }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AbpIdentity.PermissionGroups.Create, + R = AbpIdentity.PermissionGroups.Default, + U = AbpIdentity.PermissionGroups.Update, + D = AbpIdentity.PermissionGroups.Delete, + E = AbpIdentity.PermissionGroups.Export, + I = AbpIdentity.PermissionGroups.Import, + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Permissio Groups Form", + Width = 800, + Height = 350 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = + [ + new EditingFormItemDto { Order=1, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=2, DataField="DisplayName", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order=3, DataField="ExtraProperties", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, + ] + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new FieldsDefaultValue() { + FieldName = "ExtraProperties", + FieldDbType = DbType.String, + Value = "{}", + CustomValueType = FieldCustomValueTypeEnum.Value }, + }) + } + ); + + #region Permission Groups Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + new() { + ListFormCode = listFormPermissionGroups.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AbpIdentity.PermissionGroups.Create, + R = AbpIdentity.PermissionGroups.Default, + U = AbpIdentity.PermissionGroups.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPermissionGroups.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 300, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AbpIdentity.PermissionGroups.Create, + R = AbpIdentity.PermissionGroups.Default, + U = AbpIdentity.PermissionGroups.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPermissionGroups.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "DisplayName", + Width = 300, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AbpIdentity.PermissionGroups.Create, + R = AbpIdentity.PermissionGroups.Default, + U = AbpIdentity.PermissionGroups.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormPermissionGroups.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ExtraProperties", + Width = 300, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AbpIdentity.PermissionGroups.Create, + R = AbpIdentity.PermissionGroups.Default, + U = AbpIdentity.PermissionGroups.Update, + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + #region Permission if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Permission)) { @@ -7050,222 +8060,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion - #region Permission Group - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.PermissionGroup)) - { - var listFormPermissionGroups = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.PermissionGroup, - Name = AbpIdentity.PermissionGroups.Default, - Title = AbpIdentity.PermissionGroups.Default, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AbpIdentity.PermissionGroups.Default, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = "AbpPermissionGroups", - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto - { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AbpIdentity.PermissionGroups.Create, - R = AbpIdentity.PermissionGroups.Default, - U = AbpIdentity.PermissionGroups.Update, - D = AbpIdentity.PermissionGroups.Delete, - E = AbpIdentity.PermissionGroups.Export, - I = AbpIdentity.PermissionGroups.Import, - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() - { - Title = "Permissio Groups Form", - Width = 800, - Height = 350 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() - { - new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = - [ - new EditingFormItemDto { Order=1, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=2, DataField="DisplayName", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=3, DataField="ExtraProperties", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - ] - } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new FieldsDefaultValue() { - FieldName = "ExtraProperties", - FieldDbType = DbType.String, - Value = "{}", - CustomValueType = FieldCustomValueTypeEnum.Value }, - }) - } - ); - - #region Permission Groups Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] - { - new() { - ListFormCode = listFormPermissionGroups.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 100, - ListOrderNo = 1, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AbpIdentity.PermissionGroups.Create, - R = AbpIdentity.PermissionGroups.Default, - U = AbpIdentity.PermissionGroups.Update, - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormPermissionGroups.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 300, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AbpIdentity.PermissionGroups.Create, - R = AbpIdentity.PermissionGroups.Default, - U = AbpIdentity.PermissionGroups.Update, - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormPermissionGroups.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "DisplayName", - Width = 300, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AbpIdentity.PermissionGroups.Create, - R = AbpIdentity.PermissionGroups.Default, - U = AbpIdentity.PermissionGroups.Update, - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormPermissionGroups.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "ExtraProperties", - Width = 300, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AbpIdentity.PermissionGroups.Create, - R = AbpIdentity.PermissionGroups.Default, - U = AbpIdentity.PermissionGroups.Update, - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - }); - #endregion - } - #endregion - #region Global Search if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.GlobalSearch)) { @@ -7875,674 +8669,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion - #region Branche - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Branch)) - { - var listFormBranches = await _listFormRepository.InsertAsync( - new ListForm() - { - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Branch, - Name = AppCodes.Branches, - Title = AppCodes.Branches, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = false, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Branches, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Branch"), - KeyFieldName = "Id", - KeyFieldDbSourceType = DbType.Guid, - DefaultFilter = "\"IsDeleted\" = 'false'", - SortMode = GridOptions.SortModeSingle, - FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto - { - Visible = true - }), - HeaderFilterJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SearchPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - GroupPanelJson = JsonSerializer.Serialize(new - { - Visible = true - }), - SelectionJson = JsonSerializer.Serialize(new SelectionDto - { - Mode = GridOptions.SelectionModeSingle, - AllowSelectAll = false - }), - ColumnOptionJson = JsonSerializer.Serialize(new - { - ColumnFixingEnabled = true, - ColumnChooserEnabled = true - }), - PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - D = AppCodes.Branches + ".Delete", - E = AppCodes.Branches + ".Export", - I = AppCodes.Branches + ".Import" - }), - PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto - { - Visible = true, - AllowedPageSizes = "10,20,50,100", - ShowPageSizeSelector = true, - ShowNavigationButtons = true, - ShowInfo = false, - InfoText = "Page {0} of {1} ({2} items)", - DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, - ScrollingMode = GridColumnOptions.ScrollingModeStandard, - LoadPanelEnabled = "auto", - LoadPanelText = "Loading..." - }), - EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto - { - Popup = new GridEditingPopupDto() - { - Title = "Branch Form", - Width = 500, - Height = 550 - }, - AllowDeleting = true, - AllowAdding = true, - AllowUpdating = true, - SendOnlyChangedFormValuesUpdate = false, - }), - EditingFormJson = JsonSerializer.Serialize(new List() - { - new() { Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = - [ - new EditingFormItemDto { Order=1, DataField="TenantId", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, - 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=4, DataField="VknTckn", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order=5, DataField="TaxOffice", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=6, DataField="Mobile", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order=7, DataField="Phone", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxNumberBox }, - new EditingFormItemDto { Order=8, DataField="Fax", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=9, DataField="IsActive", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxCheckBox }, - ] - }, - new() { Order=2, ColCount=1, ColSpan=2, ItemType="group", Items = - [ - new EditingFormItemDto { Order=1, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=2, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=3, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }, - new EditingFormItemDto { Order=4, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=5, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=6, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=7, DataField="Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order=8, DataField="Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox }, - ] - } - }), - DeleteCommand = $"UPDATE \"{DbTablePrefix}Branch\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", - DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "DeleterId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new() { - FieldName = "Id", - FieldDbType = DbType.Guid, - Value = "@ID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new FieldsDefaultValue() { - FieldName = "CreationTime", - FieldDbType = DbType.DateTime, - Value = "@NOW", - CustomValueType = FieldCustomValueTypeEnum.CustomKey }, - new FieldsDefaultValue() { - FieldName = "CreatorId", - FieldDbType = DbType.Guid, - Value = "@USERID", - CustomValueType = FieldCustomValueTypeEnum.CustomKey } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "IsActive", - FieldDbType = DbType.Boolean, - Value = "true", - CustomValueType = FieldCustomValueTypeEnum.Value } - }) - - } - ); - - #region Branches Fields - await _listFormFieldRepository.InsertManyAsync( - [ - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "Id", - Width = 500, - ListOrderNo = 0, - Visible = false, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "TenantId", - Width = 200, - ListOrderNo = 1, - Visible = true, - IsActive = true, - IsDeleted = false, - LookupJson = JsonSerializer.Serialize(new LookupDto { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"AbpTenants\".\"Id\" AS \"Key\", \"AbpTenants\".\"Name\" as \"Name\" FROM \"AbpTenants\" ORDER BY \"AbpTenants\".\"Name\"", - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Code", - Width = 100, - ListOrderNo = 2, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - Width = 200, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "VknTckn", - Width = 100, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "TaxOffice", - Width = 150, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Address", - Width = 150, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Address2", - Width = 150, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Country", - Width = 100, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"" - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = TenantManagementPermissions.Tenants.Create, - R = TenantManagementPermissions.Tenants.Default, - U = TenantManagementPermissions.Tenants.Update, - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "City", - Width = 100, - ListOrderNo = 9, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "District", - Width = 100, - ListOrderNo = 10, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "PostalCode", - Width = 100, - ListOrderNo = 11, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Email", - Width = 170, - ListOrderNo = 12, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Website", - Width = 170, - ListOrderNo = 13, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Mobile", - Width = 100, - ListOrderNo = 14, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Phone", - Width = 100, - ListOrderNo = 15, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Fax", - Width = 100, - ListOrderNo = 16, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new ListFormField - { - ListFormCode = listFormBranches.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "IsActive", - Width = 100, - ListOrderNo = 17, - Visible = true, - IsActive = true, - IsDeleted = false, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Branches + ".Create", - R = AppCodes.Branches, - U = AppCodes.Branches + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - ]); - #endregion - } - #endregion - #region ClaimType if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ClaimType)) { diff --git a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs index a2196aa2..06e619d3 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -31,11 +31,12 @@ public static class PlatformConsts public const string VknTckn = "VknTckn"; public const string Founder = "Founder"; public const string TaxOffice = "TaxOffice"; - public const string Address = "Address"; - public const string Address2 = "Address2"; public const string Country = "Country"; public const string City = "City"; public const string District = "District"; + public const string Street = "Street"; + public const string Address = "Address"; + public const string Address2 = "Address2"; public const string PostalCode = "PostalCode"; public const string Phone = "Phone"; public const string Mobile = "Mobile"; diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch.cs b/api/src/Kurs.Platform.Domain/Entities/Branch.cs index 248f1a6b..d47adb88 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Branch.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Branch.cs @@ -10,11 +10,12 @@ public class Branch : FullAuditedEntity public string Name { get; set; } public long VknTckn { get; set; } public string TaxOffice { get; set; } - public string Address { get; set; } - public string Address2 { get; set; } - public string District { get; set; } public string Country { get; set; } public string City { get; set; } + public string District { get; set; } + public string Street { get; set; } + public string Address { get; set; } + public string Address2 { get; set; } public string PostalCode { get; set; } public long? Phone { get; set; } public long Mobile { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Extensions/AbpTenantExtensions.cs b/api/src/Kurs.Platform.Domain/Extensions/AbpTenantExtensions.cs index 27d6ccc2..8265fb44 100644 --- a/api/src/Kurs.Platform.Domain/Extensions/AbpTenantExtensions.cs +++ b/api/src/Kurs.Platform.Domain/Extensions/AbpTenantExtensions.cs @@ -52,6 +52,40 @@ public static class AbpTenantExtensions return tenant.GetProperty(PlatformConsts.Tenants.TaxOffice); } + public static void SetCountry(this Tenant tenant, string country) + { + tenant.SetProperty(PlatformConsts.Tenants.Country, country); + } + public static string GetCountry(this Tenant tenant) + { + return tenant.GetProperty(PlatformConsts.Tenants.Country); + } + + public static void SetCity(this Tenant tenant, string city) + { + tenant.SetProperty(PlatformConsts.Tenants.City, city); + } + public static string GetCity(this Tenant tenant) + { + return tenant.GetProperty(PlatformConsts.Tenants.City); + } + public static void SetDistrict(this Tenant tenant, string district) + { + tenant.SetProperty(PlatformConsts.Tenants.District, district); + } + public static string GetDistrict(this Tenant tenant) + { + return tenant.GetProperty(PlatformConsts.Tenants.District); + } + public static void SetStreet(this Tenant tenant, string street) + { + tenant.SetProperty(PlatformConsts.Tenants.Street, street); + } + public static string GetStreet(this Tenant tenant) + { + return tenant.GetProperty(PlatformConsts.Tenants.Street); + } + public static void SetAddress(this Tenant tenant, string address) { tenant.SetProperty(PlatformConsts.Tenants.Address, address); @@ -69,35 +103,7 @@ public static class AbpTenantExtensions { return tenant.GetProperty(PlatformConsts.Tenants.Address2); } - - public static void SetDistrict(this Tenant tenant, string district) - { - tenant.SetProperty(PlatformConsts.Tenants.District, district); - } - public static string GetDistrict(this Tenant tenant) - { - return tenant.GetProperty(PlatformConsts.Tenants.District); - } - - public static void SetCity(this Tenant tenant, string city) - { - tenant.SetProperty(PlatformConsts.Tenants.City, city); - } - public static string GetCity(this Tenant tenant) - { - return tenant.GetProperty(PlatformConsts.Tenants.City); - } - - public static void SetCountry(this Tenant tenant, string country) - { - tenant.SetProperty(PlatformConsts.Tenants.Country, country); - } - public static string GetCountry(this Tenant tenant) - { - return tenant.GetProperty(PlatformConsts.Tenants.Country); - } - - public static void SetPostalCode(this Tenant tenant, string postalCode) + public static void SetPostalCode(this Tenant tenant, string postalCode) { tenant.SetProperty(PlatformConsts.Tenants.PostalCode, postalCode); } diff --git a/api/src/Kurs.Platform.Domain/Tenants/TenantConnectionStringEventHandler.cs b/api/src/Kurs.Platform.Domain/Tenants/TenantConnectionStringEventHandler.cs index 54a804c8..8260b104 100644 --- a/api/src/Kurs.Platform.Domain/Tenants/TenantConnectionStringEventHandler.cs +++ b/api/src/Kurs.Platform.Domain/Tenants/TenantConnectionStringEventHandler.cs @@ -7,7 +7,6 @@ using Volo.Abp.Domain.Entities.Events; using Volo.Abp.Domain.Repositories; using Volo.Abp.EventBus; using Volo.Abp.TenantManagement; -using static Kurs.Settings.SettingsConsts; namespace Kurs.Platform.Tenants; diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEfCoreEntityExtensionMappings.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEfCoreEntityExtensionMappings.cs index 5ff25362..1774d0c4 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEfCoreEntityExtensionMappings.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformEfCoreEntityExtensionMappings.cs @@ -91,24 +91,6 @@ public static class PlatformEfCoreEntityExtensionMappings } ); - ObjectExtensionManager.Instance - .MapEfCoreProperty( - PlatformConsts.Tenants.Address, - (entityBuilder, propertyBuilder) => - { - propertyBuilder.HasMaxLength(256).HasDefaultValue(null); - } - ); - - ObjectExtensionManager.Instance - .MapEfCoreProperty( - PlatformConsts.Tenants.Address2, - (entityBuilder, propertyBuilder) => - { - propertyBuilder.HasMaxLength(256).HasDefaultValue(null); - } - ); - ObjectExtensionManager.Instance .MapEfCoreProperty( PlatformConsts.Tenants.Country, @@ -136,6 +118,33 @@ public static class PlatformEfCoreEntityExtensionMappings } ); + ObjectExtensionManager.Instance + .MapEfCoreProperty( + PlatformConsts.Tenants.Street, + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(128).HasDefaultValue(null); + } + ); + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + PlatformConsts.Tenants.Address, + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(256).HasDefaultValue(null); + } + ); + + ObjectExtensionManager.Instance + .MapEfCoreProperty( + PlatformConsts.Tenants.Address2, + (entityBuilder, propertyBuilder) => + { + propertyBuilder.HasMaxLength(256).HasDefaultValue(null); + } + ); + ObjectExtensionManager.Instance .MapEfCoreProperty( PlatformConsts.Tenants.PostalCode, diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819080748_Districs.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819182323_Districts.Designer.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819080748_Districs.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819182323_Districts.Designer.cs index 56227e42..697d55cf 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819080748_Districs.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819182323_Districts.Designer.cs @@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20250819080748_Districs")] - partial class Districs + [Migration("20250819182323_Districts")] + partial class Districts { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -1276,6 +1276,9 @@ namespace Kurs.Platform.Migrations b.Property("PostalCode") .HasColumnType("nvarchar(max)"); + b.Property("Street") + .HasColumnType("nvarchar(max)"); + b.Property("TaxOffice") .HasColumnType("nvarchar(max)"); @@ -2182,11 +2185,9 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.HasIndex("CountryCode", "CityCode"); - - b.HasIndex("CityCode", "Name", "Township", "Street", "ZipCode") + b.HasIndex("CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode") .IsUnique() - .HasFilter("[Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); + .HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); b.ToTable("PDistrict", (string)null); }); @@ -6056,6 +6057,10 @@ namespace Kurs.Platform.Migrations .HasMaxLength(10) .HasColumnType("nvarchar(10)"); + b.Property("Street") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + b.Property("TaxOffice") .HasMaxLength(64) .HasColumnType("nvarchar(64)"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819080748_Districs.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819182323_Districts.cs similarity index 88% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819080748_Districs.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819182323_Districts.cs index cdfe8897..268fc51c 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819080748_Districs.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250819182323_Districts.cs @@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace Kurs.Platform.Migrations { /// - public partial class Districs : Migration + public partial class Districts : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) @@ -82,6 +82,19 @@ namespace Kurs.Platform.Migrations maxLength: 20, nullable: true); + migrationBuilder.AddColumn( + name: "Street", + table: "PBranch", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Street", + table: "AbpTenants", + type: "nvarchar(128)", + maxLength: 128, + nullable: true); + migrationBuilder.AddUniqueConstraint( name: "AK_PCity_CountryCode_Code", table: "PCity", @@ -124,16 +137,11 @@ namespace Kurs.Platform.Migrations unique: true); migrationBuilder.CreateIndex( - name: "IX_PDistrict_CityCode_Name_Township_Street_ZipCode", + name: "IX_PDistrict_CountryCode_CityCode_Name_Township_Street_ZipCode", table: "PDistrict", - columns: new[] { "CityCode", "Name", "Township", "Street", "ZipCode" }, + columns: new[] { "CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode" }, unique: true, - filter: "[Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_PDistrict_CountryCode_CityCode", - table: "PDistrict", - columns: new[] { "CountryCode", "CityCode" }); + filter: "[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); } /// @@ -154,6 +162,14 @@ namespace Kurs.Platform.Migrations name: "PlateCode", table: "PCity"); + migrationBuilder.DropColumn( + name: "Street", + table: "PBranch"); + + migrationBuilder.DropColumn( + name: "Street", + table: "AbpTenants"); + migrationBuilder.AlterColumn( name: "Phone", table: "PDemo", diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index e5c6d41e..3d7a5400 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -1273,6 +1273,9 @@ namespace Kurs.Platform.Migrations b.Property("PostalCode") .HasColumnType("nvarchar(max)"); + b.Property("Street") + .HasColumnType("nvarchar(max)"); + b.Property("TaxOffice") .HasColumnType("nvarchar(max)"); @@ -2179,11 +2182,9 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.HasIndex("CountryCode", "CityCode"); - - b.HasIndex("CityCode", "Name", "Township", "Street", "ZipCode") + b.HasIndex("CountryCode", "CityCode", "Name", "Township", "Street", "ZipCode") .IsUnique() - .HasFilter("[Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); + .HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL"); b.ToTable("PDistrict", (string)null); }); @@ -6053,6 +6054,10 @@ namespace Kurs.Platform.Migrations .HasMaxLength(10) .HasColumnType("nvarchar(10)"); + b.Property("Street") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + b.Property("TaxOffice") .HasMaxLength(64) .HasColumnType("nvarchar(64)"); diff --git a/ui/dev-dist/sw.js b/ui/dev-dist/sw.js index d0529cc5..82ac9c87 100644 --- a/ui/dev-dist/sw.js +++ b/ui/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.8rvvf2rf6hg" + "revision": "0.vah6gtb83uo" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/ui/src/main.tsx b/ui/src/main.tsx index 9402fb16..0249132e 100644 --- a/ui/src/main.tsx +++ b/ui/src/main.tsx @@ -5,11 +5,11 @@ import './index.css' import { UiEvalService } from './services/UiEvalService' import 'devextreme-react/text-area' import 'devextreme-react/html-editor' -import config from 'devextreme/core/config' -import { licenseKey } from './devextreme-license' +// import config from 'devextreme/core/config' +// import { licenseKey } from './devextreme-license' -// Lisansı uygulama başlamadan önce kaydediyoruz -config({ licenseKey }) +// // Lisansı uygulama başlamadan önce kaydediyoruz +// config({ licenseKey }) ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render()