hytos / DTI_PID / SPPIDConverter_AutoModeling / Util / SPPIDUtil.cs @ f6d90b6e
이력 | 보기 | 이력해설 | 다운로드 (1.68 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Threading.Tasks; |
6 |
using Newtonsoft.Json; |
7 |
using System.IO; |
8 |
using Converter.AutoModeling.SPPID.DB; |
9 |
using Converter.BaseModel; |
10 |
using System.Windows.Forms; |
11 |
|
12 |
namespace Converter.AutoModeling.SPPID.Util |
13 |
{ |
14 |
public class SPPIDUtil |
15 |
{ |
16 |
public static bool ConvertToSPPIDInfo(string jsonString) |
17 |
{ |
18 |
SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance(); |
19 |
try |
20 |
{ |
21 |
SPPID_DBInfo jsonSPPIDInfo = JsonConvert.DeserializeObject<SPPID_DBInfo>(jsonString); |
22 |
|
23 |
_SPPIDInfo.DBType = jsonSPPIDInfo.DBType; |
24 |
_SPPIDInfo.Service = jsonSPPIDInfo.Service; |
25 |
_SPPIDInfo.Site = jsonSPPIDInfo.Site; |
26 |
_SPPIDInfo.ServerIP = jsonSPPIDInfo.ServerIP; |
27 |
_SPPIDInfo.Port = jsonSPPIDInfo.Port; |
28 |
_SPPIDInfo.DBUser = jsonSPPIDInfo.DBUser; |
29 |
_SPPIDInfo.DBPassword = jsonSPPIDInfo.DBPassword; |
30 |
_SPPIDInfo.PlantPath = jsonSPPIDInfo.PlantPath; |
31 |
_SPPIDInfo.PlantDic = jsonSPPIDInfo.PlantDic; |
32 |
_SPPIDInfo.PlantPID = jsonSPPIDInfo.PlantPID; |
33 |
_SPPIDInfo.PlantPIDDic = jsonSPPIDInfo.PlantPIDDic; |
34 |
_SPPIDInfo.Plant = jsonSPPIDInfo.Plant; |
35 |
_SPPIDInfo.Enable = jsonSPPIDInfo.Enable; |
36 |
_SPPIDInfo.SelectedPlant = jsonSPPIDInfo.SelectedPlant; |
37 |
_SPPIDInfo.PlantList = jsonSPPIDInfo.PlantList; |
38 |
|
39 |
} |
40 |
catch (Exception ex) |
41 |
{ |
42 |
_SPPIDInfo.Enable = false; |
43 |
return false; |
44 |
} |
45 |
return true; |
46 |
} |
47 |
} |
48 |
} |