diff --git a/api/src/Erp.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsEditDto.cs b/api/src/Erp.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsEditDto.cs index 390dd366..94c44615 100644 --- a/api/src/Erp.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsEditDto.cs +++ b/api/src/Erp.Platform.Application.Contracts/ListForms/GridOptionsDto/GridOptionsEditDto.cs @@ -33,6 +33,8 @@ public class GridOptionsEditDto : GridOptionsDto } public string DeleteCommand { get; set; } + public string BeforeDeleteCommand { get; set; } + public string AfterDeleteCommand { get; set; } [JsonIgnore] public string DeleteFieldsDefaultValueJson { get; set; } public List DeleteFieldsDefaultValueDto @@ -48,6 +50,8 @@ public class GridOptionsEditDto : GridOptionsDto } public string InsertCommand { get; set; } + public string BeforeInsertCommand { get; set; } + public string AfterInsertCommand { get; set; } [JsonIgnore] public string InsertFieldsDefaultValueJson { get; set; } public List InsertFieldsDefaultValueDto @@ -63,6 +67,8 @@ public class GridOptionsEditDto : GridOptionsDto } public string UpdateCommand { get; set; } + public string BeforeUpdateCommand { get; set; } + public string AfterUpdateCommand { get; set; } [JsonIgnore] public string UpdateFieldsDefaultValueJson { get; set; } public List UpdateFieldsDefaultValueDto diff --git a/api/src/Erp.Platform.Application/ListForms/Administration/ListFormsAppService.cs b/api/src/Erp.Platform.Application/ListForms/Administration/ListFormsAppService.cs index 50e082d7..ada197fa 100644 --- a/api/src/Erp.Platform.Application/ListForms/Administration/ListFormsAppService.cs +++ b/api/src/Erp.Platform.Application/ListForms/Administration/ListFormsAppService.cs @@ -94,16 +94,22 @@ public class ListFormsAppService : CrudAppService< { item.InsertServiceAddress = input.InsertServiceAddress; item.InsertCommand = input.InsertCommand; + item.BeforeInsertCommand = input.BeforeInsertCommand; + item.AfterInsertCommand = input.AfterInsertCommand; } else if (input.EditType == ListFormEditTabs.Database.Update.UpdateForm) { item.UpdateServiceAddress = input.UpdateServiceAddress; item.UpdateCommand = input.UpdateCommand; + item.BeforeUpdateCommand = input.BeforeUpdateCommand; + item.AfterUpdateCommand = input.AfterUpdateCommand; } else if (input.EditType == ListFormEditTabs.Database.Delete.DeleteForm) { item.DeleteServiceAddress = input.DeleteServiceAddress; item.DeleteCommand = input.DeleteCommand; + item.BeforeDeleteCommand = input.BeforeDeleteCommand; + item.AfterDeleteCommand = input.AfterDeleteCommand; } else if (input.EditType == ListFormEditTabs.PermissionForm) { @@ -154,11 +160,11 @@ public class ListFormsAppService : CrudAppService< 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; diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index c0010c48..56851b94 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -4033,6 +4033,18 @@ "en": "Insert Command", "tr": "Insert T-Sql" }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.BeforeDatabaseInsertCommand", + "en": "Before Insert Command", + "tr": "Before Insert T-Sql" + }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.AfterDatabaseInsertCommand", + "en": "After Insert Command", + "tr": "After Insert T-Sql" + }, { "resourceName": "Platform", "key": "ListForms.ListFormEdit.DatabaseInsertFieldsDefaultValues", @@ -4093,6 +4105,18 @@ "en": "Update Command", "tr": "Update T-Sql" }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.BeforeDatabaseUpdateCommand", + "en": "Before Update Command", + "tr": "Before Update T-Sql" + }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.AfterDatabaseUpdateCommand", + "en": "After Update Command", + "tr": "After Update T-Sql" + }, { "resourceName": "Platform", "key": "ListForms.ListFormEdit.DatabaseUpdateFieldsDefaultValues", @@ -4117,6 +4141,18 @@ "en": "Delete Command", "tr": "Delete T-Sql" }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.BeforeDatabaseDeleteCommand", + "en": "Before Delete Command", + "tr": "Before Delete T-Sql" + }, + { + "resourceName": "Platform", + "key": "ListForms.ListFormEdit.AfterDatabaseDeleteCommand", + "en": "After Delete Command", + "tr": "After Delete T-Sql" + }, { "resourceName": "Platform", "key": "ListForms.ListFormEdit.DatabaseDeleteFieldsDefaultValues", diff --git a/api/src/Erp.Platform.Domain/Entities/Host/ListForm.cs b/api/src/Erp.Platform.Domain/Entities/Host/ListForm.cs index 88f5a2e1..f18d5f87 100644 --- a/api/src/Erp.Platform.Domain/Entities/Host/ListForm.cs +++ b/api/src/Erp.Platform.Domain/Entities/Host/ListForm.cs @@ -67,18 +67,24 @@ public class ListForm : FullAuditedEntity /// Silme yapilacak harici sorgu. icerisinde @ID, @USERID, @USERNAME, @ROLES anahtarlari kullanilabilir. /// public string DeleteCommand { get; set; } + public string BeforeDeleteCommand { get; set; } + public string AfterDeleteCommand { get; set; } /// Guncelleme yapilacak harici sorgu. /// icerisinde @ID, @USERID, @USERNAME, @ROLES ozel anahtarlari kullanilabilir. /// ilaveten tabloya ait butun alanlar icin FieldName onune @ isareti eklenerek guncellenebilir. /// ornegin tablodaki Ad alanini guncellemek icin '@Ad' yazildiginda bu kisim ekrandan gelen deger ile degistirilir /// public string UpdateCommand { get; set; } + public string BeforeUpdateCommand { get; set; } + public string AfterUpdateCommand { get; set; } /// insert yapacak harici sorgu. /// icerisinde @USERID, @USERNAME ozel anahtarlari kullanilabilir. /// ilaveten tabloya ait butun alanlar icin FieldName onune @ isareti eklenerek guncellenebilir. /// ornegin tablodaki Ad alanini guncellemek icin '@Ad' yazildiginda bu kisim ekrandan gelen deger ile degistirilir /// public string InsertCommand { get; set; } + public string BeforeInsertCommand { get; set; } + public string AfterInsertCommand { get; set; } /// Guncelleme islemini yapacak servis adresi /// diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251205115506_Initial.Designer.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251206194239_Initial.Designer.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251205115506_Initial.Designer.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251206194239_Initial.Designer.cs index 14001e8a..d542fe7d 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251205115506_Initial.Designer.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251206194239_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Erp.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251205115506_Initial")] + [Migration("20251206194239_Initial")] partial class Initial { /// @@ -6173,6 +6173,15 @@ namespace Erp.Platform.Migrations b.Property("AdaptiveLayoutJson") .HasColumnType("text"); + b.Property("AfterDeleteCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("AfterInsertCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("AfterUpdateCommand") + .HasColumnType("nvarchar(max)"); + b.Property("AnimationJson") .HasColumnType("text"); @@ -6182,6 +6191,15 @@ namespace Erp.Platform.Migrations b.Property("ArgumentAxisJson") .HasColumnType("text"); + b.Property("BeforeDeleteCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeInsertCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeUpdateCommand") + .HasColumnType("nvarchar(max)"); + b.Property("ColumnOptionJson") .HasColumnType("text"); diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251205115506_Initial.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251206194239_Initial.cs similarity index 99% rename from api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251205115506_Initial.cs rename to api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251206194239_Initial.cs index 8a3673a2..02ccd6ff 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251205115506_Initial.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/20251206194239_Initial.cs @@ -2290,8 +2290,14 @@ namespace Erp.Platform.Migrations CommandColumnJson = table.Column(type: "text", nullable: true), StateStoringJson = table.Column(type: "text", nullable: true), DeleteCommand = table.Column(type: "text", nullable: true), + BeforeDeleteCommand = table.Column(type: "nvarchar(max)", nullable: true), + AfterDeleteCommand = table.Column(type: "nvarchar(max)", nullable: true), UpdateCommand = table.Column(type: "text", nullable: true), + BeforeUpdateCommand = table.Column(type: "nvarchar(max)", nullable: true), + AfterUpdateCommand = table.Column(type: "nvarchar(max)", nullable: true), InsertCommand = table.Column(type: "text", nullable: true), + BeforeInsertCommand = table.Column(type: "nvarchar(max)", nullable: true), + AfterInsertCommand = table.Column(type: "nvarchar(max)", nullable: true), UpdateServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), InsertServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), DeleteServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), diff --git a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index f5efc0e3..b1817be3 100644 --- a/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Erp.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -6170,6 +6170,15 @@ namespace Erp.Platform.Migrations b.Property("AdaptiveLayoutJson") .HasColumnType("text"); + b.Property("AfterDeleteCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("AfterInsertCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("AfterUpdateCommand") + .HasColumnType("nvarchar(max)"); + b.Property("AnimationJson") .HasColumnType("text"); @@ -6179,6 +6188,15 @@ namespace Erp.Platform.Migrations b.Property("ArgumentAxisJson") .HasColumnType("text"); + b.Property("BeforeDeleteCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeInsertCommand") + .HasColumnType("nvarchar(max)"); + + b.Property("BeforeUpdateCommand") + .HasColumnType("nvarchar(max)"); + b.Property("ColumnOptionJson") .HasColumnType("text"); diff --git a/ui/src/proxy/form/models.ts b/ui/src/proxy/form/models.ts index 84ab7a59..68ce8c1e 100644 --- a/ui/src/proxy/form/models.ts +++ b/ui/src/proxy/form/models.ts @@ -632,12 +632,18 @@ export interface GridOptionsEditDto extends GridOptionsDto, Record selectFieldsDefaultValueJson?: string selectFieldsDefaultValueDto: FieldsDefaultValueDto[] deleteCommand?: string + beforeDeleteCommand?: string + afterDeleteCommand?: string deleteFieldsDefaultValueJson?: string deleteFieldsDefaultValueDto: FieldsDefaultValueDto[] insertCommand?: string + beforeInsertCommand?: string + afterInsertCommand?: string insertFieldsDefaultValueJson?: string insertFieldsDefaultValueDto: FieldsDefaultValueDto[] updateCommand?: string + beforeUpdateCommand?: string + afterUpdateCommand?: string updateFieldsDefaultValueJson?: string updateFieldsDefaultValueDto: FieldsDefaultValueDto[] formFieldsDefaultValueJson?: string diff --git a/ui/src/views/admin/listForm/edit/FormTabDatabaseDelete.tsx b/ui/src/views/admin/listForm/edit/FormTabDatabaseDelete.tsx index a17d5fdc..0a93854e 100644 --- a/ui/src/views/admin/listForm/edit/FormTabDatabaseDelete.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabDatabaseDelete.tsx @@ -65,20 +65,57 @@ function FormTabDatabaseDelete({ component={Input} /> - - - + +
+ + + + + + + + + +
+ diff --git a/ui/src/views/admin/listForm/edit/FormTabDatabaseInsert.tsx b/ui/src/views/admin/listForm/edit/FormTabDatabaseInsert.tsx index a72c0613..f7ebe665 100644 --- a/ui/src/views/admin/listForm/edit/FormTabDatabaseInsert.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabDatabaseInsert.tsx @@ -65,20 +65,55 @@ function FormTabDatabaseInsert({ component={Input} /> - - - +
+ + + + + + + + + +
diff --git a/ui/src/views/admin/listForm/edit/FormTabDatabaseUpdate.tsx b/ui/src/views/admin/listForm/edit/FormTabDatabaseUpdate.tsx index 36a12e44..4c61f95c 100644 --- a/ui/src/views/admin/listForm/edit/FormTabDatabaseUpdate.tsx +++ b/ui/src/views/admin/listForm/edit/FormTabDatabaseUpdate.tsx @@ -65,20 +65,57 @@ function FormTabDatabaseUpdate({ component={Input} /> - - - +
+ + + + + + + + + +