Compare commits
No commits in common. "main" and "1.0.34" have entirely different histories.
437 changed files with 1519689 additions and 70099 deletions
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"volo.abp.cli": {
|
||||
"version": "9.0.2",
|
||||
"commands": [
|
||||
"abp"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,10 +16,6 @@ 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/"
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@ WORKDIR /app
|
|||
RUN apk update && apk upgrade
|
||||
RUN apk add nodejs~=22 npm~=11
|
||||
|
||||
COPY .config/dotnet-tools.json .config/dotnet-tools.json
|
||||
RUN dotnet tool restore
|
||||
ENV PATH="/root/.dotnet/tools:/app/.config/dotnet/tools:${PATH}"
|
||||
RUN dotnet tool install -g Volo.Abp.Cli
|
||||
ENV PATH="/root/.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 dotnet tool run abp install-libs
|
||||
RUN abp install-libs
|
||||
WORKDIR /app
|
||||
|
||||
COPY "modules/Erp.Languages/Erp.Languages.Application/Erp.Languages.Application.csproj" "modules/Erp.Languages/Erp.Languages.Application/"
|
||||
|
|
@ -31,11 +30,6 @@ 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/"
|
||||
|
|
@ -79,3 +73,5 @@ EXPOSE 443
|
|||
WORKDIR /srv/app
|
||||
COPY --from=build /app/publish .
|
||||
ENTRYPOINT ["./Erp.Platform.HttpApi.Host"]
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -80,18 +80,6 @@ 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
|
||||
|
|
@ -210,26 +198,6 @@ 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
|
||||
|
|
@ -268,14 +236,10 @@ 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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
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; }
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ConfigureAwait />
|
||||
</Weavers>
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?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>
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
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; }
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
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; }
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
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();
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
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; }
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
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
|
||||
{
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
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; }
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
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; }
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
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; }
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ConfigureAwait />
|
||||
</Weavers>
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?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>
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,25 +0,0 @@
|
|||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
using Volo.Abp.Localization;
|
||||
|
||||
namespace Erp.SqlQueryManager.Domain.Shared;
|
||||
|
||||
[LocalizationResourceName("SqlQueryManager")]
|
||||
public class ErpSqlQueryManagerResource
|
||||
{
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ConfigureAwait />
|
||||
</Weavers>
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?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>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
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
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
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";
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
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}";
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
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}";
|
||||
}
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
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}";
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ConfigureAwait />
|
||||
</Weavers>
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?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>
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
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; }
|
||||
}
|
||||
|
|
@ -1,301 +0,0 @@
|
|||
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}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,395 +0,0 @@
|
|||
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" }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
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}";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ConfigureAwait />
|
||||
</Weavers>
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?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>
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<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>
|
||||
|
|
@ -11,7 +11,8 @@ public class BankAccountDto : AuditedEntityDto<Guid>
|
|||
|
||||
public string AccountOwner { get; set; }
|
||||
|
||||
public string Currency { get; set; }
|
||||
public Guid? CurrencyId { get; set; }
|
||||
public string CurrencyCode { get; set; }
|
||||
|
||||
public bool CanTransferMoney { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ public class EmployeeDto : FullAuditedEntityDto<Guid>
|
|||
public Guid? TenantId { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string FullName { 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 Township { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string MobileNumber { get; set; }
|
||||
|
|
@ -50,12 +50,10 @@ public class EmployeeDto : FullAuditedEntityDto<Guid>
|
|||
public EmployeeDto Manager { get; set; }
|
||||
|
||||
public decimal BaseSalary { get; set; }
|
||||
public string Currency { get; set; }
|
||||
public Guid? CurrencyId { get; set; }
|
||||
|
||||
public string PayrollGroup { get; set; } // e.g., Monthly, Biweekly, Weekly
|
||||
|
||||
public Guid BankId { get; set; }
|
||||
public string IbanNumber { get; set; }
|
||||
public Guid? BankAccountId { get; set; }
|
||||
public Guid? BadgeId { get; set; }
|
||||
|
||||
public string EmployeeStatus { get; set; }
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ public class ExpenseDto : FullAuditedEntityDto<Guid>
|
|||
public string Category { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
public string Currency { get; set; }
|
||||
public Guid? CurrencyId { get; set; }
|
||||
public string CurrencyCode { get; set; }
|
||||
|
||||
public DateTime RequestDate { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ public class JobPositionDto : FullAuditedEntityDto<Guid>
|
|||
public string Level { get; set; }
|
||||
public decimal MinSalary { get; set; }
|
||||
public decimal MaxSalary { get; set; }
|
||||
public string Currency { get; set; }
|
||||
public Guid? CurrencyId { get; set; }
|
||||
public string CurrencyName { get; set; }
|
||||
public string RequiredSkills { get; set; }
|
||||
public string Responsibilities { get; set; }
|
||||
public string Qualifications { get; set; }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ public class VisitorDto : FullAuditedEntityDto<Guid>
|
|||
{
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public string FullName { get; set; }
|
||||
public string CompanyName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class CreateUpdateTenantInput
|
|||
public string Country { get; set; }
|
||||
public string City { get; set; }
|
||||
public string District { get; set; }
|
||||
public string Township { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string Address1 { get; set; }
|
||||
public string Address2 { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
|
|
|
|||
|
|
@ -52,14 +52,5 @@ 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; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,102 +0,0 @@
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ public class GridColumnOptionDto
|
|||
|
||||
/// <summary> ilk kolon(lar) sabitlesitirlmesi ayari aktif mi
|
||||
/// </summary>
|
||||
public bool ColumnFixingEnabled { get; set; } = false;
|
||||
public bool ColumnFixingEnabled { get; set; }
|
||||
/// <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; } = true;
|
||||
public bool FocusedRowEnabled { get; set; } = false;
|
||||
public bool ShowColumnHeaders { get; set; } = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -164,32 +164,6 @@ 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
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ public class LayoutDto
|
|||
public bool Grid { get; set; } = true;
|
||||
public bool Card { get; set; } = true;
|
||||
public bool Pivot { 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 bool Chart { get; set; } = true;
|
||||
public string DefaultLayout { get; set; } = "grid";
|
||||
public int CardLayoutColumn { get; set; } = 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,80 +0,0 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -4,8 +4,8 @@ namespace Erp.Platform.ListForms;
|
|||
|
||||
public class SubFormDto
|
||||
{
|
||||
public string TabType { get; set; }
|
||||
public string TabTitle { get; set; }
|
||||
public string TabType { get; set; }
|
||||
public string Code { get; set; }
|
||||
public bool IsRefresh { get; set; }
|
||||
public SubFormRelationDto[] Relation { get; set; }
|
||||
|
|
|
|||
|
|
@ -38,25 +38,5 @@ 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; }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,6 @@ 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";
|
||||
|
|
|
|||
|
|
@ -27,39 +27,6 @@ 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\", " +
|
||||
|
|
@ -79,12 +46,12 @@ public static class LookupQueryValues
|
|||
public static string PartnerContactValues =
|
||||
$"SELECT " +
|
||||
$"\"Id\" AS \"Key\", " +
|
||||
$"\"Name\" AS \"Name\" " +
|
||||
$"\"FullName\" AS \"Name\" " +
|
||||
$"FROM \"{FullNameTable(TableNameEnum.PartnerContact)}\" " +
|
||||
$"WHERE " +
|
||||
$"(\"PartnerId\" = @param0 OR @param0 IS NULL) " +
|
||||
$"AND \"IsActive\" = 'true' " +
|
||||
$"ORDER BY \"Name\";";
|
||||
$"ORDER BY \"FullName\";";
|
||||
|
||||
public static string TenantValues =
|
||||
$"SELECT * FROM (" +
|
||||
|
|
@ -146,18 +113,18 @@ public static class LookupQueryValues
|
|||
$"GROUP BY \"Name\" " +
|
||||
$"ORDER BY \"Name\";";
|
||||
|
||||
public static string TownshipValues =
|
||||
public static string StreetValues =
|
||||
$"SELECT " +
|
||||
$"\"Township\" AS \"Key\", " +
|
||||
$"\"Township\" AS \"Name\" " +
|
||||
$"\"Street\" AS \"Key\", " +
|
||||
$"\"Street\" 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 \"Township\" " +
|
||||
$"ORDER BY \"Township\";";
|
||||
$"GROUP BY \"Street\" " +
|
||||
$"ORDER BY \"Street\";";
|
||||
|
||||
public static string RoleValues =
|
||||
$"SELECT " +
|
||||
|
|
@ -236,33 +203,4 @@ 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\";";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 Currency { get; set; }
|
||||
public string CurrencyCode { get; set; }
|
||||
public int PhoneCode { get; set; }
|
||||
public string TaxLabel { get; set; }
|
||||
public bool ZipRequired { get; set; }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ public class DemoDto : FullAuditedEntityDto<Guid>
|
|||
{
|
||||
public Guid? TenantId { get; set; }
|
||||
public string OrganizationName { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string FullName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string Address { get; set; }
|
||||
|
|
|
|||
|
|
@ -9,4 +9,6 @@ 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; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,4 +6,5 @@ namespace Erp.Platform.Sectors;
|
|||
public class SectorDto : AuditedEntityDto<Guid>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string FullName { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class CustomTenantDto
|
|||
public string Country { get; set; }
|
||||
public string City { get; set; }
|
||||
public string District { get; set; }
|
||||
public string Township { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string Address1 { get; set; }
|
||||
public string Address2 { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
|||
Organizer = new EventOrganizerDto
|
||||
{
|
||||
Id = employee.Id,
|
||||
Name = employee.Name,
|
||||
Name = employee.FullName,
|
||||
Position = employee.JobPosition.Name,
|
||||
Avatar = employee.Avatar
|
||||
},
|
||||
|
|
@ -387,7 +387,7 @@ public class IntranetAppService : PlatformAppService, IIntranetAppService
|
|||
Employee = new EventOrganizerDto
|
||||
{
|
||||
Id = commentAuthor.Id,
|
||||
Name = commentAuthor.Name,
|
||||
Name = commentAuthor.FullName,
|
||||
Position = commentAuthor.JobPosition.Name,
|
||||
Avatar = commentAuthor.Avatar
|
||||
},
|
||||
|
|
|
|||
|
|
@ -151,14 +151,6 @@ 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;
|
||||
|
|
|
|||
|
|
@ -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.SetTownship(input.Data.Township);
|
||||
entity.SetStreet(input.Data.Street);
|
||||
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.SetTownship(input.Data.Township);
|
||||
entity.SetStreet(input.Data.Street);
|
||||
entity.SetAddress1(input.Data.Address1);
|
||||
entity.SetAddress2(input.Data.Address2);
|
||||
entity.SetPostalCode(input.Data.PostalCode);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using Volo.Abp.PermissionManagement;
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Erp.Platform.PermissionManagement;
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class PublicAppService : PlatformAppService
|
|||
|
||||
var bodyBuilder = new StringBuilder();
|
||||
bodyBuilder.AppendLine($"Şirket: {input.OrganizationName}");
|
||||
bodyBuilder.AppendLine($"Ad Soyad: {input.Name}");
|
||||
bodyBuilder.AppendLine($"Ad Soyad: {input.FullName}");
|
||||
bodyBuilder.AppendLine($"E-Posta: {input.Email}");
|
||||
bodyBuilder.AppendLine($"Telefon: {input.PhoneNumber}");
|
||||
bodyBuilder.AppendLine($"Adres: {input.Address}");
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class PlatformTenantAppService : TenantAppService, IPlatformTenantAppServ
|
|||
dto.Country = tenant.GetCountry();
|
||||
dto.City = tenant.GetCity();
|
||||
dto.District = tenant.GetDistrict();
|
||||
dto.Township = tenant.GetTownship();
|
||||
dto.Street = tenant.GetStreet();
|
||||
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
|
|
@ -1,10 +1,7 @@
|
|||
{
|
||||
"AiBots": [
|
||||
{
|
||||
"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
|
||||
"BotName": "Chat Bot"
|
||||
}
|
||||
],
|
||||
"Settings": [
|
||||
|
|
@ -242,15 +239,7 @@
|
|||
"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.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"
|
||||
"dx.material.teal.dark.compact": "App.Setting.material.teal.dark.compact"
|
||||
},
|
||||
"order": 3
|
||||
},
|
||||
|
|
|
|||
|
|
@ -27,9 +27,6 @@ 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
|
||||
|
|
@ -288,12 +285,14 @@ 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,
|
||||
item.Currency,
|
||||
currency != null ? currency.Id : null,
|
||||
item.PhoneCode,
|
||||
item.TaxLabel
|
||||
));
|
||||
|
|
@ -387,11 +386,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 })
|
||||
.Select(d => new { d.Country, d.City, d.Name, d.Township, d.Street, d.ZipCode })
|
||||
.ToListAsync();
|
||||
|
||||
var existingSet = existingDistricts
|
||||
.Select(d => $"{d.Country}:{d.City}:{d.Name}:{d.Township}")
|
||||
.Select(d => $"{d.Country}:{d.City}:{d.Name}:{d.Township}:{d.Street}:{d.ZipCode}")
|
||||
.ToHashSet();
|
||||
|
||||
var options = new JsonSerializerOptions
|
||||
|
|
@ -407,7 +406,7 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
{
|
||||
if (item == null) continue;
|
||||
|
||||
var key = $"{item.Country}:{item.Country}.{item.City}:{item.Name}:{item.Township}";
|
||||
var key = $"{item.Country}:{item.Country}.{item.City}:{item.Name}:{item.Township}:{item.Street}:{item.ZipCode}";
|
||||
var city = $"{item.Country}.{item.City}";
|
||||
if (existingSet.Contains(key)) continue;
|
||||
|
||||
|
|
@ -416,7 +415,9 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
item.Country,
|
||||
city,
|
||||
item.Name,
|
||||
item.Township
|
||||
item.Township,
|
||||
item.Street,
|
||||
item.ZipCode
|
||||
));
|
||||
|
||||
if (buffer.Count >= 5000) // 3. Batch
|
||||
|
|
@ -677,9 +678,6 @@ 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
|
|
@ -43,29 +43,27 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
|
||||
public async Task SeedAsync(DataSeedContext context)
|
||||
{
|
||||
var utils = new SeederUtils(_listFormRepository, _listFormFieldRepository);
|
||||
var listFormName = String.Empty;
|
||||
using var utils = new SeederUtils();
|
||||
|
||||
#region Bank
|
||||
listFormName = AppCodes.Accounting.Bank;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Bank))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
Description = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Bank,
|
||||
Name = AppCodes.Accounting.Bank,
|
||||
Title = AppCodes.Accounting.Bank,
|
||||
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",
|
||||
|
|
@ -78,18 +76,18 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Accounting.Bank),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Bank)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 400, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Accounting.Bank, 600, 600, 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 = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
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 },
|
||||
|
|
@ -107,8 +105,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
Text ="Manage",
|
||||
UrlTarget="_blank",
|
||||
AuthName = AppCodes.Accounting.BankAccount,
|
||||
Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id",
|
||||
IsVisible = true
|
||||
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Bank)}/@Id"
|
||||
},
|
||||
}),
|
||||
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||
|
|
@ -159,12 +156,14 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Code",
|
||||
Width = 200,
|
||||
FieldName = "Name",
|
||||
Width = 150,
|
||||
ListOrderNo = 3,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
SortIndex = 1,
|
||||
SortDirection = GridColumnOptions.SortOrderAsc,
|
||||
AllowSearch = true,
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
|
|
@ -175,14 +174,12 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Name",
|
||||
Width = 200,
|
||||
FieldName = "IdentifierCode",
|
||||
Width = 150,
|
||||
ListOrderNo = 4,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
SortIndex = 1,
|
||||
SortDirection = GridColumnOptions.SortOrderAsc,
|
||||
AllowSearch = true,
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
|
|
@ -236,7 +233,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
DisplayExpr = "Name",
|
||||
ValueExpr = "Key",
|
||||
LookupQuery = LookupQueryValues.CountryValues,
|
||||
CascadeEmptyFields = "City,District,Township"
|
||||
CascadeEmptyFields = "City,District,Street"
|
||||
}),
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
|
|
@ -262,7 +259,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
CascadeRelationField = "Country",
|
||||
CascadeFilterOperator="=",
|
||||
CascadeParentFields = "Country",
|
||||
CascadeEmptyFields = "District,Township"
|
||||
CascadeEmptyFields = "District,Street"
|
||||
}),
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
|
|
@ -288,7 +285,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
CascadeRelationField = "City",
|
||||
CascadeFilterOperator="=",
|
||||
CascadeParentFields = "Country,City",
|
||||
CascadeEmptyFields = "Township",
|
||||
CascadeEmptyFields = "Street",
|
||||
}),
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
|
|
@ -330,7 +327,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Email",
|
||||
Width = 200,
|
||||
Width = 150,
|
||||
ListOrderNo = 12,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
|
|
@ -347,25 +344,24 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
#endregion
|
||||
|
||||
#region BankAccount
|
||||
listFormName = AppCodes.Accounting.BankAccount;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BankAccount))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = true,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.BankAccount,
|
||||
Name = AppCodes.Accounting.BankAccount,
|
||||
Title = AppCodes.Accounting.BankAccount,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Accounting.BankAccount,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.BankAccount)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -378,25 +374,24 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Accounting.BankAccount),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.BankAccount)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 300, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Accounting.BankAccount, 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 = "Currency", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order = 3, DataField = "CurrencyId", 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 = "Currency", FieldDbType = DbType.String, Value = "TRY", CustomValueType = FieldCustomValueTypeEnum.Value }
|
||||
new() { FieldName = "CanTransferMoney", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }
|
||||
}),
|
||||
}, autoSave: true
|
||||
);
|
||||
|
|
@ -457,15 +452,15 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
new() {
|
||||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Currency",
|
||||
SourceDbType = DbType.Guid,
|
||||
FieldName = "CurrencyId",
|
||||
Width = 150,
|
||||
ListOrderNo = 4,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Code", "Name"),
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Currency), "Id", "Name"),
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson
|
||||
|
|
@ -491,14 +486,15 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
|
|||
#endregion
|
||||
|
||||
// Bank ve Bank Account arasında Sub Forms ilişkisinin kurulması
|
||||
await utils.CloneFormLayoutAsync(
|
||||
AppCodes.Accounting.Bank,
|
||||
JsonSerializer.Serialize(
|
||||
new List<dynamic>() {
|
||||
await utils.CloneListFormWithFieldsAsync(
|
||||
_listFormRepository,
|
||||
_listFormFieldRepository,
|
||||
ListFormCodes.Lists.Bank,
|
||||
JsonSerializer.Serialize(new List<dynamic>() {
|
||||
new {
|
||||
TabTitle = "Bank Accounts",
|
||||
TabType = ListFormTabTypeEnum.List,
|
||||
TabTitle = AppCodes.Accounting.BankAccount,
|
||||
Code = AppCodes.Accounting.BankAccount,
|
||||
Code = ListFormCodes.Lists.BankAccount,
|
||||
Relation = new List<dynamic>() {
|
||||
new {
|
||||
ParentFieldName = "Id",
|
||||
|
|
@ -507,523 +503,8 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -43,29 +43,27 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
|
||||
public async Task SeedAsync(DataSeedContext context)
|
||||
{
|
||||
var utils = new SeederUtils(_listFormRepository, _listFormFieldRepository);
|
||||
var listFormName = String.Empty;
|
||||
using var utils = new SeederUtils();
|
||||
|
||||
#region Program
|
||||
listFormName = AppCodes.Definitions.Program;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Program))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Program,
|
||||
Name = AppCodes.Definitions.Program,
|
||||
Title = AppCodes.Definitions.Program,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.Program,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Program)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -78,11 +76,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Program),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Program)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Program, 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 },
|
||||
|
|
@ -148,8 +146,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,
|
||||
|
|
@ -162,25 +160,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region Schedule
|
||||
listFormName = AppCodes.Definitions.Schedule;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Schedule))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Schedule,
|
||||
Name = AppCodes.Definitions.Schedule,
|
||||
Title = AppCodes.Definitions.Schedule,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = true,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.Schedule,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Schedule)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -193,11 +190,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Schedule),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Schedule)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 750, 400, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Schedule, 750, 400, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
||||
new() {
|
||||
Order = 1, ColCount = 2, ColSpan = 1, ItemType = "group",
|
||||
|
|
@ -312,8 +309,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,
|
||||
|
|
@ -557,25 +554,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region RegistrationType
|
||||
listFormName = AppCodes.Definitions.RegistrationType;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RegistrationType))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.RegistrationType,
|
||||
Name = AppCodes.Definitions.RegistrationType,
|
||||
Title = AppCodes.Definitions.RegistrationType,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = true,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.RegistrationType,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.RegistrationType)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -588,11 +584,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.RegistrationType),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.RegistrationType)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.RegistrationType, 500, 300, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() {
|
||||
|
|
@ -690,8 +686,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,
|
||||
|
|
@ -704,25 +700,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region RegistrationMethod
|
||||
listFormName = AppCodes.Definitions.RegistrationMethod;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RegistrationMethod))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.RegistrationMethod,
|
||||
Name = AppCodes.Definitions.RegistrationMethod,
|
||||
Title = AppCodes.Definitions.RegistrationMethod,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = true,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.RegistrationMethod,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.RegistrationMethod)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -735,11 +730,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.RegistrationMethod),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.RegistrationMethod)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 550, 350, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.RegistrationMethod, 550, 350, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() {
|
||||
|
|
@ -864,8 +859,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,
|
||||
|
|
@ -878,25 +873,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region ClassType
|
||||
listFormName = AppCodes.Definitions.ClassType;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ClassType))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.ClassType,
|
||||
Name = AppCodes.Definitions.ClassType,
|
||||
Title = AppCodes.Definitions.ClassType,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = true,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.ClassType,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ClassType)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -909,11 +903,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.ClassType),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ClassType)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 400, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.ClassType, 600, 400, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() {
|
||||
|
|
@ -1073,8 +1067,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,
|
||||
|
|
@ -1087,25 +1081,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region Class
|
||||
listFormName = AppCodes.Definitions.Class;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Class))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Class,
|
||||
Name = AppCodes.Definitions.Class,
|
||||
Title = AppCodes.Definitions.Class,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = true,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.Class,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Class)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1118,11 +1111,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Class),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Class)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 550, 300, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Class, 550, 300, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() {
|
||||
|
|
@ -1247,8 +1240,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,
|
||||
|
|
@ -1261,25 +1254,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region Level
|
||||
listFormName = AppCodes.Definitions.Level;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Level))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Level,
|
||||
Name = AppCodes.Definitions.Level,
|
||||
Title = AppCodes.Definitions.Level,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = true,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.Level,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Level)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1292,11 +1284,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Level),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Level)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 650, 450, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(ListFormCodes.Lists.Level, 650, 450, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() {
|
||||
|
|
@ -1534,25 +1526,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region ClassCancellationReason
|
||||
listFormName = AppCodes.Definitions.ClassCancellationReason;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ClassCancellationReason))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.ClassCancellationReason,
|
||||
Name = AppCodes.Definitions.ClassCancellationReason,
|
||||
Title = AppCodes.Definitions.ClassCancellationReason,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.ClassCancellationReason,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ClassCancellationReason)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1565,11 +1556,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.ClassCancellationReason),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ClassCancellationReason)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.ClassCancellationReason, 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 },
|
||||
|
|
@ -1649,25 +1640,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region LessonPeriod
|
||||
listFormName = AppCodes.Definitions.LessonPeriod;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.LessonPeriod))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.LessonPeriod,
|
||||
Name = AppCodes.Definitions.LessonPeriod,
|
||||
Title = AppCodes.Definitions.LessonPeriod,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = true,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.LessonPeriod,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.LessonPeriod)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1680,11 +1670,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.LessonPeriod),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.LessonPeriod)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 500, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.LessonPeriod, 600, 500, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() {
|
||||
|
|
@ -1889,25 +1879,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region QuestionTag
|
||||
listFormName = AppCodes.Definitions.QuestionTag;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.QuestionTag))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.QuestionTag,
|
||||
Name = AppCodes.Definitions.QuestionTag,
|
||||
Title = AppCodes.Definitions.QuestionTag,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.QuestionTag,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuestionTag)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1920,11 +1909,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.QuestionTag),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.QuestionTag)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.QuestionTag, 500, 250, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
||||
new() {
|
||||
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=
|
||||
|
|
@ -2010,25 +1999,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region Question Pool
|
||||
listFormName = AppCodes.Definitions.QuestionPool;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.QuestionPool))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.QuestionPool,
|
||||
Name = AppCodes.Definitions.QuestionPool,
|
||||
Title = AppCodes.Definitions.QuestionPool,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.QuestionPool,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.QuestionPool)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -2041,11 +2029,11 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.QuestionPool),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.QuestionPool)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.QuestionPool, 500, 250, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
||||
new() {
|
||||
Order=1, ColCount=1, ColSpan=1,ItemType="group", Items= [
|
||||
|
|
@ -2061,8 +2049,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
Text ="Questions",
|
||||
UrlTarget="_blank",
|
||||
AuthName = AppCodes.Definitions.Question,
|
||||
Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id",
|
||||
IsVisible = true,
|
||||
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.QuestionPool)}/@Id",
|
||||
},
|
||||
}),
|
||||
}, autoSave: true
|
||||
|
|
@ -2141,25 +2128,24 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region Question
|
||||
listFormName = AppCodes.Definitions.Question;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Question))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = true,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Question,
|
||||
Name = AppCodes.Definitions.Question,
|
||||
Title = AppCodes.Definitions.Question,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.Question,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Question)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -2172,20 +2158,21 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
GroupPanelJson = DefaultGroupPanelJson,
|
||||
SelectionJson = DefaultSelectionSingleJson,
|
||||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Question),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Question)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 520, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Question, 500, 520, true, true, true, true, false),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||
CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] {
|
||||
new() {
|
||||
Hint = "Answers",
|
||||
Text = "Answers",
|
||||
AuthName = listFormName,
|
||||
AuthName = AppCodes.Definitions.Question,
|
||||
DialogName = "QuestionAnswers",
|
||||
DialogParameters = JsonSerializer.Serialize(new { id = "@Id" }),
|
||||
IsVisible = true
|
||||
DialogParameters = JsonSerializer.Serialize(new {
|
||||
id = "@Id"
|
||||
})
|
||||
},
|
||||
}),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
|
||||
|
|
@ -2423,13 +2410,15 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
|
|||
}
|
||||
|
||||
// QuestionPool ve Question arasında Sub Forms ilişkisinin kurulması
|
||||
await utils.CloneFormLayoutAsync(
|
||||
AppCodes.Definitions.QuestionPool,
|
||||
await utils.CloneListFormWithFieldsAsync(
|
||||
_listFormRepository,
|
||||
_listFormFieldRepository,
|
||||
ListFormCodes.Lists.QuestionPool,
|
||||
JsonSerializer.Serialize(new List<dynamic>() {
|
||||
new {
|
||||
TabTitle = AppCodes.Definitions.Question,
|
||||
TabTitle = "Questions",
|
||||
TabType = ListFormTabTypeEnum.List,
|
||||
Code = AppCodes.Definitions.Question,
|
||||
Code = ListFormCodes.Lists.Question,
|
||||
Relation = new List<dynamic>() {
|
||||
new {
|
||||
ParentFieldName = "Id",
|
||||
|
|
@ -2440,7 +2429,6 @@ 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
|
|
@ -43,29 +43,27 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
|
||||
public async Task SeedAsync(DataSeedContext context)
|
||||
{
|
||||
var utils = new SeederUtils(_listFormRepository, _listFormFieldRepository);
|
||||
var listFormName = String.Empty;
|
||||
using var utils = new SeederUtils();
|
||||
|
||||
#region EventType
|
||||
listFormName = AppCodes.Intranet.EventType;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.EventType))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.EventType,
|
||||
Name = AppCodes.Intranet.EventType,
|
||||
Title = AppCodes.Intranet.EventType,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.EventType,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventType)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -74,15 +72,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.EventType),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.EventType)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.EventType, 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 },
|
||||
|
|
@ -133,25 +131,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region EventCategory
|
||||
listFormName = AppCodes.Intranet.EventCategory;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.EventCategory))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.EventCategory,
|
||||
Name = AppCodes.Intranet.EventCategory,
|
||||
Title = AppCodes.Intranet.EventCategory,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.EventCategory,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventCategory)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -160,15 +157,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.EventCategory),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.EventCategory)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.EventCategory, 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 },
|
||||
|
|
@ -219,25 +216,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region Event
|
||||
listFormName = AppCodes.Intranet.Event;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Event))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Event,
|
||||
Name = AppCodes.Intranet.Event,
|
||||
Title = AppCodes.Intranet.Event,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.Event,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Event)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -246,15 +242,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Event),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Event)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 400, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Event, 500, 400, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() {
|
||||
|
|
@ -399,7 +395,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson
|
||||
|
|
@ -468,25 +464,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region Meal
|
||||
listFormName = AppCodes.Intranet.Meal;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Meal))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Meal,
|
||||
Name = AppCodes.Intranet.Meal,
|
||||
Title = AppCodes.Intranet.Meal,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = true,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.Meal,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Meal)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -495,16 +490,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Meal),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Meal)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Meal, 500, 300, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() {
|
||||
|
|
@ -658,25 +653,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region Reservations
|
||||
listFormName = AppCodes.Intranet.Reservation;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Reservation))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Reservation,
|
||||
Name = AppCodes.Intranet.Reservation,
|
||||
Title = AppCodes.Intranet.Reservation,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.Reservation,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Reservation)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -685,15 +679,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Reservation),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Reservation)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 400, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Reservation, 500, 400, true, true, true, true, false),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
|
|
@ -790,7 +784,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
|
|
@ -908,25 +902,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region Shuttle Routes
|
||||
listFormName = AppCodes.Intranet.ShuttleRoute;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ShuttleRoute))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.ShuttleRoute,
|
||||
Name = AppCodes.Intranet.ShuttleRoute,
|
||||
Title = AppCodes.Intranet.ShuttleRoute,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.ShuttleRoute,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ShuttleRoute)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -935,15 +928,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.ShuttleRoute),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.ShuttleRoute)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 300, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.ShuttleRoute, 500, 300, true, true, true, true, false),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
|
|
@ -1135,25 +1128,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region Announncements
|
||||
listFormName = AppCodes.Intranet.Announcement;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Announcement))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Announcement,
|
||||
Name = AppCodes.Intranet.Announcement,
|
||||
Title = AppCodes.Intranet.Announcement,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.Announcement,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Announcement)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1162,15 +1154,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Announcement),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Announcement)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 600, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Announcement, 500, 600, true, true, true, true, false),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
|
|
@ -1317,7 +1309,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
|
|
@ -1406,25 +1398,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region Visitors
|
||||
listFormName = AppCodes.Intranet.Visitor;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Visitor))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Visitor,
|
||||
Name = AppCodes.Intranet.Visitor,
|
||||
Title = AppCodes.Intranet.Visitor,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.Visitor,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Visitor)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1433,21 +1424,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.Visitor),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Visitor)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 450, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.Visitor, 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 = "Name", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 1, DataField = "FullName", 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 },
|
||||
|
|
@ -1490,7 +1481,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
ListFormCode = listForm.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Name",
|
||||
FieldName = "FullName",
|
||||
Width = 150,
|
||||
ListOrderNo = 2,
|
||||
Visible = true,
|
||||
|
|
@ -1624,7 +1615,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
PivotSettingsJson = DefaultPivotSettingsJson
|
||||
|
|
@ -1661,25 +1652,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region Social Post
|
||||
listFormName = AppCodes.Intranet.SocialPost;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SocialPost))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.SocialPost,
|
||||
Name = AppCodes.Intranet.SocialPost,
|
||||
Title = AppCodes.Intranet.SocialPost,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.SocialPost,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPost)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1688,15 +1678,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.SocialPost),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.SocialPost)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 700, 600, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.SocialPost, 700, 600, true, true, true, true, false),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
|
|
@ -1714,9 +1704,8 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
Hint = "Comments",
|
||||
Text ="Comments",
|
||||
UrlTarget="_blank",
|
||||
AuthName = listFormName,
|
||||
Url=$"/admin/form/{SeederUtils.GetDefaultFormCodes(listFormName)}/@Id",
|
||||
IsVisible = true,
|
||||
AuthName = AppCodes.Intranet.SocialComment,
|
||||
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.SocialComment)}/@Id",
|
||||
},
|
||||
}),
|
||||
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[]
|
||||
|
|
@ -1757,7 +1746,7 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "Name"),
|
||||
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"),
|
||||
ValidationRuleJson = DefaultValidationRuleRequiredJson,
|
||||
ColumnCustomizationJson = DefaultColumnCustomizationJson,
|
||||
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
|
||||
|
|
@ -1830,25 +1819,24 @@ public class ListFormSeeder_Intranet : IDataSeedContributor, ITransientDependenc
|
|||
#endregion
|
||||
|
||||
#region Social Comment
|
||||
listFormName = AppCodes.Intranet.SocialComment;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SocialComment))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.SocialComment,
|
||||
Name = AppCodes.Intranet.SocialComment,
|
||||
Title = AppCodes.Intranet.SocialComment,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Intranet.SocialComment,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialComment)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -1857,15 +1845,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Intranet.SocialComment),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.SocialComment)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Intranet.SocialComment, 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
File diff suppressed because it is too large
Load diff
|
|
@ -43,28 +43,25 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
|
|||
|
||||
public async Task SeedAsync(DataSeedContext context)
|
||||
{
|
||||
var listFormName = String.Empty;
|
||||
|
||||
#region MeetingMethod
|
||||
listFormName = AppCodes.Definitions.MeetingMethod;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.MeetingMethod))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.MeetingMethod,
|
||||
Name = AppCodes.Definitions.MeetingMethod,
|
||||
Title = AppCodes.Definitions.MeetingMethod,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.MeetingMethod,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.MeetingMethod)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -73,15 +70,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.MeetingMethod),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.MeetingMethod)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.MeetingMethod, 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 },
|
||||
|
|
@ -190,25 +187,24 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region MeetingResult
|
||||
listFormName = AppCodes.Definitions.MeetingResult;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.MeetingResult))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.MeetingResult,
|
||||
Name = AppCodes.Definitions.MeetingResult,
|
||||
Title = AppCodes.Definitions.MeetingResult,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.MeetingResult,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.MeetingResult)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -217,15 +213,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.MeetingResult),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.MeetingResult)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.MeetingResult, 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 },
|
||||
|
|
@ -323,25 +319,24 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region Source
|
||||
listFormName = AppCodes.Definitions.Source;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Source))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Source,
|
||||
Name = AppCodes.Definitions.Source,
|
||||
Title = AppCodes.Definitions.Source,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.Source,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Source)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -350,15 +345,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Source),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Source)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Source, 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 },
|
||||
|
|
@ -438,25 +433,24 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region Interesting
|
||||
listFormName = AppCodes.Definitions.Interesting;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Interesting))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.Interesting,
|
||||
Name = AppCodes.Definitions.Interesting,
|
||||
Title = AppCodes.Definitions.Interesting,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.Interesting,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Interesting)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -465,15 +459,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.Interesting),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Interesting)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.Interesting, 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 },
|
||||
|
|
@ -553,25 +547,24 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region SalesRejectionReason
|
||||
listFormName = AppCodes.Definitions.SalesRejectionReason;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SalesRejectionReason))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.SalesRejectionReason,
|
||||
Name = AppCodes.Definitions.SalesRejectionReason,
|
||||
Title = AppCodes.Definitions.SalesRejectionReason,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.SalesRejectionReason,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SalesRejectionReason)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -580,15 +573,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.SalesRejectionReason),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.SalesRejectionReason)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.SalesRejectionReason, 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 },
|
||||
|
|
@ -700,25 +693,24 @@ public class ListFormSeeder_Participant : IDataSeedContributor, ITransientDepend
|
|||
#endregion
|
||||
|
||||
#region NoteType
|
||||
listFormName = AppCodes.Definitions.NoteType;
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.NoteType))
|
||||
{
|
||||
var listForm = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson,
|
||||
ListFormType = ListFormTypeEnum.List,
|
||||
IsSubForm = false,
|
||||
ShowNote = true,
|
||||
LayoutJson = DefaultLayoutJson(),
|
||||
LayoutJson = DefaultLayoutJson,
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = listFormName,
|
||||
Name = listFormName,
|
||||
Title = listFormName,
|
||||
ListFormCode = ListFormCodes.Lists.NoteType,
|
||||
Name = AppCodes.Definitions.NoteType,
|
||||
Title = AppCodes.Definitions.NoteType,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = true,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = listFormName,
|
||||
Description = AppCodes.Definitions.NoteType,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.NoteType)),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -727,16 +719,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(listFormName),
|
||||
PermissionJson = DefaultPermissionJson(AppCodes.Definitions.NoteType),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.NoteType)),
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Definitions.NoteType, 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
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,185 @@
|
|||
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
|
|
@ -60,31 +60,19 @@ public static class SeederDefaults
|
|||
AllowColumnResizing = true,
|
||||
AllowColumnReordering = true,
|
||||
ColumnResizingMode = "widget",
|
||||
FocusRowEnabled = true,
|
||||
});
|
||||
public static string DefaultLayoutJson(string DefaultLayout = "grid") => JsonSerializer.Serialize(new LayoutDto()
|
||||
public static readonly string DefaultLayoutJson = JsonSerializer.Serialize(new LayoutDto()
|
||||
{
|
||||
Grid = true,
|
||||
Card = true,
|
||||
Pivot = true,
|
||||
Chart = true,
|
||||
Tree = true,
|
||||
Gantt = true,
|
||||
Scheduler = true,
|
||||
DefaultLayout = DefaultLayout,
|
||||
DefaultLayout = "grid",
|
||||
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.SelectionModeNone,
|
||||
Mode = GridOptions.SelectionModeSingle,
|
||||
AllowSelectAll = false
|
||||
});
|
||||
public static readonly string DefaultSelectionMultipleJson = JsonSerializer.Serialize(new SelectionDto
|
||||
|
|
@ -93,11 +81,11 @@ public static class SeederDefaults
|
|||
Mode = GridOptions.SelectionModeMultiple,
|
||||
SelectAllMode = GridOptions.SelectionAllModeAllPages
|
||||
});
|
||||
public static string DefaultTreeOptionJson(string KeyExpr, string ParentIdExpr, bool AutoExpandAll = true, object RootValue = null) => JsonSerializer.Serialize(new TreeOptionDto
|
||||
public static string DefaultTreeOptionJson(string KeyExpr, string ParentIdExpr, bool AutoExpandAll = true) => JsonSerializer.Serialize(new TreeOptionDto
|
||||
{
|
||||
KeyExpr = KeyExpr,
|
||||
ParentIdExpr = ParentIdExpr,
|
||||
RootValue = RootValue,
|
||||
RootValue = null,
|
||||
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
Loading…
Reference in a new issue