hytos / DTI_PID / SPPIDConverter_AutoModeling / Util / SPPIDUtil.cs @ f6d90b6e
이력 | 보기 | 이력해설 | 다운로드 (1.68 KB)
1 | 23eb98bf | gaqhf | 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 | ebd79b4d | gaqhf | using Converter.AutoModeling.SPPID.DB; |
9 | 23eb98bf | gaqhf | using Converter.BaseModel; |
10 | using System.Windows.Forms; |
||
11 | |||
12 | ebd79b4d | gaqhf | namespace Converter.AutoModeling.SPPID.Util |
13 | 23eb98bf | gaqhf | { |
14 | public class SPPIDUtil |
||
15 | { |
||
16 | fab4f207 | gaqhf | public static bool ConvertToSPPIDInfo(string jsonString) |
17 | 23eb98bf | gaqhf | { |
18 | 2e1e3c12 | gaqhf | SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance(); |
19 | 23eb98bf | gaqhf | try |
20 | { |
||
21 | fab4f207 | gaqhf | SPPID_DBInfo jsonSPPIDInfo = JsonConvert.DeserializeObject<SPPID_DBInfo>(jsonString); |
22 | 23eb98bf | gaqhf | |
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 | fab4f207 | gaqhf | _SPPIDInfo.Enable = false; |
43 | 23eb98bf | gaqhf | return false; |
44 | } |
||
45 | return true; |
||
46 | } |
||
47 | } |
||
48 | } |