markus / KCOM_API / Default.aspx.cs @ 2e35dd78
이력 | 보기 | 이력해설 | 다운로드 (2.46 KB)
1 |
using IKCOM; |
---|---|
2 |
using KCOMDataModel.Common; |
3 |
using KCOMDataModel.DataModel; |
4 |
using System; |
5 |
using System.Collections.Generic; |
6 |
using System.Configuration; |
7 |
using System.Data.EntityClient; |
8 |
using System.Data.SqlClient; |
9 |
using System.Linq; |
10 |
using System.Web; |
11 |
using System.Web.UI; |
12 |
using System.Web.UI.WebControls; |
13 |
|
14 |
namespace KCOM_API |
15 |
{ |
16 |
public partial class Default : System.Web.UI.Page |
17 |
{ |
18 |
protected void Page_Load(object sender, EventArgs e) |
19 |
{ |
20 |
|
21 |
try |
22 |
{ |
23 |
string connection = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; |
24 |
|
25 |
EntityConnectionStringBuilder _bl = new EntityConnectionStringBuilder(connection); |
26 |
|
27 |
SqlConnectionStringBuilder sqpbl = new SqlConnectionStringBuilder(_bl.ProviderConnectionString); |
28 |
sqpbl.UserID = "xxxxxx"; |
29 |
sqpbl.Password = "xxxxxx"; |
30 |
|
31 |
(form1.FindControl("txtConnection") as TextBox).Text = sqpbl.ToString(); |
32 |
|
33 |
|
34 |
(form1.FindControl("txtTileSource") as TextBox).Text = KCOM_API.Properties.Settings.Default.TileSoucePath; |
35 |
(form1.FindControl("txtTileSourceSub") as TextBox).Text = KCOM_API.Properties.Settings.Default.TileSoucePath_SUB; |
36 |
|
37 |
using (KCOMEntities uc = new KCOMEntities(connection)) |
38 |
{ |
39 |
var SystemInfoSet = uc.PROPERTIES.Where(data => data.TYPE == "SystemInfo").ToList(); |
40 |
|
41 |
KCOM_SystemInfo sysInfo = new KCOM_SystemInfo(); |
42 |
|
43 |
var url = SystemInfoSet.Where(data => data.PROPERTY == "Url").FirstOrDefault(); |
44 |
if (url != null) |
45 |
{ |
46 |
sysInfo.HostName = url.VALUE; |
47 |
} |
48 |
|
49 |
url = SystemInfoSet.Where(data => data.PROPERTY == "Port").FirstOrDefault(); |
50 |
if (url != null) |
51 |
{ |
52 |
sysInfo.HostPort = url.VALUE; |
53 |
} |
54 |
|
55 |
url = uc.PROPERTIES.Where(data => data.TYPE == "STAMP").FirstOrDefault(); |
56 |
if (url != null) |
57 |
{ |
58 |
sysInfo.STAMP = url.VALUE; |
59 |
} |
60 |
|
61 |
(form1.FindControl("txtHostName") as TextBox).Text = sysInfo.HostName; |
62 |
} |
63 |
} |
64 |
catch (Exception ex) |
65 |
{ |
66 |
(form1.FindControl("txtHostName") as TextBox).Text = ex.ToString(); |
67 |
} |
68 |
|
69 |
} |
70 |
} |
71 |
} |