SubForms içinde İlişkili sütunu tanımlamadan Insert

This commit is contained in:
Sedat ÖZTÜRK 2025-11-18 14:48:51 +03:00
parent 4fd5d8edd2
commit 07f03bdf3c
20 changed files with 1020 additions and 1032 deletions

View file

@ -1,4 +1,6 @@
namespace Erp.Platform.ListForms;
using System.Data;
namespace Erp.Platform.ListForms;
public class SubFormDto
{
@ -12,6 +14,7 @@ public class SubFormDto
public class SubFormRelationDto
{
public string ParentFieldName { get; set; }
public DbType DbType { get; set; }
public string ChildFieldName { get; set; }
}

View file

@ -107,7 +107,8 @@ public class ListFormFieldsAppService : CrudAppService<
R = listFormPermissions?.R,
C = listFormPermissions?.C,
U = listFormPermissions?.U,
E = true
E = true,
I = true
});
}

View file

@ -4309,6 +4309,12 @@
"en": "Relation Fields",
"tr": "İlişkili Sütunlar"
},
{
"resourceName": "Platform",
"key": "ListForms.ListFormEdit.SubFormsRelation.ParentFieldName",
"en": "Parent Field Name",
"tr": "Üst Kimlik İfadesi"
},
{
"resourceName": "Platform",
"key": "ListForms.ListFormEdit.SubFormsRelation.ChildFieldName",

View file

@ -132,9 +132,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
// BranchId
new()
{
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
@ -342,30 +340,6 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
},
], autoSave: true);
#endregion
// Sub Forms for Bank
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Bank Accounts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.BankAccount,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "BankId"
},
new {
ParentFieldName = "BranchId",
ChildFieldName = "BranchId"
},
}
},
})
);
}
#endregion
@ -376,7 +350,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
@ -385,7 +359,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
Title = AppCodes.Accounting.BankAccount,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Accounting.BankAccount,
SelectCommandType = SelectCommandTypeEnum.Table,
@ -410,21 +384,20 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
[
new EditingFormItemDto { Order = 1, DataField = "BankId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 2, DataField = "AccountNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "AccountOwner", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "CurrencyId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 5, DataField = "CanTransferMoney", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 1, DataField = "AccountNumber", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "AccountOwner", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "CurrencyId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 4, DataField = "CanTransferMoney", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "CanTransferMoney", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
}, autoSave: true
);
#region Bank Account Fields
await _listFormFieldRepository.InsertManyAsync(new ListFormField[] {
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
@ -441,29 +414,13 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "BankId",
Width = 250,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Bank), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "AccountNumber",
Width = 150,
ListOrderNo = 3,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -481,7 +438,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
SourceDbType = DbType.String,
FieldName = "AccountOwner",
Width = 250,
ListOrderNo = 4,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -498,7 +455,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
SourceDbType = DbType.Guid,
FieldName = "CurrencyId",
Width = 150,
ListOrderNo = 5,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -514,7 +471,7 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
SourceDbType = DbType.Boolean,
FieldName = "CanTransferMoney",
Width = 50,
ListOrderNo = 6,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -523,10 +480,31 @@ public class ListFormSeeder_Accounting : IDataSeedContributor, ITransientDepende
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
});
], autoSave: true);
#endregion
}
#endregion
// Bank ve Bank Account arasında Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Bank,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Bank Accounts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.BankAccount,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "BankId"
},
}
},
})
);
}
}

View file

@ -4131,37 +4131,6 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
}
], autoSave: true);
#endregion
// Sub Forms for SkillType
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Skill Levels",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.SkillLevel,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "SkillTypeId"
}
}
},
new {
TabTitle = "Skills",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Skill,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "SkillTypeId"
}
}
}
})
);
}
#endregion
@ -4172,7 +4141,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
@ -4207,7 +4176,6 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "Progress", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSlider, EditorOptions=EditorOptionValues.SliderOptions },
new EditingFormItemDto { Order = 3, DataField = "IsDefault", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 4, DataField = "SkillTypeId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
]
}
}),
@ -4215,11 +4183,11 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsDefault", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
}, autoSave: true
);
#region Skill Level Fields
await _listFormFieldRepository.InsertManyAsync(new ListFormField[] {
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
@ -4284,24 +4252,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "SkillTypeId",
Width = 150,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SkillType), "Id", "Name"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
});
], autoSave: true);
#endregion
}
#endregion
@ -4313,7 +4264,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
@ -4345,15 +4296,14 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
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 = 2, DataField = "SkillTypeId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
]}
}),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
}
}, autoSave: true
);
#region Skill Fields
await _listFormFieldRepository.InsertManyAsync(new ListFormField[] {
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
@ -4388,33 +4338,50 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "SkillTypeId",
Width = 150,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.SkillType), "Id", "Name"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
});
], autoSave: true);
#endregion
}
#endregion
// Skill Type ile Skill Level ve Skill Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.SkillType,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Skill Levels",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.SkillLevel,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "SkillTypeId"
}
}
},
new {
TabTitle = "Skills",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Skill,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "SkillTypeId"
}
}
}
})
);
#region UomCategory
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.UomCategory))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm {
new ListForm
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
ShowNote = true,
@ -4500,26 +4467,6 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
}
], autoSave: true);
#endregion
// Sub Forms for UomCategory
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.UomCategory,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Uoms",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Uom,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "UomCategoryId"
}
}
},
})
);
}
#endregion
@ -4530,7 +4477,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
@ -4566,16 +4513,18 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
new EditingFormItemDto { Order = 2, DataField = "Type", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 3, DataField = "Ratio", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 4, DataField = "Rounding", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 5, DataField = "IsActive", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 6, DataField = "UomCategoryId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 5, 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 }
}),
}, autoSave: true
);
#region Uom Fields
await _listFormFieldRepository.InsertManyAsync(new ListFormField[] {
await _listFormFieldRepository.InsertManyAsync([
new ListFormField
{
ListFormCode = listForm.ListFormCode,
@ -4681,25 +4630,45 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
{
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "UomCategoryId",
Width = 150,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 6,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.UomCategory), "Id", "Name"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
});
], autoSave: true);
#endregion
}
#endregion
// UomCategory ve Uom arasında Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.UomCategory,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Uoms",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Uom,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "UomCategoryId"
}
}
},
})
);
#region Behavior
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Behavior))
{

View file

@ -1924,7 +1924,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
]}
}),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
}
}, autoSave: true
);
#region QuestionTag Fields
@ -1993,7 +1993,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
]);
], autoSave: true);
#endregion
}
#endregion
@ -2124,26 +2124,6 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
}
], autoSave: true);
#endregion
// Sub Forms for Question Pool
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Questions",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Question,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "QuestionPoolId"
}
}
}
})
);
}
#endregion
@ -2197,13 +2177,13 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
}),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 1, DataField = "QuestionPoolId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 2, DataField = "QuestionType", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 3, DataField = "Points", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 4, DataField = "Title", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 5, DataField = "Content", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 6, DataField = "Difficulty", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 7, DataField = "MediaType", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 1, DataField = "QuestionType", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 2, DataField = "Points", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 3, DataField = "Title", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "Content", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 5, DataField = "MediaType", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 6, DataField = "MediaUrl", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 7, DataField = "Difficulty", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 8, DataField = "MediaUrl", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 9, DataField = "CorrectAnswer", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions="{\"disabled\": true}" },
new EditingFormItemDto { Order = 10, DataField = "TimeLimit", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox },
@ -2214,7 +2194,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
new() { FieldName = "MediaType", FieldDbType = DbType.String, Value = "image", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "Difficulty", FieldDbType = DbType.String, Value = "easy", CustomValueType = FieldCustomValueTypeEnum.Value }
})
}
}, autoSave: true
);
#region Question Fields
@ -2235,30 +2215,13 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "QuestionPoolId",
Width = 100,
ListOrderNo = 2,
Visible = false,
IsActive = true,
IsDeleted = false,
SortIndex = 0,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.QuestionPool), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "QuestionType",
Width = 120,
ListOrderNo = 3,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2292,7 +2255,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
Format = "fixedPoint",
Alignment = "right",
Width = 60,
ListOrderNo = 4,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2307,7 +2270,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
SourceDbType = DbType.String,
FieldName = "Title",
Width = 150,
ListOrderNo = 5,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2322,7 +2285,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
SourceDbType = DbType.String,
FieldName = "Content",
Width = 350,
ListOrderNo = 6,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2337,7 +2300,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
SourceDbType = DbType.String,
FieldName = "MediaType",
Width = 100,
ListOrderNo = 7,
ListOrderNo = 6,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2362,7 +2325,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
SourceDbType = DbType.String,
FieldName = "MediaUrl",
Width = 170,
ListOrderNo = 8,
ListOrderNo = 7,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2377,7 +2340,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
SourceDbType = DbType.String,
FieldName = "CorrectAnswer",
Width = 150,
ListOrderNo = 9,
ListOrderNo = 8,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2392,7 +2355,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
SourceDbType = DbType.String,
FieldName = "Difficulty",
Width = 100,
ListOrderNo = 10,
ListOrderNo = 9,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2418,7 +2381,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
SourceDbType = DbType.Int32,
FieldName = "TimeLimit",
Width = 100,
ListOrderNo = 11,
ListOrderNo = 10,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2433,7 +2396,7 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
SourceDbType = DbType.String,
FieldName = "Explanation",
Width = 100,
ListOrderNo = 12,
ListOrderNo = 11,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -2442,9 +2405,30 @@ public class ListFormSeeder_Coordinator : IDataSeedContributor, ITransientDepend
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
// QuestionPool ve Question arasında Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.QuestionPool,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Questions",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Question,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "QuestionPoolId"
}
}
}
})
);
#endregion
}
}

View file

@ -936,48 +936,6 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency
PivotSettingsJson = DefaultPivotSettingsJson
},
], autoSave: true);
// Sub Forms for Customer
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Banks",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerBank,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "PartnerId"
}
}
},
new {
TabTitle = "Certificates",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerCertificate,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "PartnerId"
}
}
},
new {
TabTitle = "Contacts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerContact,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "PartnerId"
}
}
}
})
);
}
#endregion
@ -1531,37 +1489,6 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency
},
], autoSave: true);
#endregion
// Sub Forms for Opportunity
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Activity",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.OpportunityActivity,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "OpportunityId"
}
}
},
new {
TabTitle = "Competitors",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.OpportunityCompetitor,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "OpportunityId"
}
}
},
})
);
}
#endregion
@ -1618,16 +1545,15 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 10, DataField="FollowUpActivity", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 11, DataField="Outcome", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 12, DataField="NextSteps", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 13, DataField="OpportunityId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "ActivityDate", FieldDbType = DbType.DateTime, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
}),
}
}, autoSave: true
);
#region Action Fields
#region Activity Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
@ -1845,23 +1771,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "OpportunityId",
Width = 200,
ListOrderNo = 14,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Opportunity), "Id", "Title"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
@ -1914,7 +1824,7 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 5, DataField="MarketShare", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox },
]}
}),
}
}, autoSave: true
);
#region Competitor Fields
@ -2011,9 +1921,42 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
// Opportunity ile Activity ve Competitor arasında Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Opportunity,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Activity",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.OpportunityActivity,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "OpportunityId"
}
}
},
new {
TabTitle = "Competitors",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.OpportunityCompetitor,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "OpportunityId"
}
}
},
})
);
}
}

View file

@ -4163,37 +4163,6 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
},
], autoSave: true);
#endregion
// Sub Forms for Survey
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Questions",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.SurveyQuestion,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "SurveyId"
}
}
},
new {
TabTitle = "Responses",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.SurveyResponse,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "SurveyId"
}
}
}
})
);
}
#endregion
@ -4238,7 +4207,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
{
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[
new EditingFormItemDto { Order = 1, DataField = "SurveyId", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 1, DataField = "Order", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 2, DataField = "QuestionText", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Type", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 4, DataField = "IsRequired", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxCheckBox }
@ -4257,7 +4226,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
Url="/admin/list/list-employees/@Id"
},
}),
}
}, autoSave: true
);
#region Survey Question Fields
@ -4278,30 +4247,13 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "SurveyId",
Width = 200,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Survey), "Id", "Title"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Int32,
FieldName = "Order",
Width = 100,
ListOrderNo = 3,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -4317,7 +4269,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
SourceDbType = DbType.String,
FieldName = "QuestionText",
Width = 300,
ListOrderNo = 4,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -4333,7 +4285,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
SourceDbType = DbType.String,
FieldName = "Type",
Width = 100,
ListOrderNo = 5,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -4361,7 +4313,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
SourceDbType = DbType.Boolean,
FieldName = "IsRequired",
Width = 100,
ListOrderNo = 6,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -4370,7 +4322,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
@ -4416,10 +4368,9 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
{
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[
new EditingFormItemDto { Order = 1, DataField = "SurveyId", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 2, DataField = "EmployeeId", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 3, DataField = "SubmissionTime", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "CreationTime", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }
new EditingFormItemDto { Order = 1, DataField = "EmployeeId", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 2, DataField = "SubmissionTime", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "CreationTime", ColSpan=1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }
]}
}),
CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] {
@ -4431,7 +4382,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
Url="/admin/list/list-employees/@Id"
},
}),
}
}, autoSave: true
);
#region Survey Response Fields
@ -4452,30 +4403,13 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "SurveyId",
Width = 200,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Survey), "Id", "Title"),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "EmployeeId",
Width = 100,
ListOrderNo = 3,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -4492,7 +4426,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
SourceDbType = DbType.DateTime,
FieldName = "SubmissionTime",
Width = 100,
ListOrderNo = 4,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -4508,7 +4442,7 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
SourceDbType = DbType.DateTime,
FieldName = "CreationTime",
Width = 100,
ListOrderNo = 5,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
@ -4517,9 +4451,42 @@ public class ListFormSeeder_Hr : IDataSeedContributor, ITransientDependency
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
// Survey ile Survey Question ve Survey Response Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Survey,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Questions",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.SurveyQuestion,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "SurveyId"
}
}
},
new {
TabTitle = "Responses",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.SurveyResponse,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "SurveyId"
}
}
}
})
);
#endregion
}
}

View file

@ -80,7 +80,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(TenantManagementPermissions.Tenants.Create, TenantManagementPermissions.Tenants.Default, TenantManagementPermissions.Tenants.Update, TenantManagementPermissions.Tenants.Delete, TenantManagementPermissions.Tenants.Default + ".Export", TenantManagementPermissions.Tenants.Default + ".Import", TenantManagementPermissions.Tenants.Default + ".Note"),
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(TenantManagementPermissions.Tenants.Default, 800, 800, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(TenantManagementPermissions.Tenants.Default, 800, 700, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
@ -140,11 +140,11 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
new() { FieldName = "Country", FieldDbType = DbType.String, Value = "TR", CustomValueType = FieldCustomValueTypeEnum.Value }
})
}, autoSave: true);
}, autoSave: true
);
#region Tenants Fields
await _listFormFieldRepository.InsertManyAsync(
[
await _listFormFieldRepository.InsertManyAsync([
new ListFormField
{
ListFormCode = listForm.ListFormCode,
@ -517,38 +517,18 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
},
], autoSave: true);
#endregion
// Sub Forms for Tenant
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Branches",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Branch,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "TenantId"
}
}
} }
)
);
}
#endregion
#region Branche
#region Branches
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Branch))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
@ -574,7 +554,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Branches),
PagerOptionJson = DefaultPagerOptionJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Branches, 900, 800, true, true, true, true, false),
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Branches, 800, 700, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
{
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
@ -622,12 +602,11 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
)
},
}),
}
}, autoSave: true
);
#region Branches Fields
await _listFormFieldRepository.InsertManyAsync(
[
await _listFormFieldRepository.InsertManyAsync([
new ListFormField
{
ListFormCode = listForm.ListFormCode,
@ -979,11 +958,32 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
// Tenant ve Branches arasında Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Tenant,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Branches",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.Branch,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "TenantId"
}
}
}}
)
);
#region SettingDefinition
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SettingDefinition))
{
@ -1564,8 +1564,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Language)}/@Id"
},
}),
}
, autoSave: true);
}, autoSave: true
);
#region Language Fields
await _listFormFieldRepository.InsertManyAsync([
@ -1651,26 +1651,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
},
], autoSave: true);
#endregion
// Sub Forms for Tenant
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Language,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Language Texts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.LanguageText,
Relation = new List<dynamic>() {
new {
ParentFieldName = "CultureName",
ChildFieldName = "CultureName"
}
}
}
})
);
}
#endregion
@ -1681,7 +1661,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
@ -1721,7 +1701,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
}
}),
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
}
}, autoSave: true
);
#region LanguageText Fields
@ -1828,12 +1808,33 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
// Language ve LanguageText Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Language,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Language Texts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.LanguageText,
Relation = new List<dynamic>() {
new {
ParentFieldName = "CultureName",
DbType = DbType.String,
ChildFieldName = "CultureName"
}
}
}
})
);
#region Route
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Route))
{

View file

@ -1046,7 +1046,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
#region Supplier
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Supply))
{
var listForm = await _listFormRepository.InsertAsync(new ListForm()
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
@ -1147,10 +1148,10 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Supply)}/@Id"
},
}),
}, autoSave: true);
}, autoSave: true
);
await _listFormFieldRepository.InsertManyAsync(
[
await _listFormFieldRepository.InsertManyAsync([
new()
{
ListFormCode = listForm.ListFormCode,
@ -1689,48 +1690,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
PivotSettingsJson = DefaultPivotSettingsJson
},
], autoSave: true);
// Sub Forms for Supply
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Banks",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerBank,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "PartnerId"
}
}
},
new {
TabTitle = "Certificates",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerCertificate,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "PartnerId"
}
}
},
new {
TabTitle = "Contacts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerContact,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "PartnerId"
}
}
}
})
);
}
#endregion
@ -1788,7 +1747,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new EditingFormItemDto { Order = 11, DataField="DailyTransferLimit", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 12, DataField="IsDefault", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 13, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 14, DataField="PartnerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
@ -1798,7 +1756,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new() { FieldName = "IsDefault", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
}, autoSave: true
);
#region Partner Bank Fields
@ -2038,23 +1996,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "PartnerId",
Width = 100,
ListOrderNo = 15,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Partner), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
@ -2104,10 +2046,9 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new EditingFormItemDto { Order = 2, DataField="Issuer", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField="IssueDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox },
new EditingFormItemDto { Order = 4, DataField="ExpiryDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox },
new EditingFormItemDto { Order = 5, DataField="PartnerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
]}
}),
}
}, autoSave: true
);
#region Supplier Certificate Fields
@ -2192,23 +2133,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
PermissionJson = DefaultFieldPermissionJson(AppCodes.SupplyChain.PartnerCertificate),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "PartnerId",
Width = 100,
ListOrderNo = 6,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Partner), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
@ -2262,14 +2187,13 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new EditingFormItemDto { Order = 6, DataField="MobileNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.PhoneEditorOptions },
new EditingFormItemDto { Order = 7, DataField="IsPrimary", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 8, DataField="IsActive", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 9, DataField="PartnerId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsPrimary", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
}, autoSave: true
);
#region Supplier Contact Fields
@ -2416,27 +2340,101 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "PartnerId",
Width = 100,
ListOrderNo = 8,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Partner), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
// Supply ile Bank, Certificate ve Contact Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Supply,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Banks",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerBank,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "PartnerId"
}
}
},
new {
TabTitle = "Certificates",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerCertificate,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "PartnerId"
}
}
},
new {
TabTitle = "Contacts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerContact,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "PartnerId"
}
}
}
})
);
// Customer ile Bank, Certificate ve Contact Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Customer,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Banks",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerBank,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "PartnerId"
}
}
},
new {
TabTitle = "Certificates",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerCertificate,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "PartnerId"
}
}
},
new {
TabTitle = "Contacts",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.PartnerContact,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "PartnerId"
}
}
}
})
);
#region Approval
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Approval))
{
@ -2602,27 +2600,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
], autoSave: true);
#endregion
}
// Sub Forms for Approval Workflow
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Approval,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Steps",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.ApprovalStep,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "ApprovalId"
}
}
}
})
);
#endregion
#region Approval Step
@ -2632,7 +2609,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
IsSubForm = true,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
@ -2670,7 +2647,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new EditingFormItemDto { Order = 3, DataField = "TimeoutDays", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 4, DataField = "IsRequired", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 5, DataField = "IsParallel", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 6, DataField = "ApprovalId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
@ -2678,10 +2654,10 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new() { FieldName = "IsRequired", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "IsParallel", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
}, autoSave: true
);
#region Approval Workflow Step Fields
#region Approval Step Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
@ -2778,27 +2754,32 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "ApprovalId",
Width = 100,
ListOrderNo = 8,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Approval), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
]);
], autoSave: true);
#endregion
}
#endregion
// Approval ve Approval Step arasında Sub Forms ilişkisinin kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Approval,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Steps",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.ApprovalStep,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "ApprovalId"
}
}
}
})
);
#region Request Type
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RequestType))
{
@ -2925,7 +2906,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
#region Purchase Request
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Request))
{
var listForm = await _listFormRepository.InsertAsync(new ListForm()
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
@ -2992,7 +2974,8 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
Url=$"/admin/form/{utils.GetDefaultFormCodes(ListFormCodes.Lists.Request)}/@Id"
},
}),
}, autoSave: true);
}, autoSave: true
);
await _listFormFieldRepository.InsertManyAsync([
new() {
@ -3183,26 +3166,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
PivotSettingsJson = DefaultPivotSettingsJson
}
], autoSave: true);
// Sub Forms for Supply
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
listForm.ListFormCode,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Malzemeler",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.RequestItem,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
ChildFieldName = "RequestId"
}
}
}
})
);
}
#endregion
@ -3254,7 +3217,6 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new EditingFormItemDto { Order = 5, DataField="Specification", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 6, DataField="Justification", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 7, DataField="IsUrgent", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 8, DataField="RequestId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
@ -3262,7 +3224,7 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
new() { FieldName = "EstimatedPrice", FieldDbType = DbType.Decimal, Value = "0", CustomValueType = FieldCustomValueTypeEnum.Value },
new() { FieldName = "IsUrgent", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
}, autoSave: true
);
#region Purchase Request Item Fields
@ -3397,25 +3359,30 @@ public class ListFormSeeder_SupplyChain : IDataSeedContributor, ITransientDepend
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "RequestId",
Width = 130,
ListOrderNo = 8,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Request), "Id", "RequestNumber"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
], autoSave: true);
#endregion
}
#endregion
// Purchase Request ve Purchase Request Item arasında SubForm ilişki kurulması
await utils.CloneListFormWithFieldsAsync(
_listFormRepository,
_listFormFieldRepository,
ListFormCodes.Lists.Request,
JsonSerializer.Serialize(new List<dynamic>() {
new {
TabTitle = "Malzemeler",
TabType = ListFormTabTypeEnum.List,
Code = ListFormCodes.Lists.RequestItem,
Relation = new List<dynamic>() {
new {
ParentFieldName = "Id",
DbType = DbType.Guid,
ChildFieldName = "RequestId"
}
}
}
})
);
}
}

View file

@ -11292,6 +11292,69 @@
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.BankAccount",
"ParentName": null,
"DisplayName": "App.Accounting.BankAccount",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.BankAccount.Create",
"ParentName": "App.Accounting.BankAccount",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.BankAccount.Update",
"ParentName": "App.Accounting.BankAccount",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.BankAccount.Delete",
"ParentName": "App.Accounting.BankAccount",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.BankAccount.Export",
"ParentName": "App.Accounting.BankAccount",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.BankAccount.Import",
"ParentName": "App.Accounting.BankAccount",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.BankAccount.Note",
"ParentName": "App.Accounting.BankAccount",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Accounting",
"Name": "App.Accounting.CheckNote",

View file

@ -1,7 +1,12 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Erp.Platform.Entities;
using Erp.Platform.ListForms;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories;
namespace Erp.Platform.Data.Seeds;
@ -12,78 +17,77 @@ public class SeederUtils : IDisposable
IRepository<ListForm, Guid> listFormRepository,
IRepository<ListFormField, Guid> listFormFieldRepository,
string listFormCode,
string subFormsJson = "")
string subFormsJson)
{
// load source form
var sourceForm = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == listFormCode);
if (sourceForm == null)
var listForm = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == listFormCode);
if (listForm == null)
{
return null;
}
string targetListFormCode = GetDefaultFormCodes(listFormCode);
string formCode = GetDefaultFormCodes(listFormCode);
var targetForm = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == targetListFormCode);
if (targetForm != null)
var targetForm = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == formCode);
if (targetForm == null)
{
return null;
}
// create a shallow copy of the source form and set the target code
var clonedForm = new ListForm
var insertForm = new ListForm
{
ListFormType = sourceForm.ListFormType,
IsSubForm = sourceForm.IsSubForm,
ShowNote = sourceForm.ShowNote,
LayoutJson = sourceForm.LayoutJson,
SubFormsJson = subFormsJson ?? sourceForm.SubFormsJson,
CultureName = sourceForm.CultureName,
ListFormCode = targetListFormCode,
Name = sourceForm.Name,
Title = sourceForm.Title,
DataSourceCode = sourceForm.DataSourceCode,
IsTenant = sourceForm.IsTenant,
IsBranch = sourceForm.IsBranch,
IsOrganizationUnit = sourceForm.IsOrganizationUnit,
Description = sourceForm.Description,
SelectCommandType = sourceForm.SelectCommandType,
SelectCommand = sourceForm.SelectCommand,
KeyFieldName = sourceForm.KeyFieldName,
KeyFieldDbSourceType = sourceForm.KeyFieldDbSourceType,
DefaultFilter = sourceForm.DefaultFilter,
SortMode = sourceForm.SortMode,
PermissionJson = sourceForm.PermissionJson,
DeleteCommand = sourceForm.DeleteCommand,
DeleteFieldsDefaultValueJson = sourceForm.DeleteFieldsDefaultValueJson,
EditingOptionJson = sourceForm.EditingOptionJson,
EditingFormJson = sourceForm.EditingFormJson,
InsertFieldsDefaultValueJson = sourceForm.InsertFieldsDefaultValueJson,
FormFieldsDefaultValueJson = sourceForm.FormFieldsDefaultValueJson,
CommandColumnJson = sourceForm.CommandColumnJson,
InsertServiceAddress = sourceForm.InsertServiceAddress,
UpdateServiceAddress = sourceForm.UpdateServiceAddress,
FilterRowJson = sourceForm.FilterRowJson,
HeaderFilterJson = sourceForm.HeaderFilterJson,
SearchPanelJson = sourceForm.SearchPanelJson,
GroupPanelJson = sourceForm.GroupPanelJson,
SelectionJson = sourceForm.SelectionJson,
ColumnOptionJson = sourceForm.ColumnOptionJson,
PagerOptionJson = sourceForm.PagerOptionJson,
ListFormCode = formCode,
SubFormsJson = subFormsJson, //Özelleştirilmiş SubFormsJson
ListFormType = listForm.ListFormType,
IsSubForm = listForm.IsSubForm,
ShowNote = listForm.ShowNote,
LayoutJson = listForm.LayoutJson,
CultureName = listForm.CultureName,
Name = listForm.Name,
Title = listForm.Title,
DataSourceCode = listForm.DataSourceCode,
IsTenant = listForm.IsTenant,
IsBranch = listForm.IsBranch,
IsOrganizationUnit = listForm.IsOrganizationUnit,
Description = listForm.Description,
SelectCommandType = listForm.SelectCommandType,
SelectCommand = listForm.SelectCommand,
KeyFieldName = listForm.KeyFieldName,
KeyFieldDbSourceType = listForm.KeyFieldDbSourceType,
DefaultFilter = listForm.DefaultFilter,
SortMode = listForm.SortMode,
PermissionJson = listForm.PermissionJson,
DeleteCommand = listForm.DeleteCommand,
DeleteFieldsDefaultValueJson = listForm.DeleteFieldsDefaultValueJson,
EditingOptionJson = listForm.EditingOptionJson,
EditingFormJson = listForm.EditingFormJson,
InsertFieldsDefaultValueJson = listForm.InsertFieldsDefaultValueJson,
FormFieldsDefaultValueJson = listForm.FormFieldsDefaultValueJson,
CommandColumnJson = listForm.CommandColumnJson,
InsertServiceAddress = listForm.InsertServiceAddress,
UpdateServiceAddress = listForm.UpdateServiceAddress,
FilterRowJson = listForm.FilterRowJson,
HeaderFilterJson = listForm.HeaderFilterJson,
SearchPanelJson = listForm.SearchPanelJson,
GroupPanelJson = listForm.GroupPanelJson,
SelectionJson = listForm.SelectionJson,
ColumnOptionJson = listForm.ColumnOptionJson,
PagerOptionJson = listForm.PagerOptionJson,
};
// insert cloned form
var insertedForm = await listFormRepository.InsertAsync(clonedForm);
targetForm = await listFormRepository.InsertAsync(insertForm, autoSave: true);
}
// copy fields
var fields = await listFormFieldRepository.GetListAsync(f => f.ListFormCode == listFormCode);
if (fields != null && fields.Count > 0)
var targetFormFields = await listFormFieldRepository.GetListAsync(f => f.ListFormCode == listFormCode);
if (targetFormFields != null && targetFormFields.Count > 0)
{
var clonedFields = new List<ListFormField>();
foreach (var f in fields)
foreach (var f in targetFormFields)
{
var newField = new ListFormField
{
ListFormCode = targetListFormCode,
ListFormCode = formCode,
CultureName = f.CultureName,
SourceDbType = f.SourceDbType,
FieldName = f.FieldName,
@ -105,10 +109,84 @@ public class SeederUtils : IDisposable
clonedFields.Add(newField);
}
await listFormFieldRepository.InsertManyAsync(clonedFields);
await listFormFieldRepository.InsertManyAsync(clonedFields, autoSave: true);
}
return insertedForm;
//Subform içerisindeki ParentFieldName ve ChildFieldName alanlarına göre eksik olan fieldları ekle
var subForms = JsonSerializer.Deserialize<List<SubFormDto>>(subFormsJson);
if (subForms != null)
{
foreach (var subForm in subForms)
{
foreach (var sf in subForm.Relation)
{
var parentFieldName = sf.ParentFieldName;
var dbType = sf.DbType;
await InsertListFormFieldAsync(
listFormRepository,
listFormFieldRepository,
listFormCode,
parentFieldName,
dbType
);
var childListFormCode = subForm.Code;
var childFieldName = sf.ChildFieldName;
await InsertListFormFieldAsync(
listFormRepository,
listFormFieldRepository,
childListFormCode,
childFieldName,
dbType
);
}
}
}
return targetForm;
}
private async Task InsertListFormFieldAsync(
IRepository<ListForm, Guid> listFormRepository,
IRepository<ListFormField, Guid> listFormFieldRepository,
string listFormCode,
string fieldName,
DbType dbType
)
{
var form = await listFormRepository.FirstOrDefaultAsync(f => f.ListFormCode == listFormCode);
var fieldQuery = await listFormFieldRepository.GetQueryableAsync();
var formField = await fieldQuery.FirstOrDefaultAsync(f => f.ListFormCode == listFormCode && f.FieldName == fieldName);
if (formField == null)
{
var listOrderNo = await fieldQuery.Where(f => f.ListFormCode == listFormCode).MaxAsync(a => a.ListOrderNo) ?? 0;
var field = new ListFormField
{
CultureName = PlatformConsts.DefaultLanguage,
ListFormCode = listFormCode,
SourceDbType = dbType,
FieldName = fieldName,
ListOrderNo = listOrderNo + 1,
Visible = false,
IsActive = true,
IsDeleted = false,
SortIndex = 0,
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
{
C = form.Name + ".Create",
R = form.Name,
U = form.Name + ".Update",
E = true,
I = false,
Deny = false
}),
};
await listFormFieldRepository.InsertAsync(field, autoSave: true);
}
}
public string GetDefaultFormCodes(string listCode)

View file

@ -7,7 +7,6 @@ namespace Erp.Platform.Entities;
public class BankAccount : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public Guid? BranchId { get; set; }
public string AccountNumber { get; set; }
public Guid BankId { get; set; }

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Data;
using Volo.Abp.Domain.Values;
namespace Erp.Platform.Queries;
@ -24,6 +25,7 @@ public class SubForm : ValueObject
public class SubFormRelation
{
public string ParentFieldName { get; set; }
public DbType DbType { get; set; }
public string ChildFieldName { get; set; }
}

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Erp.Platform.Migrations
{
[DbContext(typeof(PlatformDbContext))]
[Migration("20251116194718_Initial")]
[Migration("20251117212636_Initial")]
partial class Initial
{
/// <inheritdoc />
@ -1230,9 +1230,6 @@ namespace Erp.Platform.Migrations
b.Property<Guid>("BankId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("CanTransferMoney")
.HasColumnType("bit");

View file

@ -2674,7 +2674,6 @@ namespace Erp.Platform.Migrations
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
AccountNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
BankId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
AccountOwner = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),

View file

@ -1227,9 +1227,6 @@ namespace Erp.Platform.Migrations
b.Property<Guid>("BankId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("CanTransferMoney")
.HasColumnType("bit");

View file

@ -699,6 +699,7 @@ export interface SubFormDto {
export interface SubFormRelationDto {
parentFieldName: string
dbType : DbTypeEnum
childFieldName: string
}

View file

@ -12,6 +12,7 @@ import { useState } from 'react'
import { FaEdit, FaFileMedical, FaTrash } from 'react-icons/fa'
import JsonRowOpDialogSubForm from './json-row-operations/JsonRowOpDialogSubForm'
import { JsonRowDialogData } from './json-row-operations/types'
import { dbSourceTypeOptions } from './options'
function FormTabSubForm() {
const [isJsonRowOpDialogOpen, setIsJsonRowOpDialogOpen] = useState(false)
@ -111,7 +112,12 @@ function FormTabSubForm() {
<ul className="list-disc">
{row.relation?.map((i) => (
<li key={i.parentFieldName + ':' + i.childFieldName}>
{i.parentFieldName + ' : ' + i.childFieldName}
{i.parentFieldName +
' : ' +
i.childFieldName +
' (' +
dbSourceTypeOptions.find((option) => option.value === i.dbType)?.label +
')'}
</li>
))}
</ul>

View file

@ -17,7 +17,7 @@ import { Field, FieldArray, FieldProps, Form, Formik } from 'formik'
import { Dispatch, SetStateAction } from 'react'
import { FaCalendarPlus, FaCalendarMinus } from 'react-icons/fa'
import { boolean, object, string } from 'yup'
import { tabTypeOptions } from '../options'
import { dbSourceTypeOptions, tabTypeOptions } from '../options'
import { JsonRowDialogData } from './types'
import {
deleteListFormJsonRow,
@ -69,7 +69,7 @@ function JsonRowOpDialogSubForm({
return (
<Dialog
id="subFormOperation"
width={1000}
width={900}
isOpen={isOpen}
preventScroll={true}
onClose={handleClose}
@ -126,7 +126,8 @@ function JsonRowOpDialogSubForm({
{({ touched, errors, values, isSubmitting }) => (
<Form>
<FormContainer size="sm">
<div className="h-full overflow-y-auto p-2">
<div className="h-[500px] overflow-y-auto p-2">
<div className="grid grid-cols-4 gap-4">
<FormItem
label="Tab Title"
invalid={errors.tabTitle && touched.tabTitle}
@ -182,11 +183,9 @@ function JsonRowOpDialogSubForm({
invalid={errors.isRefresh && touched.isRefresh}
errorMessage={errors.isRefresh}
>
<Field
name="isRefresh"
component={Checkbox}
/>
<Field name="isRefresh" component={Checkbox} />
</FormItem>
</div>
<FormItem label="Relations">
<FieldArray
@ -196,6 +195,7 @@ function JsonRowOpDialogSubForm({
<div className="flex m-1 font-bold text-center">
<div className="w-4/12">Parent Field Name</div>
<div className="w-4/12">Child Field Name</div>
<div className="w-4/12">Db Type</div>
</div>
{values.relation && values.relation.length > 0 ? (
values.relation.map((item: SubFormRelationDto, index: any) => (
@ -206,18 +206,45 @@ function JsonRowOpDialogSubForm({
autoComplete="off"
name={`relation.${index}.parentFieldName`}
component={Input}
placeholder="Parent Field Name"
placeholder={translate('::ListForms.ListFormEdit.SubFormsRelation.ParentFieldName')}
/>
</div>
<div className="w-4/12 ml-2">
<Field
type="text"
autoComplete="off"
name={`relation.${index}.childFieldName`}
component={Input}
placeholder="Child Field Name"
placeholder={translate('::ListForms.ListFormEdit.SubFormsRelation.ChildFieldName')}
/>
</div>
<div className="w-3/12 ml-2">
<Field
type="text"
autoComplete="off"
name={`relation.${index}.dbType`}
placeholder={translate('::ListForms.ListFormEdit.FieldDbType')}
>
{({ field, form }: FieldProps<any>) => (
<Select
field={field}
form={form}
isClearable={true}
options={dbSourceTypeOptions}
value={dbSourceTypeOptions?.find(
(option: any) =>
option.value === item?.dbType,
)}
onChange={(option) =>
form.setFieldValue(field.name, option?.value)
}
/>
)}
</Field>
</div>
<div className="w-1/12 ml-2">
<Button
shape="circle"