0

我有字段DateTime类型,我想在插件中的图像中设置它的值在前图像中设置值,在更新后在后图像中设置更新值。

母表单字段类型DateTime和子表单包含 2 个字段(旧值字段类型文本字符串和第二个字段新值类型文本字符串)

if (customerDataPreImage.Contains("ph_releasedate"))
{
     customerHistory["ph_oldreleasedate"] = Convert.ToDateTime(customerDataPreImage.Attributes["ph_releasedate"]);
}
if (customerDataPostImage.Contains("ph_releasedate"))
{
     customerHistory["ph_newreleasedate"] = Convert.ToDateTime(customerDataPostImage.Attributes["ph_releasedate"]);
}
4

1 回答 1

0

将字段类型更改为 datetime 并使用此代码现在可以正常工作

if (customerDataPreImage.Contains("ph_releasedate")) {
    customerHistory["ph_oldreleasedate2"] = customerDataPreImage.Attributes["ph_releasedate"];
}
if (customerDataPostImage.Contains("ph_releasedate")) {
    customerHistory["ph_newreleasedate2"] = customerDataPostImage.Attributes["ph_releasedate"];
}
于 2019-09-11T09:34:30.607 回答