Grid InInsert Sütunların Varsayılan Değer Tanımlaması
@NEWID
This commit is contained in:
parent
8d97c06dd0
commit
d95dacdc70
9 changed files with 64 additions and 10 deletions
|
|
@ -19,7 +19,8 @@ public static class SeederDefaults
|
|||
{
|
||||
new() { FieldName = "CreationTime", FieldDbType = DbType.DateTime, Value = "@NOW", CustomValueType = FieldCustomValueTypeEnum.CustomKey },
|
||||
new() { FieldName = "CreatorId", FieldDbType = DbType.Guid, Value = "@USERID", CustomValueType = FieldCustomValueTypeEnum.CustomKey },
|
||||
new() { FieldName = "IsDeleted", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value }
|
||||
new() { FieldName = "IsDeleted", FieldDbType = DbType.Boolean, Value = "false", CustomValueType = FieldCustomValueTypeEnum.Value },
|
||||
new() { FieldName = "Id", FieldDbType = DbType.Guid, Value = "@NEWID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
});
|
||||
|
||||
public static readonly string DefaultDeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[]
|
||||
|
|
|
|||
|
|
@ -1330,6 +1330,7 @@ public static class PlatformConsts
|
|||
public const string Month = "@MONTH";
|
||||
public const string Day = "@DAY";
|
||||
public const string Id = "@ID";
|
||||
public const string NewId = "@NEWID";
|
||||
public const string Selected_Ids = "@SELECTED_IDS";
|
||||
public const string TenantId = "@TENANTID";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,12 +88,12 @@ public class ListFormManager : PlatformDomainService, IListFormManager
|
|||
{
|
||||
var fields = new Dictionary<string, object>();
|
||||
|
||||
if (op == OperationEnum.Insert && listForm.KeyFieldDbSourceType == DbType.Guid)
|
||||
{
|
||||
// TODO: parametre sayisi artirilarak daha detayli kontrol yapilabilir.
|
||||
// Ornegin Autoincrement olmayan ve elle deger veilmesi gereken bir Int alan ise?
|
||||
fields.Add(listForm.KeyFieldName, Guid.NewGuid());
|
||||
}
|
||||
// if (op == OperationEnum.Insert && listForm.KeyFieldDbSourceType == DbType.Guid)
|
||||
// {
|
||||
// // TODO: parametre sayisi artirilarak daha detayli kontrol yapilabilir.
|
||||
// // Ornegin Autoincrement olmayan ve elle deger veilmesi gereken bir Int alan ise?
|
||||
// fields.Add(listForm.KeyFieldName, Guid.NewGuid());
|
||||
// }
|
||||
|
||||
if ((object)inputParams != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class DefaultValueHelper : ITransientDependency
|
|||
var result = strValue
|
||||
.Replace(PlatformConsts.DefaultValues.UserId, _currentUser.Id?.ToString() ?? Guid.Empty.ToString())
|
||||
.Replace(PlatformConsts.DefaultValues.UserName, _currentUser.UserName ?? string.Empty)
|
||||
.Replace(PlatformConsts.DefaultValues.Roles, string.Join("','", _currentUser.Roles ?? Array.Empty<string>()))
|
||||
.Replace(PlatformConsts.DefaultValues.Roles, string.Join("','", _currentUser.Roles ?? []))
|
||||
.Replace(PlatformConsts.DefaultValues.Now, now.ToString("O", CultureInfo.InvariantCulture))
|
||||
.Replace(PlatformConsts.DefaultValues.Day, now.Day.ToString(CultureInfo.InvariantCulture))
|
||||
.Replace(PlatformConsts.DefaultValues.Month, now.Month.ToString(CultureInfo.InvariantCulture))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
|
@ -83,6 +82,8 @@ public class DefaultValueManager : PlatformDomainService, IDefaultValueManager
|
|||
value = Clock.Now.Year;
|
||||
else if (field.Value == PlatformConsts.DefaultValues.Id)
|
||||
value = keys?.FirstOrDefault();
|
||||
else if (field.Value == PlatformConsts.DefaultValues.NewId)
|
||||
value = Guid.NewGuid();
|
||||
else if (field.Value == PlatformConsts.DefaultValues.Selected_Ids)
|
||||
value = keys;
|
||||
else if (field.Value == PlatformConsts.DefaultValues.TenantId)
|
||||
|
|
|
|||
|
|
@ -2298,7 +2298,7 @@
|
|||
"code": "PERFECT_ATTENDANCE",
|
||||
"name": "Mükemmel Devam",
|
||||
"description": "Düzenli ve zamanında işe gelen, devamsızlık yapmayan çalışanlar",
|
||||
"icon": "📅",
|
||||
"icon": "❤️",
|
||||
"color": "#28A745",
|
||||
"backgroundColor": "#E8F5E8",
|
||||
"category": "Attendance",
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export const SCREENS = {
|
|||
// Border radius (Tailwind ile uyumlu)
|
||||
export const BORDER_RADIUS = {
|
||||
none: '0px',
|
||||
xs: '0.0625rem',
|
||||
sm: '0.125rem',
|
||||
DEFAULT: '0.25rem',
|
||||
md: '0.375rem',
|
||||
|
|
|
|||
|
|
@ -825,6 +825,31 @@ const Grid = (props: GridProps) => {
|
|||
resizeEnabled: gridDto.gridOptions.editingOptionDto?.popup?.resizeEnabled,
|
||||
fullScreen: isPopupFullScreen,
|
||||
toolbarItems: [
|
||||
{
|
||||
widget: 'dxButton',
|
||||
toolbar: 'bottom',
|
||||
location: 'after',
|
||||
options: {
|
||||
text: translate('::Save'),
|
||||
type: 'default',
|
||||
onClick: () => {
|
||||
const grid = gridRef.current?.instance
|
||||
grid?.saveEditData()
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
widget: 'dxButton',
|
||||
toolbar: 'bottom',
|
||||
location: 'after',
|
||||
options: {
|
||||
text: translate('::Cancel'),
|
||||
onClick: () => {
|
||||
const grid = gridRef.current?.instance
|
||||
grid?.cancelEditData()
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
widget: 'dxButton',
|
||||
toolbar: 'top',
|
||||
|
|
|
|||
|
|
@ -659,6 +659,31 @@ const Tree = (props: TreeProps) => {
|
|||
resizeEnabled: gridDto.gridOptions.editingOptionDto?.popup?.resizeEnabled,
|
||||
fullScreen: isPopupFullScreen,
|
||||
toolbarItems: [
|
||||
{
|
||||
widget: 'dxButton',
|
||||
toolbar: 'bottom',
|
||||
location: 'after',
|
||||
options: {
|
||||
text: translate('::Save'),
|
||||
type: 'default',
|
||||
onClick: () => {
|
||||
const tree = gridRef.current?.instance
|
||||
tree?.saveEditData()
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
widget: 'dxButton',
|
||||
toolbar: 'bottom',
|
||||
location: 'after',
|
||||
options: {
|
||||
text: translate('::Cancel'),
|
||||
onClick: () => {
|
||||
const tree = gridRef.current?.instance
|
||||
tree?.cancelEditData()
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
widget: 'dxButton',
|
||||
toolbar: 'top',
|
||||
|
|
|
|||
Loading…
Reference in a new issue