Skip to content

Commit 3f8e39f

Browse files
claudiamurialdoBeta Bot
authored and
Beta Bot
committed
Cherry pick branch 'genexuslabs:fix/rest-context-timezone' into beta
1 parent f1e3183 commit 3f8e39f

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

dotnet/src/dotnetcore/GxClasses.Web/Middleware/GXRestServices.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ internal void Initialize()
9797
}
9898
else
9999
{
100-
return null;
100+
T internalSDT = new T();
101+
internalSDT.context = context;
102+
return internalSDT;
101103
}
102104
}
103105
protected void LoadCollection<X, T>(GxGenericCollection<X> restModel, GXBaseCollection<T> internalModel) where T : GxUserType, new()

dotnet/src/dotnetframework/GxClasses/Domain/GxCollections.cs

+23-2
Original file line numberDiff line numberDiff line change
@@ -796,12 +796,33 @@ public GxSimpleCollection<string> ToStringCollection(int digits, int decimals)
796796
}
797797
public void FromStringCollection(GxSimpleCollection<string> value)
798798
{
799-
foreach (string item in value)
799+
if (typeof(T) == typeof(string))
800800
{
801-
Add(Convert.ChangeType(NumberUtil.Val(item.ToString()), typeof(T)));
801+
foreach (string item in value)
802+
{
803+
Add(item);
804+
}
805+
}else {
806+
foreach (string item in value)
807+
{
808+
Add(Convert.ChangeType(NumberUtil.Val(item.ToString()), typeof(T)));
809+
}
810+
}
811+
}
812+
public void FromStringCollection(GxSimpleCollection<string> value, GxContext context)
813+
{
814+
if (typeof(T) == typeof(DateTime))
815+
{
816+
foreach (string item in value)
817+
{
818+
Add(DateTimeUtil.CToT2(item, context));
819+
}
802820
}
821+
else
822+
FromStringCollection(value);
803823
}
804824

825+
805826
}
806827
#if !NETCORE
807828
[Serializable]

0 commit comments

Comments
 (0)