提交
This commit is contained in:
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using GetComObj;
|
||||
using MSXML2;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NoteManageAR;
|
||||
using UFIDA.U8.Framework.Api.ControlObject.Json;
|
||||
|
||||
namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
@@ -15,32 +17,172 @@ namespace UFIDA.U8.Framework.Api.ControlObject.Common
|
||||
if (prop.PropertyType == typeof(string))
|
||||
{
|
||||
prop.SetValue(obj, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(DateTime))
|
||||
{
|
||||
prop.SetValue(obj, DateTime.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(byte))
|
||||
{
|
||||
prop.SetValue(obj, byte.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(int))
|
||||
{
|
||||
prop.SetValue(obj, int.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(long))
|
||||
{
|
||||
prop.SetValue(obj, long.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(decimal))
|
||||
{
|
||||
prop.SetValue(obj, decimal.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(double))
|
||||
{
|
||||
prop.SetValue(obj, double.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(float))
|
||||
{
|
||||
prop.SetValue(obj, float.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(short))
|
||||
{
|
||||
prop.SetValue(obj, short.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetPropValue(this PropertyInfo prop, VoucherData obj, object value)
|
||||
{
|
||||
if (prop.PropertyType == typeof(string))
|
||||
{
|
||||
prop.SetValue(obj, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(DateTime))
|
||||
{
|
||||
prop.SetValue(obj, DateTime.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(byte))
|
||||
{
|
||||
prop.SetValue(obj, byte.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(int))
|
||||
{
|
||||
prop.SetValue(obj, int.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(long))
|
||||
{
|
||||
prop.SetValue(obj, long.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(decimal))
|
||||
{
|
||||
prop.SetValue(obj, decimal.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(double))
|
||||
{
|
||||
prop.SetValue(obj, double.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(float))
|
||||
{
|
||||
prop.SetValue(obj, float.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop.PropertyType == typeof(short))
|
||||
{
|
||||
prop.SetValue(obj, short.Parse($"{value}"));
|
||||
return;
|
||||
}
|
||||
|
||||
//if (prop.PropertyType == typeof(object))
|
||||
//{
|
||||
// switch (prop.Name)
|
||||
// {
|
||||
// case "cDefine1":
|
||||
// obj.set_cDefine1($"{value}");
|
||||
// break;
|
||||
// case "cDefine2":
|
||||
// obj.set_cDefine2($"{value}");
|
||||
// break;
|
||||
// case "cDefine3":
|
||||
// obj.set_cDefine3($"{value}");
|
||||
// break;
|
||||
// case "cDefine4":
|
||||
// obj.set_cDefine4(DateTime.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine5":
|
||||
// obj.set_cDefine5(int.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine6":
|
||||
// obj.set_cDefine6(DateTime.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine7":
|
||||
// obj.set_cDefine7(float.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine8":
|
||||
// obj.set_cDefine8($"{value}");
|
||||
// break;
|
||||
// case "cDefine9":
|
||||
// obj.set_cDefine9($"{value}");
|
||||
// break;
|
||||
// case "cDefine10":
|
||||
// obj.set_cDefine10($"{value}");
|
||||
// break;
|
||||
// case "cDefine11":
|
||||
// obj.set_cDefine11($"{value}");
|
||||
// break;
|
||||
// case "cDefine12":
|
||||
// obj.set_cDefine12($"{value}");
|
||||
// break;
|
||||
// case "cDefine13":
|
||||
// obj.set_cDefine13($"{value}");
|
||||
// break;
|
||||
// case "cDefine14":
|
||||
// obj.set_cDefine14($"{value}");
|
||||
// break;
|
||||
// case "cDefine15":
|
||||
// obj.set_cDefine15(int.Parse($"{value}"));
|
||||
// break;
|
||||
// case "cDefine16":
|
||||
// obj.set_cDefine16(float.Parse($"{value}"));
|
||||
// break;
|
||||
// default:
|
||||
// prop.SetValue(obj, $"{value}");
|
||||
// break;
|
||||
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
public static IXMLDOMDocument2 ToDocument2(this Dictionary<string,object> dictionary,IXMLDOMDocument2 domDocument2=null)
|
||||
|
||||
Reference in New Issue
Block a user