Before ve After Command Çalıştırıldı

This commit is contained in:
Sedat Öztürk 2025-12-07 01:03:53 +03:00
parent e54dfe4f98
commit 8fd2d58c0f
14 changed files with 172 additions and 111 deletions

View file

@ -33,8 +33,8 @@ public class GridOptionsEditDto : GridOptionsDto
} }
public string DeleteCommand { get; set; } public string DeleteCommand { get; set; }
public string BeforeDeleteCommand { get; set; } public string DeleteBeforeCommand { get; set; }
public string AfterDeleteCommand { get; set; } public string DeleteAfterCommand { get; set; }
[JsonIgnore] [JsonIgnore]
public string DeleteFieldsDefaultValueJson { get; set; } public string DeleteFieldsDefaultValueJson { get; set; }
public List<FieldsDefaultValueDto> DeleteFieldsDefaultValueDto public List<FieldsDefaultValueDto> DeleteFieldsDefaultValueDto
@ -50,8 +50,8 @@ public class GridOptionsEditDto : GridOptionsDto
} }
public string InsertCommand { get; set; } public string InsertCommand { get; set; }
public string BeforeInsertCommand { get; set; } public string InsertBeforeCommand { get; set; }
public string AfterInsertCommand { get; set; } public string InsertAfterCommand { get; set; }
[JsonIgnore] [JsonIgnore]
public string InsertFieldsDefaultValueJson { get; set; } public string InsertFieldsDefaultValueJson { get; set; }
public List<FieldsDefaultValueDto> InsertFieldsDefaultValueDto public List<FieldsDefaultValueDto> InsertFieldsDefaultValueDto
@ -67,8 +67,8 @@ public class GridOptionsEditDto : GridOptionsDto
} }
public string UpdateCommand { get; set; } public string UpdateCommand { get; set; }
public string BeforeUpdateCommand { get; set; } public string UpdateBeforeCommand { get; set; }
public string AfterUpdateCommand { get; set; } public string UpdateAfterCommand { get; set; }
[JsonIgnore] [JsonIgnore]
public string UpdateFieldsDefaultValueJson { get; set; } public string UpdateFieldsDefaultValueJson { get; set; }
public List<FieldsDefaultValueDto> UpdateFieldsDefaultValueDto public List<FieldsDefaultValueDto> UpdateFieldsDefaultValueDto

View file

@ -94,22 +94,22 @@ public class ListFormsAppService : CrudAppService<
{ {
item.InsertServiceAddress = input.InsertServiceAddress; item.InsertServiceAddress = input.InsertServiceAddress;
item.InsertCommand = input.InsertCommand; item.InsertCommand = input.InsertCommand;
item.BeforeInsertCommand = input.BeforeInsertCommand; item.InsertBeforeCommand = input.InsertBeforeCommand;
item.AfterInsertCommand = input.AfterInsertCommand; item.InsertAfterCommand = input.InsertAfterCommand;
} }
else if (input.EditType == ListFormEditTabs.Database.Update.UpdateForm) else if (input.EditType == ListFormEditTabs.Database.Update.UpdateForm)
{ {
item.UpdateServiceAddress = input.UpdateServiceAddress; item.UpdateServiceAddress = input.UpdateServiceAddress;
item.UpdateCommand = input.UpdateCommand; item.UpdateCommand = input.UpdateCommand;
item.BeforeUpdateCommand = input.BeforeUpdateCommand; item.UpdateBeforeCommand = input.UpdateBeforeCommand;
item.AfterUpdateCommand = input.AfterUpdateCommand; item.UpdateAfterCommand = input.UpdateAfterCommand;
} }
else if (input.EditType == ListFormEditTabs.Database.Delete.DeleteForm) else if (input.EditType == ListFormEditTabs.Database.Delete.DeleteForm)
{ {
item.DeleteServiceAddress = input.DeleteServiceAddress; item.DeleteServiceAddress = input.DeleteServiceAddress;
item.DeleteCommand = input.DeleteCommand; item.DeleteCommand = input.DeleteCommand;
item.BeforeDeleteCommand = input.BeforeDeleteCommand; item.DeleteBeforeCommand = input.DeleteBeforeCommand;
item.AfterDeleteCommand = input.AfterDeleteCommand; item.DeleteAfterCommand = input.DeleteAfterCommand;
} }
else if (input.EditType == ListFormEditTabs.PermissionForm) else if (input.EditType == ListFormEditTabs.PermissionForm)
{ {

View file

@ -1,4 +1,5 @@
using System.Linq; using System;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Erp.Platform.Enums; using Erp.Platform.Enums;
using Erp.Platform.Localization; using Erp.Platform.Localization;
@ -31,7 +32,10 @@ public class ListFormDataAppService : PlatformAppService
if (!await authManager.CanAccess(input.ListFormCode, AuthorizationTypeEnum.Create)) if (!await authManager.CanAccess(input.ListFormCode, AuthorizationTypeEnum.Create))
throw new Volo.Abp.UserFriendlyException(L[AppErrorCodes.NoAuth]); throw new Volo.Abp.UserFriendlyException(L[AppErrorCodes.NoAuth]);
var queryParameters = httpContextAccessor.HttpContext.Request.Query.ToDictionary(x => x.Key, x => x.Value); var httpContext = httpContextAccessor.HttpContext
?? throw new InvalidOperationException("HTTP Context bulunamadı.");
var queryParameters = httpContext.Request.Query.ToDictionary(x => x.Key, x => x.Value);
return await qManager.GenerateAndRunQueryAsync<dynamic>(input.ListFormCode, OperationEnum.Insert, input.Data, queryParameters: queryParameters); return await qManager.GenerateAndRunQueryAsync<dynamic>(input.ListFormCode, OperationEnum.Insert, input.Data, queryParameters: queryParameters);
} }
@ -41,7 +45,10 @@ public class ListFormDataAppService : PlatformAppService
if (!await authManager.CanAccess(input.ListFormCode, AuthorizationTypeEnum.Update)) if (!await authManager.CanAccess(input.ListFormCode, AuthorizationTypeEnum.Update))
throw new Volo.Abp.UserFriendlyException(L[AppErrorCodes.NoAuth]); throw new Volo.Abp.UserFriendlyException(L[AppErrorCodes.NoAuth]);
var queryParameters = httpContextAccessor.HttpContext.Request.Query.ToDictionary(x => x.Key, x => x.Value); var httpContext = httpContextAccessor.HttpContext
?? throw new InvalidOperationException("HTTP Context bulunamadı.");
var queryParameters = httpContext.Request.Query.ToDictionary(x => x.Key, x => x.Value);
return await qManager.GenerateAndRunQueryAsync<int>(input.ListFormCode, OperationEnum.Update, input.Data, input.Keys, queryParameters); return await qManager.GenerateAndRunQueryAsync<int>(input.ListFormCode, OperationEnum.Update, input.Data, input.Keys, queryParameters);
} }
@ -51,7 +58,10 @@ public class ListFormDataAppService : PlatformAppService
if (!await authManager.CanAccess(input.ListFormCode, AuthorizationTypeEnum.Delete)) if (!await authManager.CanAccess(input.ListFormCode, AuthorizationTypeEnum.Delete))
throw new Volo.Abp.UserFriendlyException(L[AppErrorCodes.NoAuth]); throw new Volo.Abp.UserFriendlyException(L[AppErrorCodes.NoAuth]);
var queryParameters = httpContextAccessor.HttpContext.Request.Query.ToDictionary(x => x.Key, x => x.Value); var httpContext = httpContextAccessor.HttpContext
?? throw new InvalidOperationException("HTTP Context bulunamadı.");
var queryParameters = httpContext.Request.Query.ToDictionary(x => x.Key, x => x.Value);
return await qManager.GenerateAndRunQueryAsync<int>(input.ListFormCode, OperationEnum.Delete, input.Data, input.Keys, queryParameters); return await qManager.GenerateAndRunQueryAsync<int>(input.ListFormCode, OperationEnum.Delete, input.Data, input.Keys, queryParameters);
} }
} }

View file

@ -4035,13 +4035,13 @@
}, },
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "ListForms.ListFormEdit.BeforeDatabaseInsertCommand", "key": "ListForms.ListFormEdit.DatabaseInsertBeforeCommand",
"en": "Before Insert Command", "en": "Before Insert Command",
"tr": "Before Insert T-Sql" "tr": "Before Insert T-Sql"
}, },
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "ListForms.ListFormEdit.AfterDatabaseInsertCommand", "key": "ListForms.ListFormEdit.DatabaseInsertAfterCommand",
"en": "After Insert Command", "en": "After Insert Command",
"tr": "After Insert T-Sql" "tr": "After Insert T-Sql"
}, },
@ -4107,13 +4107,13 @@
}, },
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "ListForms.ListFormEdit.BeforeDatabaseUpdateCommand", "key": "ListForms.ListFormEdit.DatabaseUpdateBeforeCommand",
"en": "Before Update Command", "en": "Before Update Command",
"tr": "Before Update T-Sql" "tr": "Before Update T-Sql"
}, },
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "ListForms.ListFormEdit.AfterDatabaseUpdateCommand", "key": "ListForms.ListFormEdit.DatabaseUpdateAfterCommand",
"en": "After Update Command", "en": "After Update Command",
"tr": "After Update T-Sql" "tr": "After Update T-Sql"
}, },
@ -4143,13 +4143,13 @@
}, },
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "ListForms.ListFormEdit.BeforeDatabaseDeleteCommand", "key": "ListForms.ListFormEdit.DatabaseDeleteBeforeCommand",
"en": "Before Delete Command", "en": "Before Delete Command",
"tr": "Before Delete T-Sql" "tr": "Before Delete T-Sql"
}, },
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "ListForms.ListFormEdit.AfterDatabaseDeleteCommand", "key": "ListForms.ListFormEdit.DatabaseDeleteAfterCommand",
"en": "After Delete Command", "en": "After Delete Command",
"tr": "After Delete T-Sql" "tr": "After Delete T-Sql"
}, },

View file

@ -3,8 +3,14 @@
public enum OperationEnum public enum OperationEnum
{ {
Insert, Insert,
InsertBefore,
InsertAfter,
Update, Update,
UpdateBefore,
UpdateAfter,
Delete, Delete,
DeleteBefore,
DeleteAfter,
Select Select
} }

View file

@ -67,24 +67,24 @@ public class ListForm : FullAuditedEntity<Guid>
/// <summary> Silme yapilacak harici sorgu. icerisinde @ID, @USERID, @USERNAME, @ROLES anahtarlari kullanilabilir. /// <summary> Silme yapilacak harici sorgu. icerisinde @ID, @USERID, @USERNAME, @ROLES anahtarlari kullanilabilir.
/// </summary> /// </summary>
public string DeleteCommand { get; set; } public string DeleteCommand { get; set; }
public string BeforeDeleteCommand { get; set; } public string DeleteBeforeCommand { get; set; }
public string AfterDeleteCommand { get; set; } public string DeleteAfterCommand { get; set; }
/// <summary>Guncelleme yapilacak harici sorgu. /// <summary>Guncelleme yapilacak harici sorgu.
/// icerisinde @ID, @USERID, @USERNAME, @ROLES ozel anahtarlari kullanilabilir. /// icerisinde @ID, @USERID, @USERNAME, @ROLES ozel anahtarlari kullanilabilir.
/// ilaveten tabloya ait butun alanlar icin FieldName onune @ isareti eklenerek guncellenebilir. /// 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 /// ornegin tablodaki Ad alanini guncellemek icin '@Ad' yazildiginda bu kisim ekrandan gelen deger ile degistirilir
/// </summary> /// </summary>
public string UpdateCommand { get; set; } public string UpdateCommand { get; set; }
public string BeforeUpdateCommand { get; set; } public string UpdateBeforeCommand { get; set; }
public string AfterUpdateCommand { get; set; } public string UpdateAfterCommand { get; set; }
/// <summary>insert yapacak harici sorgu. /// <summary>insert yapacak harici sorgu.
/// icerisinde @USERID, @USERNAME ozel anahtarlari kullanilabilir. /// icerisinde @USERID, @USERNAME ozel anahtarlari kullanilabilir.
/// ilaveten tabloya ait butun alanlar icin FieldName onune @ isareti eklenerek guncellenebilir. /// 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 /// ornegin tablodaki Ad alanini guncellemek icin '@Ad' yazildiginda bu kisim ekrandan gelen deger ile degistirilir
/// </summary> /// </summary>
public string InsertCommand { get; set; } public string InsertCommand { get; set; }
public string BeforeInsertCommand { get; set; } public string InsertBeforeCommand { get; set; }
public string AfterInsertCommand { get; set; } public string InsertAfterCommand { get; set; }
/// <summary> Guncelleme islemini yapacak servis adresi /// <summary> Guncelleme islemini yapacak servis adresi
/// </summary> /// </summary>

View file

@ -92,11 +92,52 @@ public class QueryManager : PlatformDomainService, IQueryManager
// TODO: Log // TODO: Log
if (op == OperationEnum.Insert) if (op == OperationEnum.Insert)
{ {
return await dynamicDataRepository.ExecuteScalarAsync<T>(sql, connectionString, parameters); if (!string.IsNullOrEmpty(listForm.InsertBeforeCommand))
{
var beforeSql = GenerateQuery(listForm, parameters, OperationEnum.InsertBefore, dataSourceType, keys);
await dynamicDataRepository.ExecuteAsync(beforeSql, connectionString, parameters);
}
var result = await dynamicDataRepository.ExecuteScalarAsync<T>(sql, connectionString, parameters);
if (!string.IsNullOrEmpty(listForm.InsertAfterCommand))
{
var afterSql = GenerateQuery(listForm, parameters, OperationEnum.InsertAfter, dataSourceType, keys);
await dynamicDataRepository.ExecuteAsync(afterSql, connectionString, parameters);
}
return result;
} }
else if (op == OperationEnum.Update || op == OperationEnum.Delete) else if (op == OperationEnum.Update || op == OperationEnum.Delete)
{ {
return (T)(object)await dynamicDataRepository.ExecuteAsync(sql, connectionString, parameters); // Before komutlari varsa calistir
if (op == OperationEnum.Update && !string.IsNullOrEmpty(listForm.UpdateBeforeCommand))
{
var beforeSql = GenerateQuery(listForm, parameters, OperationEnum.UpdateBefore, dataSourceType, keys);
await dynamicDataRepository.ExecuteAsync(beforeSql, connectionString, parameters);
}
else if (op == OperationEnum.Delete && !string.IsNullOrEmpty(listForm.DeleteBeforeCommand))
{
var beforeSql = GenerateQuery(listForm, parameters, OperationEnum.DeleteBefore, dataSourceType, keys);
await dynamicDataRepository.ExecuteAsync(beforeSql, connectionString, parameters);
}
// Ana komutu calistir
var result = (T)(object)await dynamicDataRepository.ExecuteAsync(sql, connectionString, parameters);
// After komutlari varsa calistir
if (op == OperationEnum.Update && !string.IsNullOrEmpty(listForm.UpdateAfterCommand))
{
var afterSql = GenerateQuery(listForm, parameters, OperationEnum.UpdateAfter, dataSourceType, keys);
await dynamicDataRepository.ExecuteAsync(afterSql, connectionString, parameters);
}
else if (op == OperationEnum.Delete && !string.IsNullOrEmpty(listForm.DeleteAfterCommand))
{
var afterSql = GenerateQuery(listForm, parameters, OperationEnum.DeleteAfter, dataSourceType, keys);
await dynamicDataRepository.ExecuteAsync(afterSql, connectionString, parameters);
}
return result;
} }
} }
@ -113,8 +154,14 @@ public class QueryManager : PlatformDomainService, IQueryManager
var command = op switch var command = op switch
{ {
OperationEnum.Insert => listForm.InsertCommand, OperationEnum.Insert => listForm.InsertCommand,
OperationEnum.InsertBefore => listForm.InsertBeforeCommand,
OperationEnum.InsertAfter => listForm.InsertAfterCommand,
OperationEnum.Update => listForm.UpdateCommand, OperationEnum.Update => listForm.UpdateCommand,
OperationEnum.UpdateBefore => listForm.UpdateBeforeCommand,
OperationEnum.UpdateAfter => listForm.UpdateAfterCommand,
OperationEnum.Delete => listForm.DeleteCommand, OperationEnum.Delete => listForm.DeleteCommand,
OperationEnum.DeleteBefore => listForm.DeleteBeforeCommand,
OperationEnum.DeleteAfter => listForm.DeleteAfterCommand,
_ => "", _ => "",
}; };

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Erp.Platform.Migrations namespace Erp.Platform.Migrations
{ {
[DbContext(typeof(PlatformDbContext))] [DbContext(typeof(PlatformDbContext))]
[Migration("20251206194239_Initial")] [Migration("20251206210148_Initial")]
partial class Initial partial class Initial
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -6173,15 +6173,6 @@ namespace Erp.Platform.Migrations
b.Property<string>("AdaptiveLayoutJson") b.Property<string>("AdaptiveLayoutJson")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("AfterDeleteCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("AfterInsertCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("AfterUpdateCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("AnimationJson") b.Property<string>("AnimationJson")
.HasColumnType("text"); .HasColumnType("text");
@ -6191,15 +6182,6 @@ namespace Erp.Platform.Migrations
b.Property<string>("ArgumentAxisJson") b.Property<string>("ArgumentAxisJson")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("BeforeDeleteCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("BeforeInsertCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("BeforeUpdateCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("ColumnOptionJson") b.Property<string>("ColumnOptionJson")
.HasColumnType("text"); .HasColumnType("text");
@ -6252,6 +6234,12 @@ namespace Erp.Platform.Migrations
b.Property<string>("DefaultFilter") b.Property<string>("DefaultFilter")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("DeleteAfterCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("DeleteBeforeCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("DeleteCommand") b.Property<string>("DeleteCommand")
.HasColumnType("text"); .HasColumnType("text");
@ -6310,6 +6298,12 @@ namespace Erp.Platform.Migrations
b.Property<int?>("Height") b.Property<int?>("Height")
.HasColumnType("int"); .HasColumnType("int");
b.Property<string>("InsertAfterCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("InsertBeforeCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("InsertCommand") b.Property<string>("InsertCommand")
.HasColumnType("text"); .HasColumnType("text");
@ -6456,6 +6450,12 @@ namespace Erp.Platform.Migrations
b.Property<string>("TreeOptionJson") b.Property<string>("TreeOptionJson")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("UpdateAfterCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("UpdateBeforeCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("UpdateCommand") b.Property<string>("UpdateCommand")
.HasColumnType("text"); .HasColumnType("text");

View file

@ -2290,14 +2290,14 @@ namespace Erp.Platform.Migrations
CommandColumnJson = table.Column<string>(type: "text", nullable: true), CommandColumnJson = table.Column<string>(type: "text", nullable: true),
StateStoringJson = table.Column<string>(type: "text", nullable: true), StateStoringJson = table.Column<string>(type: "text", nullable: true),
DeleteCommand = table.Column<string>(type: "text", nullable: true), DeleteCommand = table.Column<string>(type: "text", nullable: true),
BeforeDeleteCommand = table.Column<string>(type: "nvarchar(max)", nullable: true), DeleteBeforeCommand = table.Column<string>(type: "nvarchar(max)", nullable: true),
AfterDeleteCommand = table.Column<string>(type: "nvarchar(max)", nullable: true), DeleteAfterCommand = table.Column<string>(type: "nvarchar(max)", nullable: true),
UpdateCommand = table.Column<string>(type: "text", nullable: true), UpdateCommand = table.Column<string>(type: "text", nullable: true),
BeforeUpdateCommand = table.Column<string>(type: "nvarchar(max)", nullable: true), UpdateBeforeCommand = table.Column<string>(type: "nvarchar(max)", nullable: true),
AfterUpdateCommand = table.Column<string>(type: "nvarchar(max)", nullable: true), UpdateAfterCommand = table.Column<string>(type: "nvarchar(max)", nullable: true),
InsertCommand = table.Column<string>(type: "text", nullable: true), InsertCommand = table.Column<string>(type: "text", nullable: true),
BeforeInsertCommand = table.Column<string>(type: "nvarchar(max)", nullable: true), InsertBeforeCommand = table.Column<string>(type: "nvarchar(max)", nullable: true),
AfterInsertCommand = table.Column<string>(type: "nvarchar(max)", nullable: true), InsertAfterCommand = table.Column<string>(type: "nvarchar(max)", nullable: true),
UpdateServiceAddress = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), UpdateServiceAddress = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
InsertServiceAddress = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), InsertServiceAddress = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
DeleteServiceAddress = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), DeleteServiceAddress = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),

View file

@ -6170,15 +6170,6 @@ namespace Erp.Platform.Migrations
b.Property<string>("AdaptiveLayoutJson") b.Property<string>("AdaptiveLayoutJson")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("AfterDeleteCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("AfterInsertCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("AfterUpdateCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("AnimationJson") b.Property<string>("AnimationJson")
.HasColumnType("text"); .HasColumnType("text");
@ -6188,15 +6179,6 @@ namespace Erp.Platform.Migrations
b.Property<string>("ArgumentAxisJson") b.Property<string>("ArgumentAxisJson")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("BeforeDeleteCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("BeforeInsertCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("BeforeUpdateCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("ColumnOptionJson") b.Property<string>("ColumnOptionJson")
.HasColumnType("text"); .HasColumnType("text");
@ -6249,6 +6231,12 @@ namespace Erp.Platform.Migrations
b.Property<string>("DefaultFilter") b.Property<string>("DefaultFilter")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("DeleteAfterCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("DeleteBeforeCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("DeleteCommand") b.Property<string>("DeleteCommand")
.HasColumnType("text"); .HasColumnType("text");
@ -6307,6 +6295,12 @@ namespace Erp.Platform.Migrations
b.Property<int?>("Height") b.Property<int?>("Height")
.HasColumnType("int"); .HasColumnType("int");
b.Property<string>("InsertAfterCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("InsertBeforeCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("InsertCommand") b.Property<string>("InsertCommand")
.HasColumnType("text"); .HasColumnType("text");
@ -6453,6 +6447,12 @@ namespace Erp.Platform.Migrations
b.Property<string>("TreeOptionJson") b.Property<string>("TreeOptionJson")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("UpdateAfterCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("UpdateBeforeCommand")
.HasColumnType("nvarchar(max)");
b.Property<string>("UpdateCommand") b.Property<string>("UpdateCommand")
.HasColumnType("text"); .HasColumnType("text");

View file

@ -632,18 +632,18 @@ export interface GridOptionsEditDto extends GridOptionsDto, Record<string, any>
selectFieldsDefaultValueJson?: string selectFieldsDefaultValueJson?: string
selectFieldsDefaultValueDto: FieldsDefaultValueDto[] selectFieldsDefaultValueDto: FieldsDefaultValueDto[]
deleteCommand?: string deleteCommand?: string
beforeDeleteCommand?: string deleteBeforeCommand?: string
afterDeleteCommand?: string deleteAfterCommand?: string
deleteFieldsDefaultValueJson?: string deleteFieldsDefaultValueJson?: string
deleteFieldsDefaultValueDto: FieldsDefaultValueDto[] deleteFieldsDefaultValueDto: FieldsDefaultValueDto[]
insertCommand?: string insertCommand?: string
beforeInsertCommand?: string insertBeforeCommand?: string
afterInsertCommand?: string insertAfterCommand?: string
insertFieldsDefaultValueJson?: string insertFieldsDefaultValueJson?: string
insertFieldsDefaultValueDto: FieldsDefaultValueDto[] insertFieldsDefaultValueDto: FieldsDefaultValueDto[]
updateCommand?: string updateCommand?: string
beforeUpdateCommand?: string updateBeforeCommand?: string
afterUpdateCommand?: string updateAfterCommand?: string
updateFieldsDefaultValueJson?: string updateFieldsDefaultValueJson?: string
updateFieldsDefaultValueDto: FieldsDefaultValueDto[] updateFieldsDefaultValueDto: FieldsDefaultValueDto[]
formFieldsDefaultValueJson?: string formFieldsDefaultValueJson?: string

View file

@ -83,16 +83,16 @@ function FormTabDatabaseDelete({
/> />
</FormItem> </FormItem>
<FormItem <FormItem
label={translate('::ListForms.ListFormEdit.BeforeDatabaseDeleteCommand')} label={translate('::ListForms.ListFormEdit.DatabaseDeleteBeforeCommand')}
invalid={errors.beforeDeleteCommand && touched.beforeDeleteCommand} invalid={errors.deleteBeforeCommand && touched.deleteBeforeCommand}
errorMessage={errors.beforeDeleteCommand} errorMessage={errors.deleteBeforeCommand}
> >
<Field <Field
type="text" type="text"
autoComplete="off" autoComplete="off"
name="beforeDeleteCommand" name="deleteBeforeCommand"
placeholder={translate( placeholder={translate(
'::ListForms.ListFormEdit.BeforeDatabaseDeleteCommand', '::ListForms.ListFormEdit.DatabaseDeleteBeforeCommand',
)} )}
component={Input} component={Input}
textArea={true} textArea={true}
@ -100,15 +100,15 @@ function FormTabDatabaseDelete({
/> />
</FormItem> </FormItem>
<FormItem <FormItem
label={translate('::ListForms.ListFormEdit.AfterDatabaseDeleteCommand')} label={translate('::ListForms.ListFormEdit.DatabaseDeleteAfterCommand')}
invalid={errors.afterDeleteCommand && touched.afterDeleteCommand} invalid={errors.deleteAfterCommand && touched.deleteAfterCommand}
errorMessage={errors.afterDeleteCommand} errorMessage={errors.deleteAfterCommand}
> >
<Field <Field
type="text" type="text"
autoComplete="off" autoComplete="off"
name="afterDeleteCommand" name="deleteAfterCommand"
placeholder={translate('::ListForms.ListFormEdit.AfterDatabaseDeleteCommand')} placeholder={translate('::ListForms.ListFormEdit.DatabaseDeleteAfterCommand')}
component={Input} component={Input}
textArea={true} textArea={true}
rows={6} rows={6}

View file

@ -82,16 +82,16 @@ function FormTabDatabaseInsert({
/> />
</FormItem> </FormItem>
<FormItem <FormItem
label={translate('::ListForms.ListFormEdit.BeforeDatabaseInsertCommand')} label={translate('::ListForms.ListFormEdit.DatabaseInsertBeforeCommand')}
invalid={errors.beforeInsertCommand && touched.beforeInsertCommand} invalid={errors.insertBeforeCommand && touched.insertBeforeCommand}
errorMessage={errors.beforeInsertCommand} errorMessage={errors.insertBeforeCommand}
> >
<Field <Field
type="text" type="text"
autoComplete="off" autoComplete="off"
name="beforeInsertCommand" name="insertBeforeCommand"
placeholder={translate( placeholder={translate(
'::ListForms.ListFormEdit.BeforeDatabaseInsertCommand', '::ListForms.ListFormEdit.DatabaseInsertBeforeCommand',
)} )}
component={Input} component={Input}
textArea={true} textArea={true}
@ -99,15 +99,15 @@ function FormTabDatabaseInsert({
/> />
</FormItem> </FormItem>
<FormItem <FormItem
label={translate('::ListForms.ListFormEdit.AfterDatabaseInsertCommand')} label={translate('::ListForms.ListFormEdit.DatabaseInsertAfterCommand')}
invalid={errors.afterInsertCommand && touched.afterInsertCommand} invalid={errors.insertAfterCommand && touched.insertAfterCommand}
errorMessage={errors.afterInsertCommand} errorMessage={errors.insertAfterCommand}
> >
<Field <Field
type="text" type="text"
autoComplete="off" autoComplete="off"
name="afterInsertCommand" name="insertAfterCommand"
placeholder={translate('::ListForms.ListFormEdit.AfterDatabaseInsertCommand')} placeholder={translate('::ListForms.ListFormEdit.DatabaseInsertAfterCommand')}
component={Input} component={Input}
textArea={true} textArea={true}
rows={6} rows={6}

View file

@ -82,16 +82,16 @@ function FormTabDatabaseUpdate({
/> />
</FormItem> </FormItem>
<FormItem <FormItem
label={translate('::ListForms.ListFormEdit.BeforeDatabaseUpdateCommand')} label={translate('::ListForms.ListFormEdit.DatabaseUpdateBeforeCommand')}
invalid={errors.beforeUpdateCommand && touched.beforeUpdateCommand} invalid={errors.updateBeforeCommand && touched.updateBeforeCommand}
errorMessage={errors.beforeUpdateCommand} errorMessage={errors.updateBeforeCommand}
> >
<Field <Field
type="text" type="text"
autoComplete="off" autoComplete="off"
name="beforeUpdateCommand" name="updateBeforeCommand"
placeholder={translate( placeholder={translate(
'::ListForms.ListFormEdit.BeforeDatabaseUpdateCommand', '::ListForms.ListFormEdit.DatabaseUpdateBeforeCommand',
)} )}
component={Input} component={Input}
textArea={true} textArea={true}
@ -99,17 +99,15 @@ function FormTabDatabaseUpdate({
/> />
</FormItem> </FormItem>
<FormItem <FormItem
label={translate('::ListForms.ListFormEdit.AfterDatabaseUpdateCommand')} label={translate('::ListForms.ListFormEdit.DatabaseUpdateAfterCommand')}
invalid={errors.afterUpdateCommand && touched.afterUpdateCommand} invalid={errors.updateAfterCommand && touched.updateAfterCommand}
errorMessage={errors.afterUpdateCommand} errorMessage={errors.updateAfterCommand}
> >
<Field <Field
type="text" type="text"
autoComplete="off" autoComplete="off"
name="afterUpdateCommand" name="updateAfterCommand"
placeholder={translate( placeholder={translate('::ListForms.ListFormEdit.DatabaseUpdateAfterCommand')}
'::ListForms.ListFormEdit.AfterDatabaseUpdateCommand',
)}
component={Input} component={Input}
textArea={true} textArea={true}
rows={6} rows={6}