Compare commits

..

80 commits
1.0.34 ... main

Author SHA1 Message Date
Sedat Öztürk
9b2c1c25ee Sql Query Manager düzenlemesi 2025-12-06 15:09:54 +03:00
Sedat Öztürk
4a7f2ee853 Sql Query Manager düzenlemesi 2025-12-06 14:15:32 +03:00
Sedat Öztürk
27c298c245 Listform genel düzenelemeler seeder 2025-12-06 13:51:34 +03:00
Sedat Öztürk
7bd6216515 Sql Query Manager Tenant kontrolü 2025-12-06 13:10:39 +03:00
Sedat Öztürk
9938acb94c Erp.SqlQueryManager için Dockerfile 2025-12-06 12:04:44 +03:00
Sedat Öztürk
81abe549cf Sql Query Manager yapılandırıldı. 2025-12-06 01:38:21 +03:00
Sedat ÖZTÜRK
932ee406b1 Sql Object AppServis başlığında tüm appservisler birleştirildi. 2025-12-05 17:56:39 +03:00
Sedat ÖZTÜRK
cb2e007302 Table Valued Function eklendi 2025-12-05 16:48:32 +03:00
Sedat ÖZTÜRK
b9331e66b4 Sql Query Manager düzenlemesi 2025-12-05 16:45:45 +03:00
Sedat ÖZTÜRK
3d419a6e7c Sql Query Manager 2025-12-05 11:56:53 +03:00
Sedat Öztürk
9bbf66e94d Store Seeder MovementItem ve Inventory 2025-12-04 23:30:15 +03:00
Sedat Öztürk
a3ec85aed0 Crm Seeder 2025-12-04 20:42:47 +03:00
Sedat ÖZTÜRK
1c5ff7bdd5 SalesOrders Seeder düzenlemesi 2025-12-04 17:52:09 +03:00
Sedat ÖZTÜRK
4a1eb264b1 Genel Seeder düzenlemesi 2025-12-04 15:39:07 +03:00
Sedat ÖZTÜRK
8f14f259ca ListFormSeeder SupplyChain 2025-12-04 15:27:15 +03:00
Sedat ÖZTÜRK
8e86f6fb83 SchedulerView Seeder düzenlemesi 2025-12-04 10:59:26 +03:00
Sedat ÖZTÜRK
32720abac2 SchedulerView mode ve tabbed style düzenlemesi 2025-12-04 10:33:27 +03:00
Sedat Öztürk
cbfb5ccef6 Scheduler lookup çağrısını teke düşürdük 2025-12-04 02:16:30 +03:00
Sedat Öztürk
149f28bda6 Scheduler Appointment View Group düzeldi. 2025-12-04 01:45:18 +03:00
Sedat Öztürk
98d748c398 Scheduler Appointment FormView düzenlemesi 2025-12-04 01:29:25 +03:00
Sedat Öztürk
36907db226 Seeder düzenlemeleri 2025-12-04 00:01:00 +03:00
Sedat ÖZTÜRK
ddc8054bb4 AiBot ListformSeeder 2025-12-03 17:52:02 +03:00
Sedat ÖZTÜRK
0f790b1183 SubForms için Gantt ve Scheduler eklendi 2025-12-03 09:30:24 +03:00
Sedat Öztürk
63185d7b22 List için buton düzenlemesi 2025-12-03 00:07:31 +03:00
Sedat Öztürk
0420f1a3e5 Gantt ve Scheduler için AllowAdding vs... 2025-12-02 23:54:56 +03:00
Sedat Öztürk
aa3a3c7684 Gantt ve Scheduler düzenlemeleri 2025-12-02 23:20:47 +03:00
Sedat Öztürk
9055657ef2 Scheduler View 2025-12-02 22:58:31 +03:00
Sedat ÖZTÜRK
f5315a4aca Scheduler 2025-12-02 21:15:09 +03:00
Sedat ÖZTÜRK
712918121e Maintenance Planning Wizard güncellemesi 2025-12-02 16:24:46 +03:00
Sedat ÖZTÜRK
483a249428 Maintenance Plan -> Plan 2025-12-02 16:03:18 +03:00
Sedat ÖZTÜRK
f17d1da1bd Genel düzenlemeler 2025-12-02 15:35:08 +03:00
Sedat ÖZTÜRK
260784d016 Gantt içerisine ScaleType ve Seeder düzenlemeleri 2025-12-02 13:20:22 +03:00
Sedat ÖZTÜRK
0681eb9479 Tree ile Gantt birbirinden ayrıldı 2025-12-02 12:56:11 +03:00
Sedat ÖZTÜRK
5a4244dee3 Gantt düzenlemesi 2 2025-12-02 12:28:54 +03:00
Sedat Öztürk
7cf448ec13 Gantt düzenlemesi 2025-12-02 01:05:05 +03:00
Sedat ÖZTÜRK
3e588fb98b Gantt Layout 2025-12-01 17:45:23 +03:00
Sedat ÖZTÜRK
f18818d16a ListForm daki Color seçenekli sütunlar 2025-12-01 15:06:59 +03:00
Sedat ÖZTÜRK
5f5bf81a6b Crm Activity 2025-12-01 14:17:41 +03:00
Sedat ÖZTÜRK
4c95b52ea8 Quotations düzenlemesi 2025-12-01 13:56:58 +03:00
Sedat ÖZTÜRK
d1157953a8 Quotation Entity 2025-12-01 10:31:38 +03:00
Sedat Öztürk
55aaad3d31 Chart düzenlemesi 2025-12-01 01:45:43 +03:00
Sedat Öztürk
ee0b8d8421 Card ve CardItem güncellemesi 2025-11-30 20:15:04 +03:00
Sedat Öztürk
16c187489c Card ve CardItem güncellemeleri 2025-11-30 19:56:36 +03:00
Sedat Öztürk
2e1dc8db3a CardListView ve css düzenlemesi 2025-11-30 19:01:35 +03:00
Sedat Öztürk
0d69ae05ce Menu seeder düzenlemesi 2025-11-29 20:59:46 +03:00
Sedat ÖZTÜRK
df158a0d8e Menu Definitions 2025-11-28 17:34:02 +03:00
Sedat ÖZTÜRK
d176565887 Devexpress 25.1.7 versiyonuna convert edildi. 2025-11-28 16:31:53 +03:00
Sedat ÖZTÜRK
6b4e64c3ca Devexpress 25.1 versiyon güncellemesi 2025-11-28 10:50:01 +03:00
Sedat ÖZTÜRK
3437ec9ad9 Seeder düzenlemesi 2025-11-28 10:49:37 +03:00
Sedat Öztürk
43a8e20eb0 Project Daily Activities 2025-11-28 01:00:37 +03:00
Sedat Öztürk
ba78863509 Project Tasks 2025-11-28 00:00:02 +03:00
Sedat ÖZTÜRK
8c5a141c8e Project Task Type 2025-11-27 14:34:57 +03:00
Sedat ÖZTÜRK
b11b5f2185 Proje Task 2025-11-27 14:06:36 +03:00
Sedat ÖZTÜRK
58ab8661fb Project Task güncellemesi 2025-11-27 11:49:09 +03:00
Sedat ÖZTÜRK
43875b9af8 Project List 2025-11-27 09:34:20 +03:00
Sedat Öztürk
fc124830f4 Projects Type ve Status 2025-11-27 00:17:01 +03:00
Sedat Öztürk
0058a0180c UomId ve BankId düzenlemeleri 2025-11-26 22:39:01 +03:00
Sedat ÖZTÜRK
5c7793c86e Bom, BomComponent ve BomOperation 2025-11-26 17:58:25 +03:00
Sedat ÖZTÜRK
6eb18fbdda Mrp Bom, BomType, BomOperation, BomComponent 2025-11-26 16:58:31 +03:00
Sedat ÖZTÜRK
e664ad4ccc Mrp Workcenter güncellemeleri 2025-11-26 14:04:31 +03:00
Sedat ÖZTÜRK
c437f4cf75 Mrp Operation Category, Operation Type ve Operation 2025-11-26 11:24:11 +03:00
Sedat Öztürk
5e16262371 Accounting 2025-11-25 22:55:52 +03:00
Sedat ÖZTÜRK
3ba59ee870 Yerleşim Kuralları tanımlamaları 2025-11-25 15:35:29 +03:00
Sedat ÖZTÜRK
b503b74e02 Warehouse, Zorn ve Location listeleri 2025-11-25 12:31:46 +03:00
Sedat Öztürk
ff49904bb0 Store düzenlemeleri 2025-11-24 23:50:53 +03:00
Sedat Öztürk
6cf82fa913 CurrencyId kaldırıldı yerine Currency eklendi 2025-11-24 22:04:43 +03:00
Sedat ÖZTÜRK
cd896e2e9f ListFormSeeder düzenlemeleri 2025-11-24 17:12:56 +03:00
Sedat ÖZTÜRK
a9a137a08c SubForm List Form Title 2025-11-24 10:04:10 +03:00
Sedat Öztürk
6e6599ba15 Listform kodları düzeltildi 2025-11-23 23:30:16 +03:00
Sedat Öztürk
8bb9d8ed87 Maintenance Workorder Type, Status
ListFormSeeder
2025-11-23 21:41:52 +03:00
Sedat ÖZTÜRK
abd7dd05fd Grid CommandColumn IsVisible ve Visible Expression 2025-11-21 17:34:41 +03:00
Sedat ÖZTÜRK
1745707691 Maintenance Fault 2025-11-21 11:31:59 +03:00
Sedat Öztürk
540668b1c0 dockerfile ve abpconfig 2025-11-21 00:03:24 +03:00
Sedat Öztürk
279d285f76 Maintenance Plan, Employee, Material 2025-11-20 23:30:49 +03:00
Sedat ÖZTÜRK
a3c307c72a Maintenance.Plan 2025-11-20 17:55:13 +03:00
Sedat ÖZTÜRK
c32a00f156 Mahalle bilgisi kaldırıldı 2025-11-20 10:07:31 +03:00
Sedat ÖZTÜRK
8b44d15cbd Ana Sayfa Seeder düzenlemesi 2025-11-19 11:44:41 +03:00
Sedat Öztürk
8ff6234165 Maintenance Workcenters +++ 2025-11-18 23:42:48 +03:00
Sedat Öztürk
847150aaea Ana sayfa düzenlemesi 2025-11-18 21:33:50 +03:00
Sedat ÖZTÜRK
32530c72c0 ListFormSeeder dateBox FormatEditors 2025-11-18 16:02:01 +03:00
437 changed files with 70105 additions and 1519695 deletions

View file

@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"volo.abp.cli": {
"version": "9.0.2",
"commands": [
"abp"
]
}
}
}

View file

@ -16,6 +16,10 @@ COPY "modules/Erp.Settings/Erp.Settings.Application.Contracts/Erp.Settings.Appli
COPY "modules/Erp.Settings/Erp.Settings.Domain/Erp.Settings.Domain.csproj" "modules/Erp.Settings/Erp.Settings.Domain/"
COPY "modules/Erp.Settings/Erp.Settings.Domain.Shared/Erp.Settings.Domain.Shared.csproj" "modules/Erp.Settings/Erp.Settings.Domain.Shared/"
COPY "modules/Erp.Settings/Erp.Settings.EntityFrameworkCore/Erp.Settings.EntityFrameworkCore.csproj" "modules/Erp.Settings/Erp.Settings.EntityFrameworkCore/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Application.Contracts/Erp.SqlQueryManager.Application.Contracts.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Application.Contracts/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain/Erp.SqlQueryManager.Domain.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain.Shared/Erp.SqlQueryManager.Domain.Shared.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain.Shared/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/Erp.SqlQueryManager.EntityFrameworkCore.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/"
COPY "src/Erp.Platform.Application.Contracts/Erp.Platform.Application.Contracts.csproj" "src/Erp.Platform.Application.Contracts/"
COPY "src/Erp.Platform.DbMigrator/Erp.Platform.DbMigrator.csproj" "src/Erp.Platform.DbMigrator/"
COPY "src/Erp.Platform.Domain/Erp.Platform.Domain.csproj" "src/Erp.Platform.Domain/"

View file

@ -4,13 +4,14 @@ WORKDIR /app
RUN apk update && apk upgrade
RUN apk add nodejs~=22 npm~=11
RUN dotnet tool install -g Volo.Abp.Cli
ENV PATH="/root/.dotnet/tools:${PATH}"
COPY .config/dotnet-tools.json .config/dotnet-tools.json
RUN dotnet tool restore
ENV PATH="/root/.dotnet/tools:/app/.config/dotnet/tools:${PATH}"
COPY "src/Erp.Platform.HttpApi.Host/Erp.Platform.HttpApi.Host.csproj" "src/Erp.Platform.HttpApi.Host/"
COPY "src/Erp.Platform.HttpApi.Host/package.json" "src/Erp.Platform.HttpApi.Host/"
COPY "src/Erp.Platform.HttpApi.Host/package-lock.json" "src/Erp.Platform.HttpApi.Host/"
WORKDIR /app/src/Erp.Platform.HttpApi.Host
RUN abp install-libs
RUN dotnet tool run abp install-libs
WORKDIR /app
COPY "modules/Erp.Languages/Erp.Languages.Application/Erp.Languages.Application.csproj" "modules/Erp.Languages/Erp.Languages.Application/"
@ -30,6 +31,11 @@ COPY "modules/Erp.Settings/Erp.Settings.Application.Contracts/Erp.Settings.Appli
COPY "modules/Erp.Settings/Erp.Settings.Domain/Erp.Settings.Domain.csproj" "modules/Erp.Settings/Erp.Settings.Domain/"
COPY "modules/Erp.Settings/Erp.Settings.Domain.Shared/Erp.Settings.Domain.Shared.csproj" "modules/Erp.Settings/Erp.Settings.Domain.Shared/"
COPY "modules/Erp.Settings/Erp.Settings.EntityFrameworkCore/Erp.Settings.EntityFrameworkCore.csproj" "modules/Erp.Settings/Erp.Settings.EntityFrameworkCore/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Application/Erp.SqlQueryManager.Application.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Application/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Application.Contracts/Erp.SqlQueryManager.Application.Contracts.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Application.Contracts/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain/Erp.SqlQueryManager.Domain.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain.Shared/Erp.SqlQueryManager.Domain.Shared.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.Domain.Shared/"
COPY "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/Erp.SqlQueryManager.EntityFrameworkCore.csproj" "modules/Erp.SqlQueryManager/Erp.SqlQueryManager.EntityFrameworkCore/"
COPY "src/Erp.Platform.Application/Erp.Platform.Application.csproj" "src/Erp.Platform.Application/"
COPY "src/Erp.Platform.Application.Contracts/Erp.Platform.Application.Contracts.csproj" "src/Erp.Platform.Application.Contracts/"
COPY "src/Erp.Platform.Domain/Erp.Platform.Domain.csproj" "src/Erp.Platform.Domain/"
@ -73,5 +79,3 @@ EXPOSE 443
WORKDIR /srv/app
COPY --from=build /app/publish .
ENTRYPOINT ["./Erp.Platform.HttpApi.Host"]

View file

@ -80,6 +80,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Erp.SqlQueryManager", "Erp.SqlQueryManager", "{2889482E-64CA-4A25-91D8-5B963D83681B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.SqlQueryManager.Domain.Shared", "modules\Erp.SqlQueryManager\Erp.SqlQueryManager.Domain.Shared\Erp.SqlQueryManager.Domain.Shared.csproj", "{10D71F44-C9FD-41F2-8F1A-D93FAE3CE696}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.SqlQueryManager.Domain", "modules\Erp.SqlQueryManager\Erp.SqlQueryManager.Domain\Erp.SqlQueryManager.Domain.csproj", "{8730045F-91F5-4438-8772-C6E31E89AACC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.SqlQueryManager.Application.Contracts", "modules\Erp.SqlQueryManager\Erp.SqlQueryManager.Application.Contracts\Erp.SqlQueryManager.Application.Contracts.csproj", "{B45A3E8B-286B-4A74-9602-FC192ACEE8C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.SqlQueryManager.Application", "modules\Erp.SqlQueryManager\Erp.SqlQueryManager.Application\Erp.SqlQueryManager.Application.csproj", "{ED9C639A-A706-4ECB-9638-A15B3681BDEC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erp.SqlQueryManager.EntityFrameworkCore", "modules\Erp.SqlQueryManager\Erp.SqlQueryManager.EntityFrameworkCore\Erp.SqlQueryManager.EntityFrameworkCore.csproj", "{1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -198,6 +210,26 @@ Global
{D9E0D333-60F3-493F-A5B2-5758ACA42A17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9E0D333-60F3-493F-A5B2-5758ACA42A17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9E0D333-60F3-493F-A5B2-5758ACA42A17}.Release|Any CPU.Build.0 = Release|Any CPU
{10D71F44-C9FD-41F2-8F1A-D93FAE3CE696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{10D71F44-C9FD-41F2-8F1A-D93FAE3CE696}.Debug|Any CPU.Build.0 = Debug|Any CPU
{10D71F44-C9FD-41F2-8F1A-D93FAE3CE696}.Release|Any CPU.ActiveCfg = Release|Any CPU
{10D71F44-C9FD-41F2-8F1A-D93FAE3CE696}.Release|Any CPU.Build.0 = Release|Any CPU
{8730045F-91F5-4438-8772-C6E31E89AACC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8730045F-91F5-4438-8772-C6E31E89AACC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8730045F-91F5-4438-8772-C6E31E89AACC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8730045F-91F5-4438-8772-C6E31E89AACC}.Release|Any CPU.Build.0 = Release|Any CPU
{B45A3E8B-286B-4A74-9602-FC192ACEE8C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B45A3E8B-286B-4A74-9602-FC192ACEE8C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B45A3E8B-286B-4A74-9602-FC192ACEE8C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B45A3E8B-286B-4A74-9602-FC192ACEE8C4}.Release|Any CPU.Build.0 = Release|Any CPU
{ED9C639A-A706-4ECB-9638-A15B3681BDEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED9C639A-A706-4ECB-9638-A15B3681BDEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED9C639A-A706-4ECB-9638-A15B3681BDEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED9C639A-A706-4ECB-9638-A15B3681BDEC}.Release|Any CPU.Build.0 = Release|Any CPU
{1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -236,10 +268,14 @@ Global
{631092C7-B59D-4EA7-92D0-5E181AB4F9F6} = {41A473FE-2537-4223-8CF3-A4A2A4A4F41E}
{23659070-58F7-403B-8973-B2E20B5E9BE1} = {41A473FE-2537-4223-8CF3-A4A2A4A4F41E}
{D9E0D333-60F3-493F-A5B2-5758ACA42A17} = {41A473FE-2537-4223-8CF3-A4A2A4A4F41E}
{2889482E-64CA-4A25-91D8-5B963D83681B} = {03E1C8DA-035E-4882-AF81-F392139FCF38}
{10D71F44-C9FD-41F2-8F1A-D93FAE3CE696} = {2889482E-64CA-4A25-91D8-5B963D83681B}
{8730045F-91F5-4438-8772-C6E31E89AACC} = {2889482E-64CA-4A25-91D8-5B963D83681B}
{B45A3E8B-286B-4A74-9602-FC192ACEE8C4} = {2889482E-64CA-4A25-91D8-5B963D83681B}
{ED9C639A-A706-4ECB-9638-A15B3681BDEC} = {2889482E-64CA-4A25-91D8-5B963D83681B}
{1DA666D8-DBFE-40F7-8EBF-95CC892E4EB6} = {2889482E-64CA-4A25-91D8-5B963D83681B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,16 @@
namespace Erp.SqlQueryManager.Application.Contracts;
public class DatabaseTableDto
{
public string SchemaName { get; set; }
public string TableName { get; set; }
public string FullName => $"{SchemaName}.{TableName}";
}
public class DatabaseColumnDto
{
public string ColumnName { get; set; }
public string DataType { get; set; }
public bool IsNullable { get; set; }
public int? MaxLength { get; set; }
}

View file

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Erp.SqlQueryManager</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="9.0.2" />
<PackageReference Include="Volo.Abp.Authorization" Version="9.0.2" />
<ProjectReference Include="..\Erp.SqlQueryManager.Domain.Shared\Erp.SqlQueryManager.Domain.Shared.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

View file

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
namespace Erp.SqlQueryManager.Application.Contracts;
/// <summary>
/// Unified service for SQL Object Explorer and CRUD operations
/// </summary>
public interface ISqlObjectManagerAppService : IApplicationService
{
/// <summary>
/// Get all SQL objects for Object Explorer (Queries, SPs, Views, Functions, Tables, Templates)
/// </summary>
/// <param name="dataSourceCode">Data source code to filter objects</param>
/// <returns>Combined response with all object types</returns>
Task<SqlObjectExplorerDto> GetAllObjectsAsync(string dataSourceCode);
// Query Operations
Task<SqlQueryDto> CreateQueryAsync(CreateSqlQueryDto input);
Task<SqlQueryDto> UpdateQueryAsync(Guid id, UpdateSqlQueryDto input);
Task DeleteQueryAsync(Guid id);
Task<SqlQueryExecutionResultDto> ExecuteQueryAsync(ExecuteSqlQueryDto input);
Task<SqlQueryExecutionResultDto> ExecuteSavedQueryAsync(Guid id);
// Stored Procedure Operations
Task<SqlStoredProcedureDto> UpdateStoredProcedureAsync(Guid id, UpdateSqlStoredProcedureDto input);
Task DeleteStoredProcedureAsync(Guid id);
Task<SqlQueryExecutionResultDto> DeployStoredProcedureAsync(DeployStoredProcedureDto input);
// View Operations
Task<SqlViewDto> UpdateViewAsync(Guid id, UpdateSqlViewDto input);
Task DeleteViewAsync(Guid id);
Task<SqlQueryExecutionResultDto> DeployViewAsync(DeployViewDto input);
// Function Operations
Task<SqlFunctionDto> UpdateFunctionAsync(Guid id, UpdateSqlFunctionDto input);
Task DeleteFunctionAsync(Guid id);
Task<SqlQueryExecutionResultDto> DeployFunctionAsync(DeployFunctionDto input);
// Database Metadata Operations
Task<List<DatabaseColumnDto>> GetTableColumnsAsync(string dataSourceCode, string schemaName, string tableName);
/// <summary>
/// Gets the SQL definition/body of a native SQL Server object (Stored Procedure, View, or Function)
/// </summary>
Task<string> GetNativeObjectDefinitionAsync(string dataSourceCode, string schemaName, string objectName);
// Smart Save - Analyzes SQL and saves to appropriate table with auto-deploy
Task<SmartSaveResultDto> SmartSaveAsync(SmartSaveInputDto input);
}

View file

@ -0,0 +1,25 @@
using System;
namespace Erp.SqlQueryManager.Application.Contracts;
/// <summary>
/// Input for smart save operation
/// </summary>
public class SmartSaveInputDto
{
public string SqlText { get; set; }
public string DataSourceCode { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
/// <summary>
/// Result of smart save operation
/// </summary>
public class SmartSaveResultDto
{
public string ObjectType { get; set; }
public Guid ObjectId { get; set; }
public bool Deployed { get; set; }
public string Message { get; set; }
}

View file

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Application.Dtos;
namespace Erp.SqlQueryManager.Application.Contracts;
public class SqlFunctionDto : FullAuditedEntityDto<Guid>
{
public string FunctionName { get; set; }
public string SchemaName { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public SqlFunctionType FunctionType { get; set; }
public string FunctionBody { get; set; }
public string ReturnType { get; set; }
public string DataSourceCode { get; set; }
public SqlQueryStatus Status { get; set; }
public string Category { get; set; }
public bool IsDeployed { get; set; }
public DateTime? LastDeployedAt { get; set; }
public string Parameters { get; set; }
public bool IsCustom { get; set; } // true = stored in database, false = native SQL Server object
}
public class CreateSqlFunctionDto
{
public string FunctionName { get; set; }
public string SchemaName { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public SqlFunctionType FunctionType { get; set; }
public string FunctionBody { get; set; }
public string ReturnType { get; set; }
public string DataSourceCode { get; set; }
public string Category { get; set; }
public string Parameters { get; set; }
}
public class UpdateSqlFunctionDto
{
public string DisplayName { get; set; }
public string Description { get; set; }
public string FunctionBody { get; set; }
public string ReturnType { get; set; }
public string Category { get; set; }
public string Parameters { get; set; }
}
public class DeployFunctionDto
{
public Guid Id { get; set; }
public bool DropIfExists { get; set; }
}

View file

@ -0,0 +1,39 @@
using System.Collections.Generic;
namespace Erp.SqlQueryManager.Application.Contracts;
/// <summary>
/// Combined DTO for Object Explorer containing all SQL objects
/// </summary>
public class SqlObjectExplorerDto
{
/// <summary>
/// SQL Queries
/// </summary>
public List<SqlQueryDto> Queries { get; set; } = new();
/// <summary>
/// Stored Procedures
/// </summary>
public List<SqlStoredProcedureDto> StoredProcedures { get; set; } = new();
/// <summary>
/// Views
/// </summary>
public List<SqlViewDto> Views { get; set; } = new();
/// <summary>
/// Functions
/// </summary>
public List<SqlFunctionDto> Functions { get; set; } = new();
/// <summary>
/// Database Tables
/// </summary>
public List<DatabaseTableDto> Tables { get; set; } = new();
/// <summary>
/// Query Templates
/// </summary>
public List<SqlTemplateDto> Templates { get; set; } = new();
}

View file

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Application.Dtos;
namespace Erp.SqlQueryManager.Application.Contracts;
public class SqlQueryDto : FullAuditedEntityDto<Guid>
{
public string Code { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string QueryText { get; set; }
public string DataSourceCode { get; set; }
public SqlQueryStatus Status { get; set; }
public string Category { get; set; }
public string Tags { get; set; }
public DateTime? LastExecutedAt { get; set; }
public int ExecutionCount { get; set; }
public bool IsModifyingData { get; set; }
public string Parameters { get; set; }
}
public class CreateSqlQueryDto
{
public string Code { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string QueryText { get; set; }
public string DataSourceCode { get; set; }
public string Category { get; set; }
public string Tags { get; set; }
public bool IsModifyingData { get; set; }
public string Parameters { get; set; }
}
public class UpdateSqlQueryDto
{
public string Code { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string QueryText { get; set; }
public string DataSourceCode { get; set; }
public string Category { get; set; }
public string Tags { get; set; }
public bool IsModifyingData { get; set; }
public string Parameters { get; set; }
}
public class ExecuteSqlQueryDto
{
public string QueryText { get; set; }
public string DataSourceCode { get; set; }
public Dictionary<string, object> Parameters { get; set; }
}
public class SqlQueryExecutionResultDto
{
public bool Success { get; set; }
public string Message { get; set; }
public IEnumerable<dynamic> Data { get; set; }
public int RowsAffected { get; set; }
public long ExecutionTimeMs { get; set; }
public Dictionary<string, object> Metadata { get; set; }
}

View file

@ -0,0 +1,14 @@
using Volo.Abp.Application;
using Volo.Abp.Authorization;
using Volo.Abp.Modularity;
namespace Erp.SqlQueryManager;
[DependsOn(
typeof(SqlQueryManagerDomainSharedModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpAuthorizationModule)
)]
public class SqlQueryManagerApplicationContractsModule : AbpModule
{
}

View file

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Application.Dtos;
namespace Erp.SqlQueryManager.Application.Contracts;
public class SqlStoredProcedureDto : FullAuditedEntityDto<Guid>
{
public string ProcedureName { get; set; }
public string SchemaName { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public string ProcedureBody { get; set; }
public string DataSourceCode { get; set; }
public SqlQueryStatus Status { get; set; }
public string Category { get; set; }
public bool IsDeployed { get; set; }
public DateTime? LastDeployedAt { get; set; }
public string Parameters { get; set; }
public bool IsCustom { get; set; } // true = stored in database, false = native SQL Server object
}
public class CreateSqlStoredProcedureDto
{
public string ProcedureName { get; set; }
public string SchemaName { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public string ProcedureBody { get; set; }
public string DataSourceCode { get; set; }
public string Category { get; set; }
public string Parameters { get; set; }
}
public class UpdateSqlStoredProcedureDto
{
public string DisplayName { get; set; }
public string Description { get; set; }
public string ProcedureBody { get; set; }
public string Category { get; set; }
public string Parameters { get; set; }
}
public class DeployStoredProcedureDto
{
public Guid Id { get; set; }
public bool DropIfExists { get; set; }
}

View file

@ -0,0 +1,18 @@
using System.Collections.Generic;
namespace Erp.SqlQueryManager.Application.Contracts;
public class SqlTemplateDto
{
public string Type { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Template { get; set; }
}
public class GetTemplateInput
{
public string TemplateType { get; set; }
public string ObjectName { get; set; }
public string SchemaName { get; set; }
}

View file

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Application.Dtos;
namespace Erp.SqlQueryManager.Application.Contracts;
public class SqlViewDto : FullAuditedEntityDto<Guid>
{
public string ViewName { get; set; }
public string SchemaName { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public string ViewDefinition { get; set; }
public string DataSourceCode { get; set; }
public SqlQueryStatus Status { get; set; }
public string Category { get; set; }
public bool IsDeployed { get; set; }
public DateTime? LastDeployedAt { get; set; }
public bool WithSchemaBinding { get; set; }
public bool IsCustom { get; set; } // true = stored in database, false = native SQL Server object
}
public class CreateSqlViewDto
{
public string ViewName { get; set; }
public string SchemaName { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public string ViewDefinition { get; set; }
public string DataSourceCode { get; set; }
public string Category { get; set; }
public bool WithSchemaBinding { get; set; }
}
public class UpdateSqlViewDto
{
public string DisplayName { get; set; }
public string Description { get; set; }
public string ViewDefinition { get; set; }
public string Category { get; set; }
public bool WithSchemaBinding { get; set; }
}
public class DeployViewDto
{
public Guid Id { get; set; }
public bool DropIfExists { get; set; }
}

View file

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Erp.SqlQueryManager</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="9.0.2" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="9.0.2" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="9.0.2" />
<ProjectReference Include="..\Erp.SqlQueryManager.Application.Contracts\Erp.SqlQueryManager.Application.Contracts.csproj" />
<ProjectReference Include="..\Erp.SqlQueryManager.Domain\Erp.SqlQueryManager.Domain.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

View file

@ -0,0 +1,25 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Application;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
namespace Erp.SqlQueryManager;
[DependsOn(
typeof(SqlQueryManagerDomainModule),
typeof(SqlQueryManagerApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule)
)]
public class SqlQueryManagerApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<SqlQueryManagerApplicationModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<SqlQueryManagerApplicationModule>(validate: true);
});
}
}

View file

@ -0,0 +1,88 @@
using AutoMapper;
using Erp.SqlQueryManager.Application.Contracts;
using Erp.SqlQueryManager.Domain.Entities;
using Volo.Abp.AutoMapper;
namespace Erp.SqlQueryManager.Application;
public class SqlQueryManagerAutoMapperProfile : Profile
{
public SqlQueryManagerAutoMapperProfile()
{
CreateMap<SqlQuery, SqlQueryDto>();
CreateMap<CreateSqlQueryDto, SqlQuery>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.LastExecutedAt)
.Ignore(x => x.ExecutionCount);
CreateMap<UpdateSqlQueryDto, SqlQuery>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.LastExecutedAt)
.Ignore(x => x.ExecutionCount);
CreateMap<SqlStoredProcedure, SqlStoredProcedureDto>().Ignore(x => x.IsCustom);
CreateMap<CreateSqlStoredProcedureDto, SqlStoredProcedure>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<UpdateSqlStoredProcedureDto, SqlStoredProcedure>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.ProcedureName)
.Ignore(x => x.SchemaName)
.Ignore(x => x.DataSourceCode)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<SqlView, SqlViewDto>().Ignore(x => x.IsCustom);
CreateMap<CreateSqlViewDto, SqlView>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<UpdateSqlViewDto, SqlView>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.ViewName)
.Ignore(x => x.SchemaName)
.Ignore(x => x.DataSourceCode)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<SqlFunction, SqlFunctionDto>().Ignore(x => x.IsCustom);
CreateMap<CreateSqlFunctionDto, SqlFunction>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
CreateMap<UpdateSqlFunctionDto, SqlFunction>()
.IgnoreFullAuditedObjectProperties()
.Ignore(x => x.Id)
.Ignore(x => x.TenantId)
.Ignore(x => x.FunctionName)
.Ignore(x => x.SchemaName)
.Ignore(x => x.FunctionType)
.Ignore(x => x.DataSourceCode)
.Ignore(x => x.Status)
.Ignore(x => x.IsDeployed)
.Ignore(x => x.LastDeployedAt);
}
}

View file

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<RootNamespace>Erp.SqlQueryManager</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain.Shared" Version="9.0.2" />
<PackageReference Include="Volo.Abp.Validation" Version="9.0.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\SqlQueryManager\*.json" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,8 @@
using Volo.Abp.Localization;
namespace Erp.SqlQueryManager.Domain.Shared;
[LocalizationResourceName("SqlQueryManager")]
public class ErpSqlQueryManagerResource
{
}

View file

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

View file

@ -0,0 +1,23 @@
namespace Erp.SqlQueryManager.Domain.Shared;
public enum SqlObjectType
{
Query = 1,
StoredProcedure = 2,
View = 3,
Function = 4
}
public enum SqlFunctionType
{
ScalarFunction = 1,
TableValuedFunction = 2,
InlineTableValuedFunction = 3
}
public enum SqlQueryStatus
{
Draft = 1,
Active = 2,
Archived = 3
}

View file

@ -0,0 +1,34 @@
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Domain;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.Validation;
using Volo.Abp.VirtualFileSystem;
namespace Erp.SqlQueryManager;
[DependsOn(
typeof(AbpValidationModule),
typeof(AbpDddDomainSharedModule)
)]
public class SqlQueryManagerDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<SqlQueryManagerDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources.Add<ErpSqlQueryManagerResource>("en");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("SqlQueryManager", typeof(ErpSqlQueryManagerResource));
});
}
}

View file

@ -0,0 +1,11 @@
namespace Erp.SqlQueryManager.Domain.Shared;
public static class SqlQueryManagerErrorCodes
{
public const string InvalidSqlQuery = "SqlQueryManager:InvalidSqlQuery";
public const string DataSourceNotFound = "SqlQueryManager:DataSourceNotFound";
public const string ExecutionFailed = "SqlQueryManager:ExecutionFailed";
public const string PermissionDenied = "SqlQueryManager:PermissionDenied";
public const string InvalidObjectName = "SqlQueryManager:InvalidObjectName";
public const string ObjectAlreadyExists = "SqlQueryManager:ObjectAlreadyExists";
}

View file

@ -0,0 +1,57 @@
using Volo.Abp.Reflection;
namespace Erp.SqlQueryManager.Domain.Shared;
public static class SqlQueryManagerPermissions
{
public const string GroupName = "SqlQueryManager";
public static class SqlQuery
{
public const string Default = GroupName + ".SqlQuery";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
public const string Execute = Default + ".Execute";
}
public static class SqlStoredProcedure
{
public const string Default = GroupName + ".SqlStoredProcedure";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
public const string Deploy = Default + ".Deploy";
public const string Drop = Default + ".Drop";
}
public static class SqlView
{
public const string Default = GroupName + ".SqlView";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
public const string Deploy = Default + ".Deploy";
public const string Drop = Default + ".Drop";
}
public static class SqlFunction
{
public const string Default = GroupName + ".SqlFunction";
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
public const string Deploy = Default + ".Deploy";
public const string Drop = Default + ".Drop";
}
public static class Templates
{
public const string Default = GroupName + ".Templates";
}
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(SqlQueryManagerPermissions));
}
}

View file

@ -0,0 +1,120 @@
using System;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.SqlQueryManager.Domain.Entities;
/// <summary>
/// SQL Function entity for creating and managing database functions
/// </summary>
public class SqlFunction : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
/// <summary>
/// Function name in database
/// </summary>
public string FunctionName { get; set; }
/// <summary>
/// Schema name (default: dbo)
/// </summary>
public string SchemaName { get; set; }
/// <summary>
/// Display name
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// Description
/// </summary>
public string Description { get; set; }
/// <summary>
/// Function type
/// </summary>
public SqlFunctionType FunctionType { get; set; }
/// <summary>
/// Full function definition (CREATE/ALTER)
/// </summary>
public string FunctionBody { get; set; }
/// <summary>
/// Return type definition
/// </summary>
public string ReturnType { get; set; }
/// <summary>
/// DataSource code
/// </summary>
public string DataSourceCode { get; set; }
/// <summary>
/// Status
/// </summary>
public SqlQueryStatus Status { get; set; }
/// <summary>
/// Category
/// </summary>
public string Category { get; set; }
/// <summary>
/// Whether function exists in database
/// </summary>
public bool IsDeployed { get; set; }
/// <summary>
/// Last deployment time
/// </summary>
public DateTime? LastDeployedAt { get; set; }
/// <summary>
/// Parameter definitions (JSON)
/// </summary>
public string Parameters { get; set; }
protected SqlFunction()
{
}
public SqlFunction(
Guid id,
string functionName,
string schemaName,
string displayName,
SqlFunctionType functionType,
string functionBody,
string returnType,
string dataSourceCode,
Guid? tenantId = null) : base(id)
{
FunctionName = functionName;
SchemaName = schemaName ?? "dbo";
DisplayName = displayName;
FunctionType = functionType;
FunctionBody = functionBody;
ReturnType = returnType;
DataSourceCode = dataSourceCode;
TenantId = tenantId;
Status = SqlQueryStatus.Draft;
IsDeployed = false;
}
public void UpdateBody(string body)
{
FunctionBody = body;
}
public void MarkAsDeployed()
{
IsDeployed = true;
LastDeployedAt = DateTime.UtcNow;
Status = SqlQueryStatus.Active;
}
public string GetFullName() => $"{SchemaName}.{FunctionName}";
}

View file

@ -0,0 +1,116 @@
using System;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.SqlQueryManager.Domain.Entities;
/// <summary>
/// SQL Query entity for storing and managing SQL queries
/// </summary>
public class SqlQuery : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
/// <summary>
/// Unique code for the query
/// </summary>
public string Code { get; set; }
/// <summary>
/// Display name
/// </summary>
public string Name { get; set; }
/// <summary>
/// Description of the query
/// </summary>
public string Description { get; set; }
/// <summary>
/// SQL query content
/// </summary>
public string QueryText { get; set; }
/// <summary>
/// DataSource code to use for execution
/// </summary>
public string DataSourceCode { get; set; }
/// <summary>
/// Query status
/// </summary>
public SqlQueryStatus Status { get; set; }
/// <summary>
/// Category for organization
/// </summary>
public string Category { get; set; }
/// <summary>
/// Tags for filtering
/// </summary>
public string Tags { get; set; }
/// <summary>
/// Last execution time
/// </summary>
public DateTime? LastExecutedAt { get; set; }
/// <summary>
/// Execution count
/// </summary>
public int ExecutionCount { get; set; }
/// <summary>
/// Whether query modifies data
/// </summary>
public bool IsModifyingData { get; set; }
/// <summary>
/// Expected parameter definitions (JSON format)
/// </summary>
public string Parameters { get; set; }
protected SqlQuery()
{
}
public SqlQuery(
Guid id,
string code,
string name,
string queryText,
string dataSourceCode,
Guid? tenantId = null) : base(id)
{
Code = code;
Name = name;
QueryText = queryText;
DataSourceCode = dataSourceCode;
TenantId = tenantId;
Status = SqlQueryStatus.Draft;
ExecutionCount = 0;
}
public void UpdateQueryText(string queryText)
{
QueryText = queryText;
}
public void MarkAsExecuted()
{
LastExecutedAt = DateTime.UtcNow;
ExecutionCount++;
}
public void Activate()
{
Status = SqlQueryStatus.Active;
}
public void Archive()
{
Status = SqlQueryStatus.Archived;
}
}

View file

@ -0,0 +1,106 @@
using System;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.SqlQueryManager.Domain.Entities;
/// <summary>
/// SQL Stored Procedure entity for creating and managing stored procedures
/// </summary>
public class SqlStoredProcedure : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
/// <summary>
/// Procedure name in database
/// </summary>
public string ProcedureName { get; set; }
/// <summary>
/// Schema name (default: dbo)
/// </summary>
public string SchemaName { get; set; }
/// <summary>
/// Display name
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// Description
/// </summary>
public string Description { get; set; }
/// <summary>
/// Full procedure definition (CREATE/ALTER)
/// </summary>
public string ProcedureBody { get; set; }
/// <summary>
/// DataSource code
/// </summary>
public string DataSourceCode { get; set; }
/// <summary>
/// Status
/// </summary>
public SqlQueryStatus Status { get; set; }
/// <summary>
/// Category
/// </summary>
public string Category { get; set; }
/// <summary>
/// Whether procedure exists in database
/// </summary>
public bool IsDeployed { get; set; }
/// <summary>
/// Last deployment time
/// </summary>
public DateTime? LastDeployedAt { get; set; }
/// <summary>
/// Parameter definitions (JSON)
/// </summary>
public string Parameters { get; set; }
protected SqlStoredProcedure()
{
}
public SqlStoredProcedure(
Guid id,
string procedureName,
string schemaName,
string displayName,
string procedureBody,
string dataSourceCode,
Guid? tenantId = null) : base(id)
{
ProcedureName = procedureName;
SchemaName = schemaName ?? "dbo";
DisplayName = displayName;
ProcedureBody = procedureBody;
DataSourceCode = dataSourceCode;
TenantId = tenantId;
Status = SqlQueryStatus.Draft;
IsDeployed = false;
}
public void UpdateBody(string body)
{
ProcedureBody = body;
}
public void MarkAsDeployed()
{
IsDeployed = true;
LastDeployedAt = DateTime.UtcNow;
Status = SqlQueryStatus.Active;
}
public string GetFullName() => $"{SchemaName}.{ProcedureName}";
}

View file

@ -0,0 +1,107 @@
using System;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.SqlQueryManager.Domain.Entities;
/// <summary>
/// SQL View entity for creating and managing database views
/// </summary>
public class SqlView : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
/// <summary>
/// View name in database
/// </summary>
public string ViewName { get; set; }
/// <summary>
/// Schema name (default: dbo)
/// </summary>
public string SchemaName { get; set; }
/// <summary>
/// Display name
/// </summary>
public string DisplayName { get; set; }
/// <summary>
/// Description
/// </summary>
public string Description { get; set; }
/// <summary>
/// View definition (SELECT statement)
/// </summary>
public string ViewDefinition { get; set; }
/// <summary>
/// DataSource code
/// </summary>
public string DataSourceCode { get; set; }
/// <summary>
/// Status
/// </summary>
public SqlQueryStatus Status { get; set; }
/// <summary>
/// Category
/// </summary>
public string Category { get; set; }
/// <summary>
/// Whether view exists in database
/// </summary>
public bool IsDeployed { get; set; }
/// <summary>
/// Last deployment time
/// </summary>
public DateTime? LastDeployedAt { get; set; }
/// <summary>
/// Whether to use WITH SCHEMABINDING
/// </summary>
public bool WithSchemaBinding { get; set; }
protected SqlView()
{
}
public SqlView(
Guid id,
string viewName,
string schemaName,
string displayName,
string viewDefinition,
string dataSourceCode,
Guid? tenantId = null) : base(id)
{
ViewName = viewName;
SchemaName = schemaName ?? "dbo";
DisplayName = displayName;
ViewDefinition = viewDefinition;
DataSourceCode = dataSourceCode;
TenantId = tenantId;
Status = SqlQueryStatus.Draft;
IsDeployed = false;
WithSchemaBinding = false;
}
public void UpdateDefinition(string definition)
{
ViewDefinition = definition;
}
public void MarkAsDeployed()
{
IsDeployed = true;
LastDeployedAt = DateTime.UtcNow;
Status = SqlQueryStatus.Active;
}
public string GetFullName() => $"{SchemaName}.{ViewName}";
}

View file

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Erp.SqlQueryManager</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="9.0.2" />
<ProjectReference Include="..\Erp.SqlQueryManager.Domain.Shared\Erp.SqlQueryManager.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\src\Erp.Platform.Domain\Erp.Platform.Domain.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

View file

@ -0,0 +1,96 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Erp.SqlQueryManager.Domain.Services;
/// <summary>
/// Result of SQL query execution
/// </summary>
public class SqlExecutionResult
{
public bool Success { get; set; }
public string Message { get; set; }
public IEnumerable<dynamic> Data { get; set; }
public int RowsAffected { get; set; }
public long ExecutionTimeMs { get; set; }
public Dictionary<string, object> Metadata { get; set; }
public SqlExecutionResult()
{
Metadata = new Dictionary<string, object>();
}
}
/// <summary>
/// Service for executing SQL commands
/// </summary>
public interface ISqlExecutorService
{
/// <summary>
/// Execute a SELECT query and return results
/// </summary>
Task<SqlExecutionResult> ExecuteQueryAsync(
string sql,
string dataSourceCode,
Dictionary<string, object> parameters = null);
/// <summary>
/// Execute a non-query command (INSERT, UPDATE, DELETE)
/// </summary>
Task<SqlExecutionResult> ExecuteNonQueryAsync(
string sql,
string dataSourceCode,
Dictionary<string, object> parameters = null);
/// <summary>
/// Execute scalar query (returns single value)
/// </summary>
Task<SqlExecutionResult> ExecuteScalarAsync<T>(
string sql,
string dataSourceCode,
Dictionary<string, object> parameters = null);
/// <summary>
/// Deploy stored procedure to database
/// </summary>
Task<SqlExecutionResult> DeployStoredProcedureAsync(
string procedureBody,
string dataSourceCode);
/// <summary>
/// Deploy view to database
/// </summary>
Task<SqlExecutionResult> DeployViewAsync(
string viewDefinition,
string dataSourceCode);
/// <summary>
/// Deploy function to database
/// </summary>
Task<SqlExecutionResult> DeployFunctionAsync(
string functionBody,
string dataSourceCode);
/// <summary>
/// Check if database object exists
/// </summary>
Task<bool> CheckObjectExistsAsync(
string objectName,
string objectType,
string dataSourceCode,
string schemaName = "dbo");
/// <summary>
/// Drop database object
/// </summary>
Task<SqlExecutionResult> DropObjectAsync(
string objectName,
string objectType,
string dataSourceCode,
string schemaName = "dbo");
/// <summary>
/// Validate SQL syntax (basic validation)
/// </summary>
Task<(bool IsValid, string ErrorMessage)> ValidateSqlAsync(string sql);
}

View file

@ -0,0 +1,42 @@
using System.Collections.Generic;
using Erp.SqlQueryManager.Domain.Shared;
namespace Erp.SqlQueryManager.Domain.Services;
/// <summary>
/// Provides SQL templates for creating database objects
/// </summary>
public interface ISqlTemplateProvider
{
/// <summary>
/// Get stored procedure template
/// </summary>
string GetStoredProcedureTemplate(string procedureName, string schemaName = "dbo");
/// <summary>
/// Get view template
/// </summary>
string GetViewTemplate(string viewName, string schemaName = "dbo", bool withSchemaBinding = false);
/// <summary>
/// Get function template
/// </summary>
string GetFunctionTemplate(string functionName, SqlFunctionType functionType, string schemaName = "dbo");
/// <summary>
/// Get query template with common patterns
/// </summary>
string GetQueryTemplate(string queryType);
/// <summary>
/// Get available query template types
/// </summary>
List<QueryTemplateInfo> GetAvailableQueryTemplates();
}
public class QueryTemplateInfo
{
public string Type { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}

View file

@ -0,0 +1,301 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Erp.Platform.DynamicData;
using Erp.Platform.Queries;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Domain.Services;
namespace Erp.SqlQueryManager.Domain.Services;
public class SqlExecutorService : DomainService, ISqlExecutorService
{
private readonly IDataSourceManager _dataSourceManager;
private readonly IServiceProvider _serviceProvider;
public SqlExecutorService(
IDataSourceManager dataSourceManager,
IServiceProvider serviceProvider)
{
_dataSourceManager = dataSourceManager;
_serviceProvider = serviceProvider;
}
private async Task<IDynamicDataRepository> GetRepositoryAsync(string dataSourceCode)
{
// Get DataSource to determine database type
var dataSource = await _dataSourceManager.GetDataSourceAsync(
CurrentTenant.IsAvailable,
dataSourceCode);
if (dataSource == null)
{
throw new BusinessException("SqlQueryManager:DataSourceNotFound")
.WithData("DataSourceCode", dataSourceCode);
}
// Get appropriate repository based on database type
// For now, using MS SQL Server repository
var repository = _serviceProvider.GetKeyedService<IDynamicDataRepository>("Ms");
if (repository == null)
{
throw new BusinessException("SqlQueryManager:RepositoryNotFound")
.WithData("DatabaseType", "Ms");
}
return repository;
}
public async Task<SqlExecutionResult> ExecuteQueryAsync(
string sql,
string dataSourceCode,
Dictionary<string, object> parameters = null)
{
var stopwatch = Stopwatch.StartNew();
var result = new SqlExecutionResult();
try
{
var connectionString = await _dataSourceManager.GetConnectionStringAsync(
CurrentTenant.IsAvailable,
dataSourceCode);
if (string.IsNullOrWhiteSpace(connectionString))
{
throw new BusinessException("SqlQueryManager:InvalidConnectionString")
.WithData("DataSourceCode", dataSourceCode);
}
var repository = await GetRepositoryAsync(dataSourceCode);
var data = await repository.QueryAsync(sql, connectionString, parameters);
stopwatch.Stop();
result.Success = true;
result.Data = data;
result.RowsAffected = data?.Count() ?? 0;
result.ExecutionTimeMs = stopwatch.ElapsedMilliseconds;
result.Message = $"Query executed successfully.";
}
catch (Exception ex)
{
stopwatch.Stop();
result.Success = false;
result.Message = $"Query execution failed: {ex.Message}";
result.ExecutionTimeMs = stopwatch.ElapsedMilliseconds;
result.Metadata["ErrorDetail"] = ex.ToString();
}
return result;
}
public async Task<SqlExecutionResult> ExecuteNonQueryAsync(
string sql,
string dataSourceCode,
Dictionary<string, object> parameters = null)
{
var stopwatch = Stopwatch.StartNew();
var result = new SqlExecutionResult();
try
{
var connectionString = await _dataSourceManager.GetConnectionStringAsync(
CurrentTenant.IsAvailable,
dataSourceCode);
if (string.IsNullOrWhiteSpace(connectionString))
{
throw new BusinessException("SqlQueryManager:InvalidConnectionString")
.WithData("DataSourceCode", dataSourceCode);
}
var repository = await GetRepositoryAsync(dataSourceCode);
var rowsAffected = await repository.ExecuteAsync(sql, connectionString, parameters);
stopwatch.Stop();
result.Success = true;
result.RowsAffected = rowsAffected;
result.ExecutionTimeMs = stopwatch.ElapsedMilliseconds;
result.Message = $"Command executed successfully. Rows affected: {rowsAffected}";
}
catch (Exception ex)
{
stopwatch.Stop();
result.Success = false;
result.Message = $"Command execution failed: {ex.Message}";
result.ExecutionTimeMs = stopwatch.ElapsedMilliseconds;
result.Metadata["ErrorDetail"] = ex.ToString();
}
return result;
}
public async Task<SqlExecutionResult> ExecuteScalarAsync<T>(
string sql,
string dataSourceCode,
Dictionary<string, object> parameters = null)
{
var stopwatch = Stopwatch.StartNew();
var result = new SqlExecutionResult();
try
{
var connectionString = await _dataSourceManager.GetConnectionStringAsync(
CurrentTenant.IsAvailable,
dataSourceCode);
if (string.IsNullOrWhiteSpace(connectionString))
{
throw new BusinessException("SqlQueryManager:InvalidConnectionString")
.WithData("DataSourceCode", dataSourceCode);
}
var repository = await GetRepositoryAsync(dataSourceCode);
var scalarValue = await repository.ExecuteScalarAsync<T>(sql, connectionString, parameters);
stopwatch.Stop();
result.Success = true;
result.Data = new[] { new { Value = scalarValue } };
result.ExecutionTimeMs = stopwatch.ElapsedMilliseconds;
result.Message = "Scalar query executed successfully";
result.Metadata["ScalarValue"] = scalarValue;
}
catch (Exception ex)
{
stopwatch.Stop();
result.Success = false;
result.Message = $"Scalar query execution failed: {ex.Message}";
result.ExecutionTimeMs = stopwatch.ElapsedMilliseconds;
result.Metadata["ErrorDetail"] = ex.ToString();
}
return result;
}
public async Task<SqlExecutionResult> DeployStoredProcedureAsync(
string procedureBody,
string dataSourceCode)
{
return await ExecuteNonQueryAsync(procedureBody, dataSourceCode);
}
public async Task<SqlExecutionResult> DeployViewAsync(
string viewDefinition,
string dataSourceCode)
{
return await ExecuteNonQueryAsync(viewDefinition, dataSourceCode);
}
public async Task<SqlExecutionResult> DeployFunctionAsync(
string functionBody,
string dataSourceCode)
{
return await ExecuteNonQueryAsync(functionBody, dataSourceCode);
}
public async Task<bool> CheckObjectExistsAsync(
string objectName,
string objectType,
string dataSourceCode,
string schemaName = "dbo")
{
try
{
var sql = $@"
SELECT COUNT(*)
FROM sys.objects o
INNER JOIN sys.schemas s ON o.schema_id = s.schema_id
WHERE s.name = @SchemaName
AND o.name = @ObjectName
AND o.type_desc = @ObjectType";
var parameters = new Dictionary<string, object>
{
{ "SchemaName", schemaName },
{ "ObjectName", objectName },
{ "ObjectType", objectType.ToUpperInvariant() }
};
var result = await ExecuteScalarAsync<int>(sql, dataSourceCode, parameters);
return result.Success && result.Metadata.ContainsKey("ScalarValue")
&& Convert.ToInt32(result.Metadata["ScalarValue"]) > 0;
}
catch
{
return false;
}
}
public async Task<SqlExecutionResult> DropObjectAsync(
string objectName,
string objectType,
string dataSourceCode,
string schemaName = "dbo")
{
var dropCommand = objectType.ToUpperInvariant() switch
{
"SQL_STORED_PROCEDURE" => $"DROP PROCEDURE IF EXISTS [{schemaName}].[{objectName}]",
"VIEW" => $"DROP VIEW IF EXISTS [{schemaName}].[{objectName}]",
"SQL_SCALAR_FUNCTION" => $"DROP FUNCTION IF EXISTS [{schemaName}].[{objectName}]",
"SQL_TABLE_VALUED_FUNCTION" => $"DROP FUNCTION IF EXISTS [{schemaName}].[{objectName}]",
"SQL_INLINE_TABLE_VALUED_FUNCTION" => $"DROP FUNCTION IF EXISTS [{schemaName}].[{objectName}]",
_ => throw new BusinessException("SqlQueryManager:UnsupportedObjectType")
.WithData("ObjectType", objectType)
};
return await ExecuteNonQueryAsync(dropCommand, dataSourceCode);
}
public Task<(bool IsValid, string ErrorMessage)> ValidateSqlAsync(string sql)
{
try
{
if (string.IsNullOrWhiteSpace(sql))
{
return Task.FromResult((false, "SQL query is empty"));
}
// Basic validation - check for dangerous keywords
var dangerousPatterns = new[]
{
@"\bDROP\s+DATABASE\b",
@"\bDROP\s+SCHEMA\b",
@"\bTRUNCATE\s+TABLE\b",
@"\bALTER\s+DATABASE\b",
@"\bSHUTDOWN\b",
@"\bxp_cmdshell\b"
};
foreach (var pattern in dangerousPatterns)
{
if (Regex.IsMatch(sql, pattern, RegexOptions.IgnoreCase))
{
return Task.FromResult((false, $"SQL contains potentially dangerous command: {pattern}"));
}
}
// Check for balanced parentheses
var openCount = sql.Count(c => c == '(');
var closeCount = sql.Count(c => c == ')');
if (openCount != closeCount)
{
return Task.FromResult((false, "Unbalanced parentheses in SQL"));
}
return Task.FromResult((true, string.Empty));
}
catch (Exception ex)
{
return Task.FromResult((false, $"Validation error: {ex.Message}"));
}
}
}

View file

@ -0,0 +1,395 @@
using System.Collections.Generic;
using System.Text;
using Erp.SqlQueryManager.Domain.Shared;
using Volo.Abp.DependencyInjection;
namespace Erp.SqlQueryManager.Domain.Services;
public class SqlTemplateProvider : ISqlTemplateProvider, ITransientDependency
{
public string GetStoredProcedureTemplate(string procedureName, string schemaName = "dbo")
{
return $@"-- =============================================
-- Author: <Author Name>
-- Create date: <Create Date>
-- Description: <Description>
-- =============================================
CREATE OR ALTER PROCEDURE [{schemaName}].[{procedureName}]
-- Add parameters here
@Parameter1 INT = NULL,
@Parameter2 NVARCHAR(100) = NULL
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT
@Parameter1 AS Parameter1,
@Parameter2 AS Parameter2
-- Example error handling
BEGIN TRY
-- Your logic here
END TRY
BEGIN CATCH
-- Error handling
DECLARE @ErrorMessage NVARCHAR(4000) = ERROR_MESSAGE();
DECLARE @ErrorSeverity INT = ERROR_SEVERITY();
DECLARE @ErrorState INT = ERROR_STATE();
RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState);
END CATCH
END
GO";
}
public string GetViewTemplate(string viewName, string schemaName = "dbo", bool withSchemaBinding = false)
{
var schemaBindingClause = withSchemaBinding ? " WITH SCHEMABINDING" : "";
return $@"-- =============================================
-- Author: <Author Name>
-- Create date: <Create Date>
-- Description: <Description>
-- =============================================
CREATE OR ALTER VIEW [{schemaName}].[{viewName}]{schemaBindingClause}
AS
-- Define your SELECT statement here
SELECT
Column1,
Column2,
Column3
FROM
TableName
WHERE
-- Add your conditions
1 = 1
GO";
}
public string GetFunctionTemplate(string functionName, SqlFunctionType functionType, string schemaName = "dbo")
{
return functionType switch
{
SqlFunctionType.ScalarFunction => GetScalarFunctionTemplate(functionName, schemaName),
SqlFunctionType.TableValuedFunction => GetTableValuedFunctionTemplate(functionName, schemaName),
SqlFunctionType.InlineTableValuedFunction => GetInlineTableValuedFunctionTemplate(functionName, schemaName),
_ => GetScalarFunctionTemplate(functionName, schemaName)
};
}
private string GetScalarFunctionTemplate(string functionName, string schemaName)
{
return $@"-- =============================================
-- Author: <Author Name>
-- Create date: <Create Date>
-- Description: Scalar function that returns a single value
-- =============================================
CREATE OR ALTER FUNCTION [{schemaName}].[{functionName}]
(
-- Add parameters here
@Parameter1 INT,
@Parameter2 NVARCHAR(100)
)
RETURNS INT
AS
BEGIN
-- Declare the return variable here
DECLARE @Result INT;
-- Add your logic here
SELECT @Result = COUNT(*)
FROM YourTable
WHERE Column1 = @Parameter1;
-- Return the result
RETURN @Result;
END
GO";
}
private string GetTableValuedFunctionTemplate(string functionName, string schemaName)
{
return $@"-- =============================================
-- Author: <Author Name>
-- Create date: <Create Date>
-- Description: Multi-statement table-valued function
-- =============================================
CREATE OR ALTER FUNCTION [{schemaName}].[{functionName}]
(
-- Add parameters here
@Parameter1 INT,
@Parameter2 NVARCHAR(100)
)
RETURNS @ResultTable TABLE
(
-- Define the structure of the result table
Id INT,
Name NVARCHAR(100),
Value DECIMAL(18,2)
)
AS
BEGIN
-- Fill the table variable with data
INSERT INTO @ResultTable (Id, Name, Value)
SELECT
Id,
Name,
Value
FROM
YourTable
WHERE
Column1 = @Parameter1;
-- Return
RETURN;
END
GO";
}
private string GetInlineTableValuedFunctionTemplate(string functionName, string schemaName)
{
return $@"-- =============================================
-- Author: <Author Name>
-- Create date: <Create Date>
-- Description: Inline table-valued function
-- =============================================
CREATE OR ALTER FUNCTION [{schemaName}].[{functionName}]
(
-- Add parameters here
@Parameter1 INT,
@Parameter2 NVARCHAR(100)
)
RETURNS TABLE
AS
RETURN
(
-- Add your SELECT statement here
SELECT
Id,
Name,
Value,
CreatedDate
FROM
YourTable
WHERE
Column1 = @Parameter1
AND Column2 LIKE '%' + @Parameter2 + '%'
)
GO";
}
public string GetQueryTemplate(string queryType)
{
return queryType?.ToUpperInvariant() switch
{
"SELECT" => GetSelectTemplate(),
"INSERT" => GetInsertTemplate(),
"UPDATE" => GetUpdateTemplate(),
"DELETE" => GetDeleteTemplate(),
"JOIN" => GetJoinTemplate(),
"CTE" => GetCteTemplate(),
"PIVOT" => GetPivotTemplate(),
"TRANSACTION" => GetTransactionTemplate(),
_ => GetSelectTemplate()
};
}
private string GetSelectTemplate()
{
return @"-- Basic SELECT query
SELECT
Column1,
Column2,
Column3
FROM
TableName
WHERE
-- Add your conditions
Column1 = 'value'
AND IsActive = 1
ORDER BY
Column1 ASC;";
}
private string GetInsertTemplate()
{
return @"-- INSERT statement
INSERT INTO TableName
(
Column1,
Column2,
Column3,
CreatedDate
)
VALUES
(
'Value1',
'Value2',
123,
GETDATE()
);
-- Or with SELECT
INSERT INTO TableName (Column1, Column2)
SELECT
Column1,
Column2
FROM
SourceTable
WHERE
Condition = 1;";
}
private string GetUpdateTemplate()
{
return @"-- UPDATE statement
UPDATE TableName
SET
Column1 = 'NewValue',
Column2 = 'NewValue2',
UpdatedDate = GETDATE()
WHERE
Id = 123
AND IsActive = 1;";
}
private string GetDeleteTemplate()
{
return @"-- DELETE statement
DELETE FROM TableName
WHERE
Id = 123
AND IsActive = 0;
-- Soft delete pattern
UPDATE TableName
SET
IsDeleted = 1,
DeletedDate = GETDATE(),
DeletedBy = 'UserName'
WHERE
Id = 123;";
}
private string GetJoinTemplate()
{
return @"-- JOIN query example
SELECT
t1.Column1,
t1.Column2,
t2.Column3,
t3.Column4
FROM
Table1 t1
INNER JOIN Table2 t2 ON t1.Id = t2.Table1Id
LEFT JOIN Table3 t3 ON t2.Id = t3.Table2Id
WHERE
t1.IsActive = 1
AND t2.Status = 'Active'
ORDER BY
t1.Column1;";
}
private string GetCteTemplate()
{
return @"-- Common Table Expression (CTE) example
WITH CTE_Name AS
(
SELECT
Column1,
Column2,
COUNT(*) as RecordCount
FROM
TableName
WHERE
IsActive = 1
GROUP BY
Column1, Column2
)
SELECT
*
FROM
CTE_Name
WHERE
RecordCount > 5
ORDER BY
RecordCount DESC;";
}
private string GetPivotTemplate()
{
return @"-- PIVOT example
SELECT
*
FROM
(
SELECT
Category,
Year,
Amount
FROM
Sales
) AS SourceTable
PIVOT
(
SUM(Amount)
FOR Year IN ([2021], [2022], [2023], [2024])
) AS PivotTable
ORDER BY
Category;";
}
private string GetTransactionTemplate()
{
return @"-- Transaction example
BEGIN TRANSACTION;
BEGIN TRY
-- Your SQL statements here
UPDATE Table1
SET Column1 = 'Value'
WHERE Id = 1;
INSERT INTO Table2 (Column1, Column2)
VALUES ('Value1', 'Value2');
DELETE FROM Table3
WHERE Id = 123;
-- Commit if all successful
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
-- Rollback on error
ROLLBACK TRANSACTION;
-- Return error information
SELECT
ERROR_NUMBER() AS ErrorNumber,
ERROR_SEVERITY() AS ErrorSeverity,
ERROR_STATE() AS ErrorState,
ERROR_PROCEDURE() AS ErrorProcedure,
ERROR_LINE() AS ErrorLine,
ERROR_MESSAGE() AS ErrorMessage;
END CATCH;";
}
public List<QueryTemplateInfo> GetAvailableQueryTemplates()
{
return new List<QueryTemplateInfo>
{
new() { Type = "SELECT", Name = "Basic Select", Description = "Simple SELECT query with WHERE and ORDER BY" },
new() { Type = "INSERT", Name = "Insert Data", Description = "INSERT statement with VALUES or SELECT" },
new() { Type = "UPDATE", Name = "Update Data", Description = "UPDATE statement with conditions" },
new() { Type = "DELETE", Name = "Delete Data", Description = "DELETE statement with soft delete example" },
new() { Type = "JOIN", Name = "Join Tables", Description = "Query with INNER and LEFT JOINs" },
new() { Type = "CTE", Name = "Common Table Expression", Description = "CTE (WITH clause) example" },
new() { Type = "PIVOT", Name = "Pivot Table", Description = "PIVOT query for data transformation" },
new() { Type = "TRANSACTION", Name = "Transaction", Description = "Transaction with error handling" }
};
}
}

View file

@ -0,0 +1,19 @@
namespace Erp.SqlQueryManager;
public static class Prefix
{
public static string MenuPrefix { get; set; } = "Sqm";
public static string HostPrefix { get; set; } = "T";
public static string? DbSchema { get; set; } = null;
public const string ConnectionStringName = "SqlQueryManager";
}
public static class TablePrefix
{
public static string ByName(string tableName)
{
return $"{Prefix.MenuPrefix}_{Prefix.HostPrefix}_{tableName}";
}
}

View file

@ -0,0 +1,17 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
namespace Erp.SqlQueryManager;
[DependsOn(
typeof(AbpDddDomainModule),
typeof(SqlQueryManagerDomainSharedModule)
)]
public class SqlQueryManagerDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
// Domain services configuration can be added here
}
}

View file

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Erp.SqlQueryManager</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="9.0.2" />
<ProjectReference Include="..\Erp.SqlQueryManager.Domain\Erp.SqlQueryManager.Domain.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

View file

@ -0,0 +1,27 @@
using Erp.SqlQueryManager.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace Erp.SqlQueryManager.EntityFrameworkCore;
[ConnectionStringName("Default")]
public class SqlQueryManagerDbContext : AbpDbContext<SqlQueryManagerDbContext>
{
public DbSet<SqlQuery> SqlQueries { get; set; }
public DbSet<SqlStoredProcedure> SqlStoredProcedures { get; set; }
public DbSet<SqlView> SqlViews { get; set; }
public DbSet<SqlFunction> SqlFunctions { get; set; }
public SqlQueryManagerDbContext(DbContextOptions<SqlQueryManagerDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigureSqlQueryManager();
}
}

View file

@ -0,0 +1,104 @@
using Erp.SqlQueryManager.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace Erp.SqlQueryManager.EntityFrameworkCore;
public static class SqlQueryManagerDbContextModelCreatingExtensions
{
public static void ConfigureSqlQueryManager(this ModelBuilder builder)
{
Check.NotNull(builder, nameof(builder));
// SqlQuery
builder.Entity<SqlQuery>(b =>
{
b.ToTable(TablePrefix.ByName(nameof(SqlQuery)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Code).IsRequired().HasMaxLength(128);
b.Property(x => x.Name).IsRequired().HasMaxLength(256);
b.Property(x => x.Description).HasMaxLength(1000);
b.Property(x => x.QueryText).IsRequired();
b.Property(x => x.DataSourceCode).IsRequired().HasMaxLength(128);
b.Property(x => x.Status).IsRequired();
b.Property(x => x.Category).HasMaxLength(128);
b.Property(x => x.Tags).HasMaxLength(500);
b.Property(x => x.Parameters).HasMaxLength(4000);
b.HasIndex(x => x.Code);
b.HasIndex(x => x.DataSourceCode);
b.HasIndex(x => x.Status);
b.HasIndex(x => x.Category);
});
// SqlStoredProcedure
builder.Entity<SqlStoredProcedure>(b =>
{
b.ToTable(TablePrefix.ByName(nameof(SqlStoredProcedure)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.ProcedureName).IsRequired().HasMaxLength(128);
b.Property(x => x.SchemaName).IsRequired().HasMaxLength(128);
b.Property(x => x.DisplayName).IsRequired().HasMaxLength(256);
b.Property(x => x.Description).HasMaxLength(1000);
b.Property(x => x.ProcedureBody).IsRequired();
b.Property(x => x.DataSourceCode).IsRequired().HasMaxLength(128);
b.Property(x => x.Status).IsRequired();
b.Property(x => x.Category).HasMaxLength(128);
b.Property(x => x.Parameters).HasMaxLength(4000);
b.HasIndex(x => new { x.SchemaName, x.ProcedureName });
b.HasIndex(x => x.DataSourceCode);
b.HasIndex(x => x.Status);
b.HasIndex(x => x.IsDeployed);
});
// SqlView
builder.Entity<SqlView>(b =>
{
b.ToTable(TablePrefix.ByName(nameof(SqlView)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.ViewName).IsRequired().HasMaxLength(128);
b.Property(x => x.SchemaName).IsRequired().HasMaxLength(128);
b.Property(x => x.DisplayName).IsRequired().HasMaxLength(256);
b.Property(x => x.Description).HasMaxLength(1000);
b.Property(x => x.ViewDefinition).IsRequired();
b.Property(x => x.DataSourceCode).IsRequired().HasMaxLength(128);
b.Property(x => x.Status).IsRequired();
b.Property(x => x.Category).HasMaxLength(128);
b.HasIndex(x => new { x.SchemaName, x.ViewName });
b.HasIndex(x => x.DataSourceCode);
b.HasIndex(x => x.Status);
b.HasIndex(x => x.IsDeployed);
});
// SqlFunction
builder.Entity<SqlFunction>(b =>
{
b.ToTable(TablePrefix.ByName(nameof(SqlFunction)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.FunctionName).IsRequired().HasMaxLength(128);
b.Property(x => x.SchemaName).IsRequired().HasMaxLength(128);
b.Property(x => x.DisplayName).IsRequired().HasMaxLength(256);
b.Property(x => x.Description).HasMaxLength(1000);
b.Property(x => x.FunctionType).IsRequired();
b.Property(x => x.FunctionBody).IsRequired();
b.Property(x => x.ReturnType).IsRequired().HasMaxLength(256);
b.Property(x => x.DataSourceCode).IsRequired().HasMaxLength(128);
b.Property(x => x.Status).IsRequired();
b.Property(x => x.Category).HasMaxLength(128);
b.Property(x => x.Parameters).HasMaxLength(4000);
b.HasIndex(x => new { x.SchemaName, x.FunctionName });
b.HasIndex(x => x.DataSourceCode);
b.HasIndex(x => x.Status);
b.HasIndex(x => x.FunctionType);
b.HasIndex(x => x.IsDeployed);
});
}
}

View file

@ -0,0 +1,20 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace Erp.SqlQueryManager.EntityFrameworkCore;
[DependsOn(
typeof(SqlQueryManagerDomainModule),
typeof(AbpEntityFrameworkCoreModule)
)]
public class SqlQueryManagerEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<SqlQueryManagerDbContext>(options =>
{
options.AddDefaultRepositories(includeAllEntities: true);
});
}
}

View file

@ -0,0 +1,24 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.1.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<AbpProjectType>module</AbpProjectType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ConfigureAwait.Fody" Version="3.3.1" PrivateAssets="All" />
<PackageReference Include="Fody" Version="6.5.3">
<PrivateAssets>All</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<Target Name="NoWarnOnRazorViewImportedTypeConflicts" BeforeTargets="RazorCoreCompile">
<PropertyGroup>
<NoWarn>$(NoWarn);0436</NoWarn>
</PropertyGroup>
</Target>
</Project>

View file

@ -11,8 +11,7 @@ public class BankAccountDto : AuditedEntityDto<Guid>
public string AccountOwner { get; set; }
public Guid? CurrencyId { get; set; }
public string CurrencyCode { get; set; }
public string Currency { get; set; }
public bool CanTransferMoney { get; set; }

View file

@ -8,7 +8,7 @@ public class EmployeeDto : FullAuditedEntityDto<Guid>
public Guid? TenantId { get; set; }
public string Code { get; set; }
public string FullName { get; set; }
public string Name { get; set; }
public string Avatar { get; set; }
public string NationalId { get; set; }
public DateTime BirthDate { get; set; }
@ -19,7 +19,7 @@ public class EmployeeDto : FullAuditedEntityDto<Guid>
public string Country { get; set; }
public string City { get; set; }
public string District { get; set; }
public string Street { get; set; }
public string Township { get; set; }
public string PostalCode { get; set; }
public string PhoneNumber { get; set; }
public string MobileNumber { get; set; }
@ -50,10 +50,12 @@ public class EmployeeDto : FullAuditedEntityDto<Guid>
public EmployeeDto Manager { get; set; }
public decimal BaseSalary { get; set; }
public Guid? CurrencyId { get; set; }
public string Currency { get; set; }
public string PayrollGroup { get; set; } // e.g., Monthly, Biweekly, Weekly
public Guid? BankAccountId { get; set; }
public Guid BankId { get; set; }
public string IbanNumber { get; set; }
public Guid? BadgeId { get; set; }
public string EmployeeStatus { get; set; }

View file

@ -13,8 +13,7 @@ public class ExpenseDto : FullAuditedEntityDto<Guid>
public string Category { get; set; }
public decimal Amount { get; set; }
public Guid? CurrencyId { get; set; }
public string CurrencyCode { get; set; }
public string Currency { get; set; }
public DateTime RequestDate { get; set; }
public string Description { get; set; }

View file

@ -14,8 +14,7 @@ public class JobPositionDto : FullAuditedEntityDto<Guid>
public string Level { get; set; }
public decimal MinSalary { get; set; }
public decimal MaxSalary { get; set; }
public Guid? CurrencyId { get; set; }
public string CurrencyName { get; set; }
public string Currency { get; set; }
public string RequiredSkills { get; set; }
public string Responsibilities { get; set; }
public string Qualifications { get; set; }

View file

@ -7,7 +7,7 @@ public class VisitorDto : FullAuditedEntityDto<Guid>
{
public Guid? TenantId { get; set; }
public string FullName { get; set; }
public string Name { get; set; }
public string CompanyName { get; set; }
public string Email { get; set; }
public string PhoneNumber { get; set; }

View file

@ -18,7 +18,7 @@ public class CreateUpdateTenantInput
public string Country { get; set; }
public string City { get; set; }
public string District { get; set; }
public string Street { get; set; }
public string Township { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
public string PostalCode { get; set; }

View file

@ -52,5 +52,14 @@ public class CommandColumnDto
/// <summary> Url boş ise calisacak 'eval' icerisinde calisacak olan kod
/// </summary>
public string OnClick { get; set; }
/// <summary> Görünür durumu
/// </summary>
public bool IsVisible { get; set; } = true;
/// <summary> Dinamik görünürlük kontrolü için JavaScript fonksiyonu
/// Örnek: "(e) => !e.row.isEditing" veya "(e) => e.row.data.Status === 'Active'"
/// Fonksiyon parametre olarak DevExtreme button event objesini alır (e.row, e.row.data, e.row.isEditing vb.)
/// true/false döndürmelidir
/// </summary>
public string VisibleExpression { get; set; }
}

View file

@ -0,0 +1,102 @@
namespace Erp.Platform.ListForms;
/// <summary>
/// TreeList için özel ayarları içerir
/// </summary>
public class GanttOptionDto
{
/// <summary>
/// Parent kaydı belirten field adı (örn: "Id")
/// </summary>
public string KeyExpr { get; set; }
/// <summary>
/// Parent kaydı belirten field adı (örn: "parentId")
/// </summary>
public string ParentIdExpr { get; set; }
/// <summary>
/// Alt kayıtların olup olmadığını belirten field adı (opsiyonel)
/// </summary>
public string HasItemsExpr { get; set; }
/// <summary>
/// Root (en üst) seviyedeki kayıtların parent değeri (genelde null veya 0)
/// </summary>
public object RootValue { get; set; } = null;
/// <summary>
/// Başlangıçta açık olacak node'ların ID'leri
/// </summary>
public object[] ExpandedRowKeys { get; set; } = [];
/// <summary>
/// Tüm node'ları başlangıçta açık göster
/// </summary>
public bool AutoExpandAll { get; set; } = false;
/// <summary>
/// Alt kayıtlar seçildiğinde parent kayıtları da seç (recursive selection)
/// </summary>
public bool RecursiveSelection { get; set; } = false;
/// <summary>
/// Başlık alanı (örn: "Title")
/// </summary>
public string TitleExpr { get; set; }
/// <summary>
/// Zaman ölçeği tipi (örn: "days", "weeks", "months")
/// </summary>
public string ScaleType { get; set; } = "weeks";
/// <summary>
/// Başlangıç Tarihi ifadesi (örn: "0001-01-01")
/// </summary>
public string StartExpr { get; set; }
/// <summary>
/// Bitiş Tarihi ifadesi (örn: "9999-12-31")
/// </summary>
public string EndExpr { get; set; }
/// <summary>
/// İlerleme ifadesi (örn: "%50")
/// </summary>
public string ProgressExpr { get; set; }
/// <summary>
/// Düzenlemeye izin verilsin mi
/// </summary>
public bool AllowEditing { get; set; } = false;
/// <summary>
/// Task eklemeye izin verilsin mi
/// </summary>
public bool AllowTaskAdding { get; set; } = false;
/// <summary>
/// Task güncellemeye izin verilsin mi
/// </summary>
public bool AllowTaskUpdating { get; set; } = false;
/// <summary>
/// Task silmeye izin verilsin mi
/// </summary>
public bool AllowTaskDeleting { get; set; } = false;
/// <summary>
/// Bağlantılar için kullanılan field adı (örn: "predecessors")
/// </summary>
public bool AllowDependencyAdding { get; set; } = false;
/// <summary>
/// Bağlantılar için kullanılan field adı (örn: "predecessors")
/// </summary>
public bool AllowDependencyDeleting { get; set; } = false;
/// <summary>
/// Kaynaklar için kullanılan field adı (örn: "resources")
/// </summary>
public bool AllowResourceAdding { get; set; } = false;
/// <summary>
/// Kaynaklar için kullanılan field adı (örn: "resources")
/// </summary>
public bool AllowResourceDeleting { get; set; } = false;
}

View file

@ -20,7 +20,7 @@ public class GridColumnOptionDto
/// <summary> ilk kolon(lar) sabitlesitirlmesi ayari aktif mi
/// </summary>
public bool ColumnFixingEnabled { get; set; }
public bool ColumnFixingEnabled { get; set; } = false;
/// <summary> kolon secme butonu gosterilsin mi
/// </summary>
/// <summary> alabilecegi degerler: 'dragAndDrop', 'select'
@ -30,7 +30,7 @@ public class GridColumnOptionDto
/// </summary>
public bool HoverStateEnabled { get; set; } = false;
public bool ColumnHidingEnabled { get; set; } = true;
public bool FocusedRowEnabled { get; set; } = false;
public bool FocusedRowEnabled { get; set; } = true;
public bool ShowColumnHeaders { get; set; } = true;
}

View file

@ -164,6 +164,32 @@ public class GridOptionsDto : AuditedEntityDto<Guid>
set { TreeOptionJson = JsonSerializer.Serialize(value); }
}
[JsonIgnore]
public string GanttOptionJson { get; set; }
public GanttOptionDto GanttOptionDto
{
get
{
if (!string.IsNullOrEmpty(GanttOptionJson))
return JsonSerializer.Deserialize<GanttOptionDto>(GanttOptionJson);
return new GanttOptionDto();
}
set { GanttOptionJson = JsonSerializer.Serialize(value); }
}
[JsonIgnore]
public string SchedulerOptionJson { get; set; }
public SchedulerOptionDto SchedulerOptionDto
{
get
{
if (!string.IsNullOrEmpty(SchedulerOptionJson))
return JsonSerializer.Deserialize<SchedulerOptionDto>(SchedulerOptionJson);
return new SchedulerOptionDto();
}
set { SchedulerOptionJson = JsonSerializer.Serialize(value); }
}
[JsonIgnore]
public string PagerOptionJson { get; set; }
public GridPagerOptionDto PagerOptionDto

View file

@ -5,8 +5,10 @@ public class LayoutDto
public bool Grid { get; set; } = true;
public bool Card { get; set; } = true;
public bool Pivot { get; set; } = true;
public bool Tree { get; set; } = true;
public bool Chart { get; set; } = true;
public bool Tree { get; set; } = true;
public bool Gantt { get; set; } = true;
public bool Scheduler { get; set; } = true;
public string DefaultLayout { get; set; } = "grid";
public int CardLayoutColumn { get; set; } = 4;
}

View file

@ -0,0 +1,80 @@
namespace Erp.Platform.ListForms;
/// <summary>
/// TreeList için özel ayarları içerir
/// </summary>
public class SchedulerOptionDto
{
/// <summary>
/// Text olarak gösterilecek field adı (örn: "title")
/// </summary>
public string TextExpr { get; set; }
/// <summary>
/// Başlangıç tarihinin tutulduğu field adı (örn: "startDate")
/// </summary>
public string StartDateExpr { get; set; }
/// <summary>
/// Bitiş tarihinin tutulduğu field adı (örn: "endDate")
/// </summary>
public string EndDateExpr { get; set; }
/// <summary>
/// Tüm gün etkinlikler için kullanılan field adı (örn: "allDay")
/// </summary>
public string AllDayExpr { get; set; }
/// <summary>
/// Tekrarlama kuralının tutulduğu field adı (örn: "recurrenceRule")
/// </summary>
public string RecurrenceRuleExpr { get; set; }
/// <summary>
/// Tekrarlama istisnasının tutulduğu field adı (örn: "recurrenceException")
/// </summary>
public string RecurrenceExceptionExpr { get; set; }
/// <summary>
/// Kaynaklar (örn: kaynaklar için kullanılan field adı, veri kaynağı vb.)
/// </summary>
public int StartDayHour { get; set; } = 8;
/// <summary>
/// Günün bitiş saati (örn: "18" = 18:00)
/// </summary>
public int EndDayHour { get; set; } = 18;
/// <summary>
/// Varsayılan görünüm (örn: "week", "month", "day")
/// </summary>
public string DefaultView { get; set; } = "week";
/// <summary>
/// Tüm gün panelini gösterme durumu
/// </summary>
public bool ShowAllDayPanel { get; set; } = true;
/// <summary>
/// Hücre süresi (dakika cinsinden, örn: 30)
/// </summary>
public int CellDuration { get; set; } = 30;
/// <summary>
/// Haftanın ilk günü (örn: "0" = Pazar, "1" = Pazartesi)
/// </summary>
public int FirstDayOfWeek { get; set; } = 1;
/// <summary>
/// Kaydırma çubuğunun çapraz kaydırma durumunu belirtir
/// </summary>
public bool CrossScrollingEnabled { get; set; } = false;
/// <summary>
/// Etkinliklerin yeniden boyutlandırılmasına izin verilip verilmediğini belirtir
/// </summary>
public bool AllowResizing { get; set; } = false;
/// <summary>
/// Etkinliklerin sürüklenip bırakılmasına izin verilip verilmediğini belirtir
/// </summary>
public bool AllowDragging { get; set; } = false;
/// <summary>
/// Etkinlik eklemeye izin verilip verilmediğini belirtir
/// </summary>
public bool AllowDeleting { get; set; } = false;
/// <summary>
/// Etkinlik güncellemeye izin verilip verilmediğini belirtir
/// </summary>
public bool AllowUpdating { get; set; } = false;
/// <summary>
/// Etkinlik eklemeye izin verilip verilmediğini belirtir
/// </summary>
public bool AllowAdding { get; set; } = false;
}

View file

@ -4,8 +4,8 @@ namespace Erp.Platform.ListForms;
public class SubFormDto
{
public string TabTitle { get; set; }
public string TabType { get; set; }
public string TabTitle { get; set; }
public string Code { get; set; }
public bool IsRefresh { get; set; }
public SubFormRelationDto[] Relation { get; set; }

View file

@ -38,5 +38,25 @@ public class TreeOptionDto
/// Alt kayıtlar seçildiğinde parent kayıtları da seç (recursive selection)
/// </summary>
public bool RecursiveSelection { get; set; } = false;
/// <summary>
/// Başlık alanı (örn: "Title")
/// </summary>
public string TitleExpr { get; set; }
/// <summary>
/// Başlangıç Tarihi ifadesi (örn: "0001-01-01")
/// </summary>
public string StartExpr { get; set; }
/// <summary>
/// Bitiş Tarihi ifadesi (örn: "9999-12-31")
/// </summary>
public string EndExpr { get; set; }
/// <summary>
/// İlerleme ifadesi (örn: "%50")
/// </summary>
public string ProgressExpr { get; set; }
}

View file

@ -47,6 +47,8 @@ public class ListFormEditTabs
public const string ColumnForm = "column";
public const string PivotForm = "pivot";
public const string TreeForm = "tree";
public const string GanttForm = "gantt";
public const string SchedulerForm = "scheduler";
public const string PagerForm = "pager";
public const string StateForm = "state";
public const string SubFormJsonRow = "subForm";

View file

@ -27,6 +27,39 @@ public static class LookupQueryValues
$"ORDER BY \"{DisplayExpr}\";"
});
public static string DefaultLookupQuery(
string TableName,
string ValueExpr,
string DisplayExpr,
bool isTable = true,
bool isDeleted = false)
{
return $"SELECT " +
$"\"{ValueExpr}\" AS \"Key\", " +
$"\"{DisplayExpr}\" AS \"Name\" " +
$"FROM \"{(isTable ? TableNameResolver.GetFullTableName($"{TableName}") : TableNameResolver.GetFullViewName($"{TableName}"))}\" " +
(!isDeleted ? "" : $"WHERE \"IsDeleted\" = 'false'") +
$"ORDER BY \"{DisplayExpr}\";";
}
public static string ProjectPhaseValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.ProjectPhase)}\" " +
$"WHERE " +
$"(\"ProjectId\" = @param0 OR @param0 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string TechnicalSkillsValues =
$"SELECT " +
$"\"Name\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.Skill)}\" " +
$"WHERE \"SkillTypeId\" IN (SELECT \"Id\" FROM \"{FullNameTable(TableNameEnum.SkillType)}\" WHERE \"Name\"='Technical Skills' ) " +
$"ORDER BY \"Name\"";
public static string CustomerValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
@ -46,12 +79,12 @@ public static class LookupQueryValues
public static string PartnerContactValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"FullName\" AS \"Name\" " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.PartnerContact)}\" " +
$"WHERE " +
$"(\"PartnerId\" = @param0 OR @param0 IS NULL) " +
$"AND \"IsActive\" = 'true' " +
$"ORDER BY \"FullName\";";
$"ORDER BY \"Name\";";
public static string TenantValues =
$"SELECT * FROM (" +
@ -113,18 +146,18 @@ public static class LookupQueryValues
$"GROUP BY \"Name\" " +
$"ORDER BY \"Name\";";
public static string StreetValues =
public static string TownshipValues =
$"SELECT " +
$"\"Street\" AS \"Key\", " +
$"\"Street\" AS \"Name\" " +
$"\"Township\" AS \"Key\", " +
$"\"Township\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.District)}\" " +
$"WHERE " +
$"(\"Country\" = @param0 OR @param0 IS NULL) " +
$"AND (\"City\" = @param1 OR @param1 IS NULL) " +
$"AND (\"Name\" = @param2 OR @param2 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"GROUP BY \"Street\" " +
$"ORDER BY \"Street\";";
$"GROUP BY \"Township\" " +
$"ORDER BY \"Township\";";
public static string RoleValues =
$"SELECT " +
@ -203,4 +236,33 @@ public static class LookupQueryValues
$"FROM \"AbpOrganizationUnits\"" +
$"WHERE \"Code\" LIKE '00001%' " +
$"ORDER BY \"DisplayName\"";
public static string WarehouseValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.Warehouse)}\" " +
$"WHERE \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string ZoneValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.Zone)}\" " +
$"WHERE " +
$"(\"WarehouseId\" = @param0 OR @param0 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
public static string LocationValues =
$"SELECT " +
$"\"Id\" AS \"Key\", " +
$"\"Name\" AS \"Name\" " +
$"FROM \"{FullNameTable(TableNameEnum.Location)}\" " +
$"WHERE " +
$"(\"WarehouseId\" = @param0 OR @param0 IS NULL) " +
$"AND (\"ZoneId\" = @param1 OR @param1 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " +
$"ORDER BY \"Name\";";
}

View file

@ -9,7 +9,7 @@ public class CountryDto : AuditedEntityDto<Guid>
public string Code { get; set; }
public string Name { get; set; }
public string GroupName { get; set; }
public string CurrencyCode { get; set; }
public string Currency { get; set; }
public int PhoneCode { get; set; }
public string TaxLabel { get; set; }
public bool ZipRequired { get; set; }

View file

@ -7,7 +7,7 @@ public class DemoDto : FullAuditedEntityDto<Guid>
{
public Guid? TenantId { get; set; }
public string OrganizationName { get; set; }
public string FullName { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string PhoneNumber { get; set; }
public string Address { get; set; }

View file

@ -9,6 +9,4 @@ public class DistrictDto : AuditedEntityDto<Guid>
public string City { get; set; }
public string Name { get; set; }
public string Township { get; set; }
public string Street { get; set; }
public string ZipCode { get; set; }
}

View file

@ -6,5 +6,4 @@ namespace Erp.Platform.Sectors;
public class SectorDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public string FullName { get; set; }
}

View file

@ -15,7 +15,7 @@ public class CustomTenantDto
public string Country { get; set; }
public string City { get; set; }
public string District { get; set; }
public string Street { get; set; }
public string Township { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
public string PostalCode { get; set; }

View file

@ -359,7 +359,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
Organizer = new EventOrganizerDto
{
Id = employee.Id,
Name = employee.FullName,
Name = employee.Name,
Position = employee.JobPosition.Name,
Avatar = employee.Avatar
},
@ -387,7 +387,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
Employee = new EventOrganizerDto
{
Id = commentAuthor.Id,
Name = commentAuthor.FullName,
Name = commentAuthor.Name,
Position = commentAuthor.JobPosition.Name,
Avatar = commentAuthor.Avatar
},

View file

@ -151,6 +151,14 @@ public class ListFormsAppService : CrudAppService<
{
item.TreeOptionJson = JsonSerializer.Serialize(input.TreeOptionDto);
}
else if (input.EditType == ListFormEditTabs.GanttForm)
{
item.GanttOptionJson = JsonSerializer.Serialize(input.GanttOptionDto);
}
else if (input.EditType == ListFormEditTabs.SchedulerForm)
{
item.SchedulerOptionJson = JsonSerializer.Serialize(input.SchedulerOptionDto);
}
else if (input.EditType == ListFormEditTabs.PagerForm)
{
item.PageSize = input.PageSize;

View file

@ -120,7 +120,7 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic
entity.SetCountry(input.Data.Country);
entity.SetCity(input.Data.City);
entity.SetDistrict(input.Data.District);
entity.SetStreet(input.Data.Street);
entity.SetTownship(input.Data.Township);
entity.SetAddress1(input.Data.Address1);
entity.SetAddress2(input.Data.Address2);
entity.SetPostalCode(input.Data.PostalCode);
@ -155,7 +155,7 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic
entity.SetCountry(input.Data.Country);
entity.SetCity(input.Data.City);
entity.SetDistrict(input.Data.District);
entity.SetStreet(input.Data.Street);
entity.SetTownship(input.Data.Township);
entity.SetAddress1(input.Data.Address1);
entity.SetAddress2(input.Data.Address2);
entity.SetPostalCode(input.Data.PostalCode);

View file

@ -7,7 +7,6 @@ using Volo.Abp.PermissionManagement;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using System.Text.Json;
namespace Erp.Platform.PermissionManagement;

View file

@ -77,7 +77,7 @@ public class PublicAppService : PlatformAppService
var bodyBuilder = new StringBuilder();
bodyBuilder.AppendLine($"Şirket: {input.OrganizationName}");
bodyBuilder.AppendLine($"Ad Soyad: {input.FullName}");
bodyBuilder.AppendLine($"Ad Soyad: {input.Name}");
bodyBuilder.AppendLine($"E-Posta: {input.Email}");
bodyBuilder.AppendLine($"Telefon: {input.PhoneNumber}");
bodyBuilder.AppendLine($"Adres: {input.Address}");

View file

@ -82,7 +82,7 @@ public class PlatformTenantAppService : TenantAppService, IPlatformTenantAppServ
dto.Country = tenant.GetCountry();
dto.City = tenant.GetCity();
dto.District = tenant.GetDistrict();
dto.Street = tenant.GetStreet();
dto.Township = tenant.GetTownship();
dto.Address1 = tenant.GetAddress1();
dto.Address2 = tenant.GetAddress2();
dto.PostalCode = tenant.GetPostalCode();

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,10 @@
{
"AiBots": [
{
"BotName": "Chat Bot"
"BotName": "Chat Bot",
"Description": "A general purpose chat bot that can answer questions and have conversations.",
"ApiUrl": "https://api.openai.com/v1/chat/completions",
"IsActive": true
}
],
"Settings": [
@ -239,7 +242,15 @@
"dx.material.purple.light.compact": "App.Setting.material.purple.light.compact",
"dx.material.purple.dark.compact": "App.Setting.material.purple.dark.compact",
"dx.material.teal.light.compact": "App.Setting.material.teal.light.compact",
"dx.material.teal.dark.compact": "App.Setting.material.teal.dark.compact"
"dx.material.teal.dark.compact": "App.Setting.material.teal.dark.compact",
"dx.fluent.blue.dark.compact": "App.Setting.fluent.blue.dark.compact",
"dx.fluent.blue.dark": "App.Setting.fluent.blue.dark",
"dx.fluent.blue.light.compact": "App.Setting.fluent.blue.light.compact",
"dx.fluent.blue.light": "App.Setting.fluent.blue.light",
"dx.fluent.saas.dark.compact": "App.Setting.fluent.saas.dark.compact",
"dx.fluent.saas.dark": "App.Setting.fluent.saas.dark",
"dx.fluent.saas.light.compact": "App.Setting.fluent.saas.light.compact",
"dx.fluent.saas.light": "App.Setting.fluent.saas.light"
},
"order": 3
},

View file

@ -27,6 +27,9 @@ namespace Erp.Platform.Data.Seeds;
public class AiBotSeedDto
{
public string BotName { get; set; }
public string Description { get; set; }
public string ApiUrl { get; set; }
public bool IsActive { get; set; }
}
public class LanguageTextsSeedDto
@ -285,14 +288,12 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
if (!seenCodes.Add(item.Code) || existingCodes.Contains(item.Code))
continue;
var currency = await _currencyRepository.FirstOrDefaultAsync(c => c.Code == item.CurrencyCode);
buffer.Add(new Country(
Guid.NewGuid(),
item.Code,
item.Name,
item.GroupName,
currency != null ? currency.Id : null,
item.Currency,
item.PhoneCode,
item.TaxLabel
));
@ -386,11 +387,11 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
// 1. Mevcut kayıtları çek (tek sorguda)
var existingDistricts = await dbCtx.Set<District>()
.Select(d => new { d.Country, d.City, d.Name, d.Township, d.Street, d.ZipCode })
.Select(d => new { d.Country, d.City, d.Name, d.Township })
.ToListAsync();
var existingSet = existingDistricts
.Select(d => $"{d.Country}:{d.City}:{d.Name}:{d.Township}:{d.Street}:{d.ZipCode}")
.Select(d => $"{d.Country}:{d.City}:{d.Name}:{d.Township}")
.ToHashSet();
var options = new JsonSerializerOptions
@ -406,7 +407,7 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
{
if (item == null) continue;
var key = $"{item.Country}:{item.Country}.{item.City}:{item.Name}:{item.Township}:{item.Street}:{item.ZipCode}";
var key = $"{item.Country}:{item.Country}.{item.City}:{item.Name}:{item.Township}";
var city = $"{item.Country}.{item.City}";
if (existingSet.Contains(key)) continue;
@ -415,9 +416,7 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
item.Country,
city,
item.Name,
item.Township,
item.Street,
item.ZipCode
item.Township
));
if (buffer.Count >= 5000) // 3. Batch
@ -678,6 +677,9 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
await _aiBotRepository.InsertAsync(new AiBot
{
BotName = item.BotName,
Description = item.Description,
ApiUrl = item.ApiUrl,
IsActive = item.IsActive
});
}
}

File diff suppressed because it is too large Load diff

View file

@ -43,27 +43,29 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
public async Task SeedAsync(DataSeedContext context)
{
using var utils = new SeederUtils();
var utils = new SeederUtils(_listFormRepository, _listFormFieldRepository);
var listFormName = String.Empty;
#region Bank
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Bank))
listFormName = AppCodes.Accounting.Bank;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Bank,
Name = AppCodes.Accounting.Bank,
Title = AppCodes.Accounting.Bank,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
Description = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Accounting.Bank,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Bank)),
KeyFieldName = "Id",
@ -76,18 +78,18 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Accounting.Bank),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Bank)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Accounting.Bank, 600, 600, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 400, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
[
new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 2, DataField = "Code", 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 = 5, DataField = "Address1", ColSpan = 1, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 6, DataField = "Address2", ColSpan = 1, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 7, DataField = "Country", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
@ -105,7 +107,8 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
Text ="Manage",
UrlTarget="_blank",
AuthName = AppCodes.Accounting.BankAccount,
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Bank)}/@Id"
Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id",
IsVisible = true
},
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
@ -156,14 +159,12 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 150,
FieldName = "Code",
Width = 200,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -174,12 +175,14 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "IdentifierCode",
Width = 150,
FieldName = "Name",
Width = 200,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -233,7 +236,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
DisplayExpr = "Name",
ValueExpr = "Key",
LookupQuery = LookupQueryValues.CountryValues,
CascadeEmptyFields = "City,District,Street"
CascadeEmptyFields = "City,District,Township"
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
@ -259,7 +262,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
CascadeRelationField = "Country",
CascadeFilterOperator="=",
CascadeParentFields = "Country",
CascadeEmptyFields = "District,Street"
CascadeEmptyFields = "District,Township"
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
@ -285,7 +288,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
CascadeRelationField = "City",
CascadeFilterOperator="=",
CascadeParentFields = "Country,City",
CascadeEmptyFields = "Street",
CascadeEmptyFields = "Township",
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
@ -327,7 +330,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Email",
Width = 150,
Width = 200,
ListOrderNo = 12,
Visible = true,
IsActive = true,
@ -344,24 +347,25 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
#endregion
#region BankAccount
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BankAccount))
listFormName = AppCodes.Accounting.BankAccount;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.BankAccount,
Name = AppCodes.Accounting.BankAccount,
Title = AppCodes.Accounting.BankAccount,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Accounting.BankAccount,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.BankAccount)),
KeyFieldName = "Id",
@ -374,24 +378,25 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Accounting.BankAccount),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.BankAccount)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Accounting.BankAccount, 600, 300, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 300, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
[
new EditingFormItemDto { Order = 1, DataField = "AccountNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "AccountOwner", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "CurrencyId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 3, DataField = "Currency", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 4, DataField = "CanTransferMoney", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "CanTransferMoney", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }
new() { FieldName = "CanTransferMoney", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}, autoSave: true
);
@ -452,15 +457,15 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "CurrencyId",
SourceDbType = DbType.String,
FieldName = "Currency",
Width = 150,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Id", "Name"),
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Code", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
@ -486,15 +491,14 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
#endregion
// Bank ve Bank Account arasında Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Bank,
JsonSerializer.Serialize(new List<dynamic>() {
await utils.CloneFormLayoutAsync(
AppCodes.Accounting.Bank,
JsonSerializer.Serialize(
new List<dynamic>() {
new {
TabTitle = "Bank Accounts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.BankAccount,
TabTitle = AppCodes.Accounting.BankAccount,
Code = AppCodes.Accounting.BankAccount,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
@ -503,8 +507,523 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
},
}
},
})
}
)
);
#region Cash
listFormName = AppCodes.Accounting.Cash;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
Description = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Cash)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Cash)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 300, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
[
new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 2, DataField = "Code", 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 = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 5, DataField = "Currency", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.NumberStandartFormat },
new EditingFormItemDto { Order = 6, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
})
}
, autoSave: true);
#region Cash Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 0,
Visible = false,
IsActive = true,
IsDeleted = false,
SortIndex = 0,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "BranchId",
Width = 150,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
LookupJson = JsonSerializer.Serialize(
new LookupDto {
DataSourceType = UiLookupDataSourceTypeEnum.Query,
DisplayExpr = "Name",
ValueExpr = "Key",
LookupQuery = LookupQueryValues.BranchValues,
}
),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Code",
Width = 150,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 150,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 300,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Currency",
Width = 150,
ListOrderNo = 6,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Code", "Name"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Decimal,
FieldName = "Balance",
Format = "fixedPoint",
Alignment = "right",
Width = 100,
ListOrderNo = 7,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 8,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
], autoSave: true);
#endregion
}
#endregion
#region CurrentAccount
listFormName = AppCodes.Accounting.CurrentAccount;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
Description = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.CurrentAccount)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.CurrentAccount)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 500, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
[
new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 2, DataField = "PartnerId", ColSpan = 1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 3, DataField = "Code", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 5, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 6, DataField = "TaxNumber", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 7, DataField = "TaxOffice", ColSpan = 1, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 8, DataField = "CreditLimit", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat },
new EditingFormItemDto { Order = 9, DataField = "Currency", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 10, DataField = "Risk", ColSpan = 1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 11, DataField = "PaymentTermId", ColSpan = 1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 12, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "CreditLimit", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "Risk", FieldDbType = DbType.String, Value = "Low", CustomValueType = FieldCustomValueTypeEnum.Value }
})
}
, autoSave: true);
#region CurrentAccount Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 0,
Visible = false,
IsActive = true,
IsDeleted = false,
SortIndex = 0,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "BranchId",
Width = 150,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
LookupJson = JsonSerializer.Serialize(
new LookupDto {
DataSourceType = UiLookupDataSourceTypeEnum.Query,
DisplayExpr = "Name",
ValueExpr = "Key",
LookupQuery = LookupQueryValues.BranchValues,
}
),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "PartnerId",
Width = 250,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Partner), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Code",
Width = 150,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 150,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 300,
ListOrderNo = 6,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Int64,
FieldName = "TaxNumber",
Width = 100,
ListOrderNo = 7,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "TaxOffice",
Width = 100,
ListOrderNo = 8,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Decimal,
FieldName = "CreditLimit",
Format = "fixedPoint",
Alignment = "right",
Width = 100,
ListOrderNo = 9,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Decimal,
FieldName = "Balance",
Format = "fixedPoint",
Alignment = "right",
Width = 100,
ListOrderNo = 10,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Currency",
Width = 150,
ListOrderNo = 11,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Code", "Name"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new()
{
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Risk",
Width = 100,
ListOrderNo = 12,
Visible = true,
IsActive = true,
IsDeleted = false,
LookupJson = JsonSerializer.Serialize(new LookupDto
{
DataSourceType = UiLookupDataSourceTypeEnum.StaticData,
DisplayExpr = "name",
ValueExpr = "key",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key = "Low", Name = "Low" },
new () { Key = "Medium", Name = "Medium" },
new () { Key = "High", Name = "High" },
new () { Key = "Blocked", Name = "Blocked" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new()
{
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "PaymentTermId",
Width = 100,
ListOrderNo = 13,
Visible = true,
IsActive = true,
IsDeleted = false,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.PaymentTerm), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 13,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
], autoSave: true);
#endregion
}
#endregion
}
}

View file

@ -43,27 +43,29 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
public async Task SeedAsync(DataSeedContext context)
{
using var utils = new SeederUtils();
var utils = new SeederUtils(_listFormRepository, _listFormFieldRepository);
var listFormName = String.Empty;
#region Program
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Program))
listFormName = AppCodes.Definitions.Program;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Program,
Name = AppCodes.Definitions.Program,
Title = AppCodes.Definitions.Program,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.Program,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Program)),
KeyFieldName = "Id",
@ -76,11 +78,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Program),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Program)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Program, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -146,8 +148,8 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
DisplayExpr = "name",
ValueExpr = "key",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key="Aktif",Name="Aktif" },
new () { Key="Pasif",Name="Pasif" },
new () { Key="Aktif", Name="Aktif" },
new () { Key="Pasif", Name="Pasif" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -160,24 +162,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region Schedule
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Schedule))
listFormName = AppCodes.Definitions.Schedule;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Schedule,
Name = AppCodes.Definitions.Schedule,
Title = AppCodes.Definitions.Schedule,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.Schedule,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Schedule)),
KeyFieldName = "Id",
@ -190,11 +193,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Schedule),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Schedule)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Schedule, 750, 400, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 750, 400, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order = 1, ColCount = 2, ColSpan = 1, ItemType = "group",
@ -309,8 +312,8 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
DisplayExpr = "name",
ValueExpr = "key",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key="Aktif",Name="Aktif" },
new () { Key="Pasif",Name="Pasif" },
new () { Key="Aktif", Name="Aktif" },
new () { Key="Pasif", Name="Pasif" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -554,24 +557,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region RegistrationType
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RegistrationType))
listFormName = AppCodes.Definitions.RegistrationType;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.RegistrationType,
Name = AppCodes.Definitions.RegistrationType,
Title = AppCodes.Definitions.RegistrationType,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.RegistrationType,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.RegistrationType)),
KeyFieldName = "Id",
@ -584,11 +588,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.RegistrationType),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.RegistrationType)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.RegistrationType, 500, 300, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
@ -686,8 +690,8 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
DisplayExpr = "name",
ValueExpr = "key",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key="Aktif",Name="Aktif" },
new () { Key="Pasif",Name="Pasif" },
new () { Key="Aktif", Name="Aktif" },
new () { Key="Pasif", Name="Pasif" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -700,24 +704,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region RegistrationMethod
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RegistrationMethod))
listFormName = AppCodes.Definitions.RegistrationMethod;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.RegistrationMethod,
Name = AppCodes.Definitions.RegistrationMethod,
Title = AppCodes.Definitions.RegistrationMethod,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.RegistrationMethod,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.RegistrationMethod)),
KeyFieldName = "Id",
@ -730,11 +735,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.RegistrationMethod),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.RegistrationMethod)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.RegistrationMethod, 550, 350, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 550, 350, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
@ -859,8 +864,8 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
DisplayExpr = "name",
ValueExpr = "key",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key="Aktif",Name="Aktif" },
new () { Key="Pasif",Name="Pasif" },
new () { Key="Aktif", Name="Aktif" },
new () { Key="Pasif", Name="Pasif" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -873,24 +878,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region ClassType
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ClassType))
listFormName = AppCodes.Definitions.ClassType;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.ClassType,
Name = AppCodes.Definitions.ClassType,
Title = AppCodes.Definitions.ClassType,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.ClassType,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ClassType)),
KeyFieldName = "Id",
@ -903,11 +909,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.ClassType),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ClassType)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.ClassType, 600, 400, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 400, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
@ -1067,8 +1073,8 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
DisplayExpr = "name",
ValueExpr = "key",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key="Aktif",Name="Aktif" },
new () { Key="Pasif",Name="Pasif" },
new () { Key="Aktif", Name="Aktif" },
new () { Key="Pasif", Name="Pasif" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -1081,24 +1087,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region Class
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Class))
listFormName = AppCodes.Definitions.Class;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Class,
Name = AppCodes.Definitions.Class,
Title = AppCodes.Definitions.Class,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.Class,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Class)),
KeyFieldName = "Id",
@ -1111,11 +1118,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Class),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Class)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Class, 550, 300, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 550, 300, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
@ -1240,8 +1247,8 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
DisplayExpr = "name",
ValueExpr = "key",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key="Aktif",Name="Aktif" },
new () { Key="Pasif",Name="Pasif" },
new () { Key="Aktif", Name="Aktif" },
new () { Key="Pasif", Name="Pasif" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -1254,24 +1261,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region Level
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Level))
listFormName = AppCodes.Definitions.Level;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Level,
Name = AppCodes.Definitions.Level,
Title = AppCodes.Definitions.Level,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.Level,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Level)),
KeyFieldName = "Id",
@ -1284,11 +1292,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Level),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Level)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(ListFormCodes.Lists.Level, 650, 450, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 650, 450, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
@ -1526,24 +1534,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region ClassCancellationReason
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ClassCancellationReason))
listFormName = AppCodes.Definitions.ClassCancellationReason;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.ClassCancellationReason,
Name = AppCodes.Definitions.ClassCancellationReason,
Title = AppCodes.Definitions.ClassCancellationReason,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.ClassCancellationReason,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ClassCancellationReason)),
KeyFieldName = "Id",
@ -1556,11 +1565,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.ClassCancellationReason),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ClassCancellationReason)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.ClassCancellationReason, 500, 300, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -1640,24 +1649,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region LessonPeriod
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.LessonPeriod))
listFormName = AppCodes.Definitions.LessonPeriod;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.LessonPeriod,
Name = AppCodes.Definitions.LessonPeriod,
Title = AppCodes.Definitions.LessonPeriod,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.LessonPeriod,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.LessonPeriod)),
KeyFieldName = "Id",
@ -1670,11 +1680,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.LessonPeriod),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.LessonPeriod)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.LessonPeriod, 600, 500, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 500, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
@ -1879,24 +1889,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region QuestionTag
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.QuestionTag))
listFormName = AppCodes.Definitions.QuestionTag;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.QuestionTag,
Name = AppCodes.Definitions.QuestionTag,
Title = AppCodes.Definitions.QuestionTag,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.QuestionTag,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuestionTag)),
KeyFieldName = "Id",
@ -1909,11 +1920,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.QuestionTag),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.QuestionTag)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.QuestionTag, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=
@ -1999,24 +2010,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region Question Pool
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.QuestionPool))
listFormName = AppCodes.Definitions.QuestionPool;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.QuestionPool,
Name = AppCodes.Definitions.QuestionPool,
Title = AppCodes.Definitions.QuestionPool,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.QuestionPool,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuestionPool)),
KeyFieldName = "Id",
@ -2029,11 +2041,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.QuestionPool),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.QuestionPool)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.QuestionPool, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1,ItemType="group", Items= [
@ -2049,7 +2061,8 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
Text ="Questions",
UrlTarget="_blank",
AuthName = AppCodes.Definitions.Question,
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.QuestionPool)}/@Id",
Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id",
IsVisible = true,
},
}),
}, autoSave: true
@ -2128,24 +2141,25 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
#endregion
#region Question
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Question))
listFormName = AppCodes.Definitions.Question;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Question,
Name = AppCodes.Definitions.Question,
Title = AppCodes.Definitions.Question,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.Question,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Question)),
KeyFieldName = "Id",
@ -2158,21 +2172,20 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Question),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Question)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Question, 500, 520, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 520, true, true, true, true, false),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] {
new() {
Hint = "Answers",
Text = "Answers",
AuthName = AppCodes.Definitions.Question,
AuthName = listFormName,
DialogName = "QuestionAnswers",
DialogParameters = JsonSerializer.Serialize(new {
id = "@Id"
})
DialogParameters = JsonSerializer.Serialize(new { id = "@Id" }),
IsVisible = true
},
}),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
@ -2410,15 +2423,13 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
}
// QuestionPool ve Question arasında Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.QuestionPool,
await utils.CloneFormLayoutAsync(
AppCodes.Definitions.QuestionPool,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Questions",
TabTitle = AppCodes.Definitions.Question,
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Question,
Code = AppCodes.Definitions.Question,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
@ -2429,6 +2440,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
}
})
);
#endregion
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -43,27 +43,29 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
public async Task SeedAsync(DataSeedContext context)
{
using var utils = new SeederUtils();
var utils = new SeederUtils(_listFormRepository, _listFormFieldRepository);
var listFormName = String.Empty;
#region EventType
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.EventType))
listFormName = AppCodes.Intranet.EventType;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.EventType,
Name = AppCodes.Intranet.EventType,
Title = AppCodes.Intranet.EventType,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.EventType,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventType)),
KeyFieldName = "Id",
@ -72,15 +74,15 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.EventType),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.EventType)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.EventType, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -131,24 +133,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region EventCategory
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.EventCategory))
listFormName = AppCodes.Intranet.EventCategory;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.EventCategory,
Name = AppCodes.Intranet.EventCategory,
Title = AppCodes.Intranet.EventCategory,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.EventCategory,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventCategory)),
KeyFieldName = "Id",
@ -157,15 +160,15 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.EventCategory),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.EventCategory)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.EventCategory, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1,ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -216,24 +219,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region Event
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Event))
listFormName = AppCodes.Intranet.Event;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Event,
Name = AppCodes.Intranet.Event,
Title = AppCodes.Intranet.Event,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.Event,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Event)),
KeyFieldName = "Id",
@ -242,15 +246,15 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Event),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Event)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Event, 500, 400, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 400, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
@ -395,7 +399,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
Visible = true,
IsActive = true,
IsDeleted = false,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
@ -464,24 +468,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region Meal
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Meal))
listFormName = AppCodes.Intranet.Meal;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Meal,
Name = AppCodes.Intranet.Meal,
Title = AppCodes.Intranet.Meal,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.Meal,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Meal)),
KeyFieldName = "Id",
@ -490,16 +495,16 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Meal),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Meal)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Meal, 500, 300, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
@ -653,24 +658,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region Reservations
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Reservation))
listFormName = AppCodes.Intranet.Reservation;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Reservation,
Name = AppCodes.Intranet.Reservation,
Title = AppCodes.Intranet.Reservation,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.Reservation,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Reservation)),
KeyFieldName = "Id",
@ -679,15 +685,15 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Reservation),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Reservation)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Reservation, 500, 400, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 400, true, true, true, true, false),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
@ -784,7 +790,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
@ -902,24 +908,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region Shuttle Routes
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ShuttleRoute))
listFormName = AppCodes.Intranet.ShuttleRoute;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.ShuttleRoute,
Name = AppCodes.Intranet.ShuttleRoute,
Title = AppCodes.Intranet.ShuttleRoute,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.ShuttleRoute,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ShuttleRoute)),
KeyFieldName = "Id",
@ -928,15 +935,15 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.ShuttleRoute),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ShuttleRoute)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.ShuttleRoute, 500, 300, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
@ -1128,24 +1135,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region Announncements
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Announcement))
listFormName = AppCodes.Intranet.Announcement;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Announcement,
Name = AppCodes.Intranet.Announcement,
Title = AppCodes.Intranet.Announcement,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.Announcement,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Announcement)),
KeyFieldName = "Id",
@ -1154,15 +1162,15 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Announcement),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Announcement)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Announcement, 500, 600, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 600, true, true, true, true, false),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
@ -1309,7 +1317,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
@ -1398,24 +1406,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region Visitors
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Visitor))
listFormName = AppCodes.Intranet.Visitor;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Visitor,
Name = AppCodes.Intranet.Visitor,
Title = AppCodes.Intranet.Visitor,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.Visitor,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Visitor)),
KeyFieldName = "Id",
@ -1424,21 +1433,21 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Visitor),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Visitor)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Visitor, 500, 450, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 450, true, true, true, true, false),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[
new EditingFormItemDto { Order = 1, DataField = "FullName", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "CompanyName", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Email", ColSpan=1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "PhoneNumber", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions },
@ -1481,7 +1490,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "FullName",
FieldName = "Name",
Width = 150,
ListOrderNo = 2,
Visible = true,
@ -1615,7 +1624,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
@ -1652,24 +1661,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region Social Post
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SocialPost))
listFormName = AppCodes.Intranet.SocialPost;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.SocialPost,
Name = AppCodes.Intranet.SocialPost,
Title = AppCodes.Intranet.SocialPost,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.SocialPost,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPost)),
KeyFieldName = "Id",
@ -1678,15 +1688,15 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.SocialPost),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.SocialPost)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.SocialPost, 700, 600, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 700, 600, true, true, true, true, false),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
@ -1704,8 +1714,9 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
Hint = "Comments",
Text ="Comments",
UrlTarget="_blank",
AuthName = AppCodes.Intranet.SocialComment,
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.SocialComment)}/@Id",
AuthName = listFormName,
Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id",
IsVisible = true,
},
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[]
@ -1746,7 +1757,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
@ -1819,24 +1830,25 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
#endregion
#region Social Comment
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SocialComment))
listFormName = AppCodes.Intranet.SocialComment;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.SocialComment,
Name = AppCodes.Intranet.SocialComment,
Title = AppCodes.Intranet.SocialComment,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Intranet.SocialComment,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialComment)),
KeyFieldName = "Id",
@ -1845,15 +1857,15 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.SocialComment),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.SocialComment)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.SocialComment, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Content", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextArea },

File diff suppressed because it is too large Load diff

View file

@ -43,25 +43,28 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
public async Task SeedAsync(DataSeedContext context)
{
var listFormName = String.Empty;
#region MeetingMethod
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.MeetingMethod))
listFormName = AppCodes.Definitions.MeetingMethod;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.MeetingMethod,
Name = AppCodes.Definitions.MeetingMethod,
Title = AppCodes.Definitions.MeetingMethod,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.MeetingMethod,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.MeetingMethod)),
KeyFieldName = "Id",
@ -70,15 +73,15 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.MeetingMethod),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.MeetingMethod)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.MeetingMethod, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -187,24 +190,25 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
#endregion
#region MeetingResult
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.MeetingResult))
listFormName = AppCodes.Definitions.MeetingResult;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.MeetingResult,
Name = AppCodes.Definitions.MeetingResult,
Title = AppCodes.Definitions.MeetingResult,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.MeetingResult,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.MeetingResult)),
KeyFieldName = "Id",
@ -213,15 +217,15 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.MeetingResult),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.MeetingResult)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.MeetingResult, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -319,24 +323,25 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
#endregion
#region Source
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Source))
listFormName = AppCodes.Definitions.Source;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Source,
Name = AppCodes.Definitions.Source,
Title = AppCodes.Definitions.Source,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.Source,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Source)),
KeyFieldName = "Id",
@ -345,15 +350,15 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Source),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Source)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Source, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1,ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -433,24 +438,25 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
#endregion
#region Interesting
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Interesting))
listFormName = AppCodes.Definitions.Interesting;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Interesting,
Name = AppCodes.Definitions.Interesting,
Title = AppCodes.Definitions.Interesting,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.Interesting,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Interesting)),
KeyFieldName = "Id",
@ -459,15 +465,15 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Interesting),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Interesting)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Interesting, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -547,24 +553,25 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
#endregion
#region SalesRejectionReason
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SalesRejectionReason))
listFormName = AppCodes.Definitions.SalesRejectionReason;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.SalesRejectionReason,
Name = AppCodes.Definitions.SalesRejectionReason,
Title = AppCodes.Definitions.SalesRejectionReason,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.SalesRejectionReason,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesRejectionReason)),
KeyFieldName = "Id",
@ -573,15 +580,15 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.SalesRejectionReason),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.SalesRejectionReason)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.SalesRejectionReason, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
@ -693,24 +700,25 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
#endregion
#region NoteType
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.NoteType))
listFormName = AppCodes.Definitions.NoteType;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
LayoutJson = DefaultLayoutJson(),
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.NoteType,
Name = AppCodes.Definitions.NoteType,
Title = AppCodes.Definitions.NoteType,
ListFormCode = listFormName,
Name = listFormName,
Title = listFormName,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Definitions.NoteType,
Description = listFormName,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.NoteType)),
KeyFieldName = "Id",
@ -719,16 +727,16 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson= DefaultSearchPanelJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.NoteType),
PermissionJson = DefaultPermissionJson(listFormName),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.NoteType)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.NoteType, 500, 250, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,185 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Text.Json;
using System.Threading.Tasks;
using Erp.Languages.Languages;
using Erp.Platform.Entities;
using Erp.Platform.Enums;
using Erp.Platform.ListForms;
using Erp.Platform.Queries;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
using Volo.Abp.TenantManagement;
using AbpIdentity = Erp.Platform.Data.Seeds.SeedConsts.AbpIdentity;
using AppCodes = Erp.Platform.Data.Seeds.SeedConsts.AppCodes;
using static Erp.Platform.PlatformConsts;
using static Erp.Platform.PlatformSeeder.SeederDefaults;
namespace Erp.Platform.Data.Seeds;
public class ListFormSeeder_Warehouse : IDataSeedContributor, ITransientDependency
{
private readonly IRepository<ListForm, Guid> _listFormRepository;
private readonly IRepository<ListFormField, Guid> _listFormFieldRepository;
private readonly IdentityUserManager _identityUserManager;
private readonly IdentityRoleManager _identityRoleManager;
private readonly IConfiguration _configuration;
public ListFormSeeder_Warehouse(
IRepository<ListForm, Guid> listFormRepository,
IRepository<ListFormField, Guid> listFormFieldRepository,
IdentityUserManager userManager,
IdentityRoleManager roleManager,
IConfiguration configuration)
{
_listFormRepository = listFormRepository;
_listFormFieldRepository = listFormFieldRepository;
_identityUserManager = userManager;
_identityRoleManager = roleManager;
_configuration = configuration;
}
public async Task SeedAsync(DataSeedContext context)
{
// #region Material Type
// if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.MaterialType))
// {
// var listFormMaterialType = await _listFormRepository.InsertAsync(
// new ListForm()
// {
// ListFormType = ListFormTypeEnum.List,
// IsSubForm = false,
// LayoutJson = DefaultLayoutJson,
// CultureName = LanguageCodes.En,
// ListFormCode = ListFormCodes.Lists.MaterialType,
// Name = AppCodes.SupplyChain.MaterialType,
// Title = AppCodes.SupplyChain.MaterialType,
// DataSourceCode = SeedConsts.DataSources.DefaultCode,
// IsTenant = true,
// IsBranch = false,
// IsOrganizationUnit = false,
// Description = AppCodes.SupplyChain.MaterialType,
// SelectCommandType = SelectCommandTypeEnum.Table,
// SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.MaterialType)),
// KeyFieldName = "Id",
// KeyFieldDbSourceType = DbType.Guid,
// DefaultFilter = DefaultFilterJson,
// SortMode = GridOptions.SortModeSingle,
// FilterRowJson = DefaultFilterRowJson,
// HeaderFilterJson = DefaultHeaderFilterJson,
// SearchPanelJson= DefaultSearchPanelJson,
// GroupPanelJson = DefaultGroupPanelJson,
// SelectionJson = DefaultSelectionSingleJson,
// ColumnOptionJson = DefaultColumnOptionJson,
// PermissionJson = DefaultPermissionJson(AppCodes.SupplyChain.MaterialType),
// DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.MaterialType)),
// DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
// PagerOptionJson = DefaultPagerOptionJson,
// EditingOptionJson = DefaultEditingOptionJson(AppCodes.SupplyChain.MaterialType, 500, 250, true, true, true, true, false),
// EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
// new() { Order=1,ColCount=1,ColSpan=1,ItemType="group", Items=[
// new EditingFormItemDto { Order = 1, DataField = "Code", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
// new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
// new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
// new EditingFormItemDto { Order = 4, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
// ]}
// }),
// InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
// FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
// new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
// }),
// }
// );
// #region MaterialType Fields
// await _listFormFieldRepository.InsertManyAsync(new ListFormField[] {
// new() {
// ListFormCode = listFormMaterialType.ListFormCode,
// CultureName = LanguageCodes.En,
// SourceDbType = DbType.Guid,
// FieldName = "Id",
// Width = 100,
// ListOrderNo = 1,
// Visible = false,
// IsActive = true,
// IsDeleted = false,
// ValidationRuleJson = DefaultValidationRuleRequiredJson,
// ColumnCustomizationJson = DefaultColumnCustomizationJson,
// PermissionJson = DefaultFieldPermissionJson(AppCodes.SupplyChain.MaterialType),
// PivotSettingsJson = DefaultPivotSettingsJson
// },
// new() {
// ListFormCode = listFormMaterialType.ListFormCode,
// CultureName = LanguageCodes.En,
// SourceDbType = DbType.String,
// FieldName = "Code",
// Width = 150,
// ListOrderNo = 2,
// Visible = true,
// IsActive = true,
// IsDeleted = false,
// AllowSearch = true,
// ValidationRuleJson = DefaultValidationRuleRequiredJson,
// ColumnCustomizationJson = DefaultColumnCustomizationJson,
// PermissionJson = DefaultFieldPermissionJson(AppCodes.SupplyChain.MaterialType),
// PivotSettingsJson = DefaultPivotSettingsJson
// },
// new() {
// ListFormCode = listFormMaterialType.ListFormCode,
// CultureName = LanguageCodes.En,
// SourceDbType = DbType.String,
// FieldName = "Name",
// Width = 350,
// ListOrderNo = 3,
// Visible = true,
// IsActive = true,
// IsDeleted = false,
// SortIndex = 1,
// SortDirection = GridColumnOptions.SortOrderAsc,
// AllowSearch = true,
// ValidationRuleJson = DefaultValidationRuleRequiredJson,
// ColumnCustomizationJson = DefaultColumnCustomizationJson,
// PermissionJson = DefaultFieldPermissionJson(AppCodes.SupplyChain.MaterialType),
// PivotSettingsJson = DefaultPivotSettingsJson
// },
// new() {
// ListFormCode = listFormMaterialType.ListFormCode,
// CultureName = LanguageCodes.En,
// SourceDbType = DbType.String,
// FieldName = "Description",
// Width = 500,
// ListOrderNo = 4,
// Visible = true,
// IsActive = true,
// IsDeleted = false,
// AllowSearch = true,
// ColumnCustomizationJson = DefaultColumnCustomizationJson,
// PermissionJson = DefaultFieldPermissionJson(AppCodes.SupplyChain.MaterialType),
// PivotSettingsJson = DefaultPivotSettingsJson
// },
// new() {
// ListFormCode = listFormMaterialType.ListFormCode,
// CultureName = LanguageCodes.En,
// SourceDbType = DbType.Boolean,
// FieldName = "IsActive",
// Width = 100,
// ListOrderNo = 5,
// Visible = true,
// IsActive = true,
// IsDeleted = false,
// AllowSearch = true,
// ColumnCustomizationJson = DefaultColumnCustomizationJson,
// PermissionJson = DefaultFieldPermissionJson(AppCodes.SupplyChain.MaterialType),
// PivotSettingsJson = DefaultPivotSettingsJson
// }
// });
// #endregion
// }
// #endregion
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -60,19 +60,31 @@ public static class SeederDefaults
AllowColumnResizing = true,
AllowColumnReordering = true,
ColumnResizingMode = "widget",
FocusRowEnabled = true,
});
public static readonly string DefaultLayoutJson = JsonSerializer.Serialize(new LayoutDto()
public static string DefaultLayoutJson(string DefaultLayout = "grid") => JsonSerializer.Serialize(new LayoutDto()
{
Grid = true,
Card = true,
Pivot = true,
Chart = true,
DefaultLayout = "grid",
Tree = true,
Gantt = true,
Scheduler = true,
DefaultLayout = DefaultLayout,
CardLayoutColumn = 4
});
public static readonly string DefaultExportJson = JsonSerializer.Serialize(new ChartExportDto
{
Enabled = true,
AllowExportSelectedData = false,
PrintingEnabled = true,
BackgroundColor = "#FFFFFF",
Margin = 10
});
public static readonly string DefaultSelectionSingleJson = JsonSerializer.Serialize(new SelectionDto
{
Mode = GridOptions.SelectionModeSingle,
Mode = GridOptions.SelectionModeNone,
AllowSelectAll = false
});
public static readonly string DefaultSelectionMultipleJson = JsonSerializer.Serialize(new SelectionDto
@ -81,11 +93,11 @@ public static class SeederDefaults
Mode = GridOptions.SelectionModeMultiple,
SelectAllMode = GridOptions.SelectionAllModeAllPages
});
public static string DefaultTreeOptionJson(string KeyExpr, string ParentIdExpr, bool AutoExpandAll = true) => JsonSerializer.Serialize(new TreeOptionDto
public static string DefaultTreeOptionJson(string KeyExpr, string ParentIdExpr, bool AutoExpandAll = true, object RootValue = null) => JsonSerializer.Serialize(new TreeOptionDto
{
KeyExpr = KeyExpr,
ParentIdExpr = ParentIdExpr,
RootValue = null,
RootValue = RootValue,
AutoExpandAll = AutoExpandAll
});
public static readonly string DefaultPagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto

Some files were not shown because too many files have changed in this diff Show more