개정판 e05bed4e
issue #000 connectionString App.Config -> ini move , daelim final service setupfile add
Change-Id: I62de9b0cdbd79173f7da663a4ea897433de2849e
FinalService/KCOM_FinalService/CommonLib/Common.cs | ||
---|---|---|
3 | 3 |
using System.IO; |
4 | 4 |
using System.Linq; |
5 | 5 |
using System.Runtime.InteropServices; |
6 |
using System.Security.Cryptography; |
|
6 | 7 |
using System.Text; |
7 | 8 |
using System.Threading.Tasks; |
8 | 9 |
|
... | ... | |
11 | 12 |
public class Common |
12 | 13 |
{ |
13 | 14 |
[DllImport("kernel32")] |
14 |
public static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
|
15 |
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
|
15 | 16 |
|
16 | 17 |
public static string AppDataFolder |
17 | 18 |
{ |
... | ... | |
20 | 21 |
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS"); |
21 | 22 |
} |
22 | 23 |
} |
24 |
public static string GetConfigString(string section, string key, string def) |
|
25 |
{ |
|
26 |
System.Text.StringBuilder strbuilder = new System.Text.StringBuilder(512); |
|
27 |
GetPrivateProfileString(section, key, def, strbuilder, 512, Path.Combine(AppDataFolder, "FinalService.ini")); |
|
28 |
return strbuilder.ToString(); |
|
29 |
} |
|
30 |
|
|
31 |
public static string GetConnectionString() |
|
32 |
{ |
|
33 |
System.Text.StringBuilder strbuilder = new System.Text.StringBuilder(512); |
|
34 |
GetPrivateProfileString("ConnectionString", "STRING", "", strbuilder, 512, Path.Combine(AppDataFolder, "FinalService.ini")); |
|
35 |
return Decrypt(strbuilder.ToString(), "Doftech1073#"); |
|
36 |
} |
|
37 |
private static string Decrypt(string textToDecrypt, string key) |
|
38 |
{ |
|
39 |
RijndaelManaged rijndaelCipher = new RijndaelManaged(); |
|
40 |
rijndaelCipher.Mode = CipherMode.CBC; |
|
41 |
rijndaelCipher.Padding = PaddingMode.PKCS7; |
|
42 |
rijndaelCipher.KeySize = 128; |
|
43 |
rijndaelCipher.BlockSize = 128; |
|
44 |
|
|
45 |
byte[] encryptedData = Convert.FromBase64String(textToDecrypt); |
|
46 |
byte[] pwdBytes = Encoding.UTF8.GetBytes(key); |
|
47 |
byte[] keyBytes = new byte[16]; |
|
48 |
|
|
49 |
int len = pwdBytes.Length; |
|
50 |
if (len > keyBytes.Length) |
|
51 |
{ |
|
52 |
len = keyBytes.Length; |
|
53 |
} |
|
54 |
|
|
55 |
Array.Copy(pwdBytes, keyBytes, len); |
|
56 |
rijndaelCipher.Key = keyBytes; |
|
57 |
rijndaelCipher.IV = keyBytes; |
|
58 |
|
|
59 |
byte[] plainText = rijndaelCipher.CreateDecryptor().TransformFinalBlock(encryptedData, 0, encryptedData.Length); |
|
60 |
return Encoding.UTF8.GetString(plainText); |
|
61 |
} |
|
23 | 62 |
} |
24 | 63 |
} |
FinalService/KCOM_FinalService/ConnectionStrEncrypt/App.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8" ?> |
|
2 |
<configuration> |
|
3 |
<startup> |
|
4 |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> |
|
5 |
</startup> |
|
6 |
</configuration> |
FinalService/KCOM_FinalService/ConnectionStrEncrypt/ConnectionStrEncrypt.csproj | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
3 |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|
4 |
<PropertyGroup> |
|
5 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
6 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
7 |
<ProjectGuid>{61F76FC9-A54E-4311-865F-05329DCACBDC}</ProjectGuid> |
|
8 |
<OutputType>Exe</OutputType> |
|
9 |
<RootNamespace>ConnectionStrEncrypt</RootNamespace> |
|
10 |
<AssemblyName>ConnectionStrEncrypt</AssemblyName> |
|
11 |
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> |
|
12 |
<FileAlignment>512</FileAlignment> |
|
13 |
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
|
14 |
<Deterministic>true</Deterministic> |
|
15 |
</PropertyGroup> |
|
16 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
17 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
18 |
<DebugSymbols>true</DebugSymbols> |
|
19 |
<DebugType>full</DebugType> |
|
20 |
<Optimize>false</Optimize> |
|
21 |
<OutputPath>bin\Debug\</OutputPath> |
|
22 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
23 |
<ErrorReport>prompt</ErrorReport> |
|
24 |
<WarningLevel>4</WarningLevel> |
|
25 |
</PropertyGroup> |
|
26 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
27 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
28 |
<DebugType>pdbonly</DebugType> |
|
29 |
<Optimize>true</Optimize> |
|
30 |
<OutputPath>bin\Release\</OutputPath> |
|
31 |
<DefineConstants>TRACE</DefineConstants> |
|
32 |
<ErrorReport>prompt</ErrorReport> |
|
33 |
<WarningLevel>4</WarningLevel> |
|
34 |
</PropertyGroup> |
|
35 |
<ItemGroup> |
|
36 |
<Reference Include="System" /> |
|
37 |
<Reference Include="System.Core" /> |
|
38 |
<Reference Include="System.Xml.Linq" /> |
|
39 |
<Reference Include="System.Data.DataSetExtensions" /> |
|
40 |
<Reference Include="Microsoft.CSharp" /> |
|
41 |
<Reference Include="System.Data" /> |
|
42 |
<Reference Include="System.Net.Http" /> |
|
43 |
<Reference Include="System.Xml" /> |
|
44 |
</ItemGroup> |
|
45 |
<ItemGroup> |
|
46 |
<Compile Include="Program.cs" /> |
|
47 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
48 |
</ItemGroup> |
|
49 |
<ItemGroup> |
|
50 |
<None Include="App.config" /> |
|
51 |
</ItemGroup> |
|
52 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|
53 |
</Project> |
FinalService/KCOM_FinalService/ConnectionStrEncrypt/Program.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Security.Cryptography; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 |
|
|
8 |
namespace ConnectionStrEncrypt |
|
9 |
{ |
|
10 |
class Program |
|
11 |
{ |
|
12 |
static void Main(string[] args) |
|
13 |
{ |
|
14 |
//String originalText = "data source=ESB-DB;database={0};user id=ProjectPortalDBConn;password=ProjectPortalDBConn"; |
|
15 |
String originalText = "data source=cloud.devdoftech.co.kr,7777;database={0};user id=doftech;password=dof1073#"; |
|
16 |
String key = "Doftech1073#"; |
|
17 |
|
|
18 |
String en = Encrypt(originalText, key); |
|
19 |
String de = Decrypt(en, key); |
|
20 |
|
|
21 |
Console.WriteLine("Original Text is " + originalText); |
|
22 |
Console.WriteLine("Encrypted Text is " + en); |
|
23 |
Console.WriteLine("Decrypted Text is " + de); |
|
24 |
|
|
25 |
} |
|
26 |
public static string Decrypt(string textToDecrypt, string key) |
|
27 |
{ |
|
28 |
RijndaelManaged rijndaelCipher = new RijndaelManaged(); |
|
29 |
rijndaelCipher.Mode = CipherMode.CBC; |
|
30 |
rijndaelCipher.Padding = PaddingMode.PKCS7; |
|
31 |
rijndaelCipher.KeySize = 128; |
|
32 |
rijndaelCipher.BlockSize = 128; |
|
33 |
|
|
34 |
byte[] encryptedData = Convert.FromBase64String(textToDecrypt); |
|
35 |
byte[] pwdBytes = Encoding.UTF8.GetBytes(key); |
|
36 |
byte[] keyBytes = new byte[16]; |
|
37 |
|
|
38 |
int len = pwdBytes.Length; |
|
39 |
if (len > keyBytes.Length) |
|
40 |
{ |
|
41 |
len = keyBytes.Length; |
|
42 |
} |
|
43 |
|
|
44 |
Array.Copy(pwdBytes, keyBytes, len); |
|
45 |
rijndaelCipher.Key = keyBytes; |
|
46 |
rijndaelCipher.IV = keyBytes; |
|
47 |
|
|
48 |
byte[] plainText = rijndaelCipher.CreateDecryptor().TransformFinalBlock(encryptedData, 0, encryptedData.Length); |
|
49 |
return Encoding.UTF8.GetString(plainText); |
|
50 |
} |
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
public static string Encrypt(string textToEncrypt, string key) |
|
55 |
{ |
|
56 |
RijndaelManaged rijndaelCipher = new RijndaelManaged(); |
|
57 |
rijndaelCipher.Mode = CipherMode.CBC; |
|
58 |
rijndaelCipher.Padding = PaddingMode.PKCS7; |
|
59 |
rijndaelCipher.KeySize = 128; |
|
60 |
rijndaelCipher.BlockSize = 128; |
|
61 |
|
|
62 |
byte[] pwdBytes = Encoding.UTF8.GetBytes(key); |
|
63 |
byte[] keyBytes = new byte[16]; |
|
64 |
int len = pwdBytes.Length; |
|
65 |
if (len > keyBytes.Length) |
|
66 |
{ |
|
67 |
len = keyBytes.Length; |
|
68 |
} |
|
69 |
|
|
70 |
Array.Copy(pwdBytes, keyBytes, len); |
|
71 |
rijndaelCipher.Key = keyBytes; |
|
72 |
rijndaelCipher.IV = keyBytes; |
|
73 |
ICryptoTransform transform = rijndaelCipher.CreateEncryptor(); |
|
74 |
byte[] plainText = Encoding.UTF8.GetBytes(textToEncrypt); |
|
75 |
return Convert.ToBase64String(transform.TransformFinalBlock(plainText, 0, plainText.Length)); |
|
76 |
} |
|
77 |
|
|
78 |
|
|
79 |
} |
|
80 |
} |
FinalService/KCOM_FinalService/ConnectionStrEncrypt/Properties/AssemblyInfo.cs | ||
---|---|---|
1 |
using System.Reflection; |
|
2 |
using System.Runtime.CompilerServices; |
|
3 |
using System.Runtime.InteropServices; |
|
4 |
|
|
5 |
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 |
|
6 |
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 |
|
7 |
// 이러한 특성 값을 변경하세요. |
|
8 |
[assembly: AssemblyTitle("ConnectionStrEncrypt")] |
|
9 |
[assembly: AssemblyDescription("")] |
|
10 |
[assembly: AssemblyConfiguration("")] |
|
11 |
[assembly: AssemblyCompany("")] |
|
12 |
[assembly: AssemblyProduct("ConnectionStrEncrypt")] |
|
13 |
[assembly: AssemblyCopyright("Copyright © 2019")] |
|
14 |
[assembly: AssemblyTrademark("")] |
|
15 |
[assembly: AssemblyCulture("")] |
|
16 |
|
|
17 |
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 |
|
18 |
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 |
|
19 |
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. |
|
20 |
[assembly: ComVisible(false)] |
|
21 |
|
|
22 |
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. |
|
23 |
[assembly: Guid("61f76fc9-a54e-4311-865f-05329dcacbdc")] |
|
24 |
|
|
25 |
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. |
|
26 |
// |
|
27 |
// 주 버전 |
|
28 |
// 부 버전 |
|
29 |
// 빌드 번호 |
|
30 |
// 수정 버전 |
|
31 |
// |
|
32 |
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 |
|
33 |
// 지정되도록 할 수 있습니다. |
|
34 |
// [assembly: AssemblyVersion("1.0.*")] |
|
35 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
36 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
FinalService/KCOM_FinalService/ConsoleApp1/ConsoleApp1.csproj | ||
---|---|---|
45 | 45 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
46 | 46 |
</ItemGroup> |
47 | 47 |
<ItemGroup> |
48 |
<ProjectReference Include="..\CommonLib\CommonLib.csproj"> |
|
49 |
<Project>{6bbe14d5-c998-47c8-bf75-c9647edad561}</Project> |
|
50 |
<Name>CommonLib</Name> |
|
51 |
</ProjectReference> |
|
52 |
<ProjectReference Include="..\IFinalPDF\IFinalPDF.csproj"> |
|
53 |
<Project>{784438be-2074-41ae-a692-24e1a4a67fe3}</Project> |
|
54 |
<Name>IFinalPDF</Name> |
|
55 |
</ProjectReference> |
|
48 | 56 |
<ProjectReference Include="..\KCOMDataModel\KCOMDataModel.csproj"> |
49 | 57 |
<Project>{629DC8CD-D458-47EF-8F02-CD12C7001C3E}</Project> |
50 | 58 |
<Name>KCOMDataModel</Name> |
... | ... | |
53 | 61 |
<Project>{a714bd67-8aac-4ed8-8ecf-7853c3549a68}</Project> |
54 | 62 |
<Name>MarkupToPDF</Name> |
55 | 63 |
</ProjectReference> |
64 |
<ProjectReference Include="..\UploadFinal\UploadFinal.csproj"> |
|
65 |
<Project>{9cf3737a-e04d-4a55-924e-c88725dfbec7}</Project> |
|
66 |
<Name>UploadFinal</Name> |
|
67 |
</ProjectReference> |
|
56 | 68 |
</ItemGroup> |
57 | 69 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
58 | 70 |
</Project> |
FinalService/KCOM_FinalService/ConsoleApp1/Program.cs | ||
---|---|---|
1 |
using KCOMDataModel; |
|
1 |
using IFinalPDF; |
|
2 |
using KCOMDataModel; |
|
2 | 3 |
using KCOMDataModel.Common; |
3 | 4 |
using KCOMDataModel.DataModel; |
4 | 5 |
using System; |
... | ... | |
9 | 10 |
|
10 | 11 |
namespace ConsoleApp1 |
11 | 12 |
{ |
12 |
class Program |
|
13 |
static class Program
|
|
13 | 14 |
{ |
14 | 15 |
static void Main(string[] args) |
15 | 16 |
{ |
... | ... | |
41 | 42 |
// + @"\" + "11111111" + @"\"; |
42 | 43 |
// } |
43 | 44 |
//} |
44 |
|
|
45 |
using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
45 |
try |
|
46 | 46 |
{ |
47 |
//FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == "ngKwBgMotw8d56dea3839120d").FirstOrDefault(); |
|
48 |
FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == "f8Gv6hVdw8d6e881c26a4199").FirstOrDefault(); |
|
49 |
///FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == "Bm6qsYD9Hu8d6e7c702626345").FirstOrDefault(); |
|
50 |
//_entity.FINAL_PDF.AddObject(new FINAL_PDF |
|
51 |
//{ |
|
52 |
// ID = Guid.NewGuid().ToString(), |
|
53 |
// CREATE_DATETIME = DateTime.Now, |
|
54 |
// CREATE_USER_ID = "h2011357", |
|
55 |
// DOCINFO_ID = "ac77a75e-39d1-1764-eae3-cd252ddf4324", |
|
56 |
// DOCUMENT_ID = "11111116", |
|
57 |
// MARKUPINFO_ID = "LDEeSHCzVT8d56b76220a8e9e", |
|
58 |
// PROJECT_NO = "000000", |
|
59 |
// TOTAL_PAGE = 8, |
|
60 |
// STATUS = 0, |
|
61 |
// CURRENT_PAGE = 1, |
|
62 |
//}); |
|
63 |
//_entity.SaveChanges(); |
|
47 |
Console.WriteLine("Test Process..."); |
|
48 |
Console.WriteLine("Insert Final PDF id :"); |
|
49 |
string inputstr = Console.ReadLine(); |
|
50 |
using (KCOMEntities _entity = new KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
51 |
{ |
|
52 |
//FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == "ngKwBgMotw8d56dea3839120d").FirstOrDefault(); |
|
53 |
FINAL_PDF item = _entity.FINAL_PDF.Where(d => d.ID == inputstr).FirstOrDefault(); |
|
54 |
if (item != null) |
|
55 |
{ |
|
56 |
Console.WriteLine("final pdf start"); |
|
57 |
MarkupToPDF.MarkupToPDF pdf = new MarkupToPDF.MarkupToPDF(); |
|
58 |
pdf.EndFinal += Pdf_EndFinal; |
|
59 |
pdf.FinalMakeError += Pdf_FinalMakeError; |
|
60 |
//pdf.MakeFinalPDF(_entity.FINAL_PDF.FirstOrDefault()); |
|
61 |
pdf.MakeFinalPDF(item); |
|
62 |
//_Thread.Add(item); |
|
63 |
} |
|
64 |
else |
|
65 |
{ |
|
66 |
Console.WriteLine("item is null"); |
|
67 |
} |
|
68 |
|
|
69 |
} |
|
64 | 70 |
|
65 |
MarkupToPDF.MarkupToPDF pdf = new MarkupToPDF.MarkupToPDF(); |
|
66 |
pdf.EndFinal += Pdf_EndFinal; |
|
67 |
pdf.FinalMakeError += Pdf_FinalMakeError; |
|
68 |
//pdf.MakeFinalPDF(_entity.FINAL_PDF.FirstOrDefault()); |
|
69 |
pdf.MakeFinalPDF(item); |
|
70 | 71 |
} |
72 |
catch (Exception ex) |
|
73 |
{ |
|
74 |
Console.WriteLine("error: "+ ex.ToString()); |
|
75 |
} |
|
76 |
|
|
71 | 77 |
} |
72 | 78 |
|
73 | 79 |
private static void Pdf_FinalMakeError(object sender, MarkupToPDF.MakeFinalErrorArgs e) |
74 | 80 |
{ |
75 | 81 |
|
76 | 82 |
} |
77 |
|
|
83 |
static List<FINAL_PDF> _Thread = new List<FINAL_PDF>(); |
|
78 | 84 |
private static void Pdf_EndFinal(object sender, MarkupToPDF.EndFinalEventArgs e) |
79 | 85 |
{ |
86 |
FINAL_PDF _item = (sender as MarkupToPDF.MarkupToPDF).FinalItem; |
|
87 |
|
|
88 |
SetFinalState(_item.ID, FinalStatus.PdfStamp); |
|
89 |
|
|
90 |
try |
|
91 |
{ |
|
92 |
Console.WriteLine("final pdf end"); |
|
93 |
string soapurl = string.Empty; |
|
94 |
using (KCOMDataModel.DataModel.KCOMEntities _systemEntity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
95 |
{ |
|
96 |
var item = _systemEntity.PROPERTIES.Where(data => data.TYPE == "UpLoadServiceUrl").FirstOrDefault(); |
|
97 |
if (item != null) soapurl = item.VALUE; |
|
98 |
} |
|
99 |
Console.WriteLine("soapurl:"+soapurl); |
|
100 |
if (!string.IsNullOrEmpty(soapurl)) |
|
101 |
{ |
|
102 |
//Legacy IF |
|
103 |
KeyValuePair<bool, string> result = UploadFinal.UploadFinal.UploadFinalPDF(e.FinalPDFPath.Replace(@"\\172.20.121.220\comment3\finalPDF\", ""), e.OriginPDFName, e.FinalPDF, soapurl); |
|
104 |
if (result.Key) |
|
105 |
{ |
|
106 |
SetFinalState(_item.ID, FinalStatus.Success); |
|
107 |
} |
|
108 |
else |
|
109 |
{ |
|
110 |
SetFinalState(_item.ID, FinalStatus.Error); |
|
111 |
Console.WriteLine("pram1:"+ e.FinalPDFPath.Replace(@"\\172.20.121.220\comment3\finalPDF\", "")+",pram2:"+ e.OriginPDFName); |
|
112 |
//_Log.Write("Upload error .." + e.FinalPDFPath + ",pdfname:" + e.OriginPDFName); |
|
113 |
} |
|
114 |
} |
|
115 |
else |
|
116 |
{ |
|
117 |
///TODO: 저장할 폴더 위치를 configuration으로 빼주세요 |
|
118 |
///Local Test 용 저장 위치 |
|
119 |
string savepath = CommonLib.Common.GetConfigString("DebugSavePath", "URL", ""); |
|
120 |
|
|
121 |
string saveFolder = String.Format(savepath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID); |
|
122 |
if (!System.IO.Directory.Exists(saveFolder)) |
|
123 |
{ |
|
124 |
System.IO.Directory.CreateDirectory(saveFolder); |
|
125 |
} |
|
126 |
|
|
127 |
//this._Log.Write(String.Format("saveFolder : {0}", saveFolder) + DateTime.Now); |
|
128 |
System.IO.File.Copy(e.FinalPDFPath, saveFolder + e.OriginPDFName, true); |
|
129 |
|
|
130 |
using (CIEntities _entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(_item.PROJECT_NO).ToString())) |
|
131 |
{ |
|
132 |
var item = _entity.DOCUMENT_ITEM.Where(d => d.DOCUMENT_ID == _item.DOCUMENT_ID).FirstOrDefault(); |
|
133 |
///TODO: RESULT FILE 경로 위치를 configuration으로 빼주세요 |
|
134 |
///Local Test 용 result url |
|
135 |
|
|
136 |
string resultpath = CommonLib.Common.GetConfigString("DebugResultUrlPath", "URL", ""); |
|
137 |
item.RESULT_FILE = String.Format(resultpath.ToString(), _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName); |
|
138 |
|
|
139 |
//sendReqLog("RESULT_FILE_PATH", item.RESULT_FILE); |
|
140 |
_entity.SaveChanges(); |
|
141 |
SetFinalState(_item.ID, FinalStatus.Success); |
|
142 |
//_Thread.Remove(_T.First()); |
|
143 |
} |
|
144 |
} |
|
145 |
} |
|
146 |
catch (Exception ex) |
|
147 |
{ |
|
148 |
SetFinalState(_item.ID, FinalStatus.Error); |
|
149 |
//_Log.Write("에러 .." + ex.Message); |
|
150 |
//_Thread.Remove(_T.First()); |
|
151 |
} |
|
152 |
} |
|
153 |
private static void SetFinalState(string finalID, FinalStatus status) |
|
154 |
{ |
|
155 |
using (KCOMDataModel.DataModel.KCOMEntities _entity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString())) |
|
156 |
{ |
|
157 |
var finalList = _entity.FINAL_PDF.Where(final => final.ID == finalID); |
|
158 |
|
|
159 |
if (finalList.Count() > 0) |
|
160 |
{ |
|
161 |
if (status == FinalStatus.Create) |
|
162 |
{ |
|
163 |
finalList.First().START_DATETIME = DateTime.Now; |
|
164 |
} |
|
165 |
if (status == FinalStatus.Success) |
|
166 |
{ |
|
167 |
finalList.First().END_DATETIME = DateTime.Now; |
|
168 |
} |
|
80 | 169 |
|
81 |
//경로 에러가 있음 "\\\\192.168.0.67\\finalpdf\\resulttmpE468.pdf" |
|
170 |
finalList.First().STATUS = (int)status; |
|
171 |
_entity.SaveChanges(); |
|
172 |
} |
|
173 |
}; |
|
82 | 174 |
} |
83 | 175 |
} |
84 | 176 |
} |
FinalService/KCOM_FinalService/FinalService_Watcher/FinalService_Watcher.cs | ||
---|---|---|
18 | 18 |
{ |
19 | 19 |
InitializeComponent(); |
20 | 20 |
|
21 |
System.Text.StringBuilder monitorservicename = new System.Text.StringBuilder(512); |
|
22 |
CommonLib.Common.GetPrivateProfileString("FinalServiceName", "NAME", "FinalService", monitorservicename, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini"));
|
|
23 |
_controller = new ServiceController(monitorservicename.ToString());
|
|
21 |
|
|
22 |
string monitorservicename = CommonLib.Common.GetConfigString("FinalServiceName", "NAME", "");
|
|
23 |
_controller = new ServiceController(monitorservicename); |
|
24 | 24 |
this.EventLog.Source = this.ServiceName; |
25 | 25 |
this.EventLog.Log = "Application"; |
26 | 26 |
|
FinalService/KCOM_FinalService/KCOMDataModel/App.Config | ||
---|---|---|
3 | 3 |
<configSections> |
4 | 4 |
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> |
5 | 5 |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
6 |
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
|
7 |
<section name="KCOMDataModel.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
|
8 |
</sectionGroup> |
|
9 | 6 |
</configSections> |
10 | 7 |
<connectionStrings> |
11 | 8 |
<add name="KCOMEntities" connectionString="metadata=res://*/DataModel.KCOM_Model.csdl|res://*/DataModel.KCOM_Model.ssdl|res://*/DataModel.KCOM_Model.msl;provider=System.Data.SqlClient;provider connection string="data source=cloud.devdoftech.co.kr,7777;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" /> |
... | ... | |
18 | 15 |
</parameters> |
19 | 16 |
</defaultConnectionFactory> |
20 | 17 |
</entityFramework> |
21 |
<applicationSettings> |
|
22 |
<KCOMDataModel.Properties.Settings> |
|
23 |
<setting name="ProjectConnectionString" serializeAs="String"> |
|
24 |
<value>data source=cloud.devdoftech.co.kr,7777;database={0};user id=doftech;password=dof1073#</value> |
|
25 |
</setting> |
|
26 |
</KCOMDataModel.Properties.Settings> |
|
27 |
</applicationSettings> |
|
28 | 18 |
</configuration> |
FinalService/KCOM_FinalService/KCOMDataModel/Common/ConnectStringBuilder.cs | ||
---|---|---|
18 | 18 |
|
19 | 19 |
public static EntityConnectionStringBuilder KCOMConnectionString() |
20 | 20 |
{ |
21 |
SqlConnectionStringBuilder _bl = new SqlConnectionStringBuilder(string.Format(Properties.Settings.Default.ProjectConnectionString, "markus")); |
|
21 |
|
|
22 |
SqlConnectionStringBuilder _bl = new SqlConnectionStringBuilder(string.Format(CommonLib.Common.GetConnectionString(), "markus")); |
|
22 | 23 |
return EntityConnectionStringBuilder(_bl, DeepViewMeta); |
23 | 24 |
} |
24 | 25 |
public static EntityConnectionStringBuilder ProjectCIConnectString(string ProjectNo) |
25 | 26 |
{ |
26 |
return CIConnectionStringBuilder(Properties.Settings.Default.ProjectConnectionString, ProjectNo, CIMeta);
|
|
27 |
return CIConnectionStringBuilder(CommonLib.Common.GetConnectionString(), ProjectNo, CIMeta);
|
|
27 | 28 |
} |
28 | 29 |
|
29 | 30 |
private static EntityConnectionStringBuilder CIConnectionStringBuilder(string adoConnectionString, string ProjectNo, string Metadata) |
30 | 31 |
{ |
31 | 32 |
try |
32 | 33 |
{ |
33 |
SqlConnectionStringBuilder bl = new SqlConnectionStringBuilder(string.Format(Properties.Settings.Default.ProjectConnectionString, "markus"));
|
|
34 |
SqlConnectionStringBuilder bl = new SqlConnectionStringBuilder(string.Format(CommonLib.Common.GetConnectionString(), "markus"));
|
|
34 | 35 |
|
35 | 36 |
using (DataModel.KCOMEntities entity |
36 | 37 |
= new DataModel.KCOMEntities(EntityConnectionStringBuilder(bl, DeepViewMeta).ToString())) |
FinalService/KCOM_FinalService/KCOMDataModel/KCOMDataModel.csproj | ||
---|---|---|
88 | 88 |
<ItemGroup> |
89 | 89 |
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" /> |
90 | 90 |
</ItemGroup> |
91 |
<ItemGroup> |
|
92 |
<ProjectReference Include="..\CommonLib\CommonLib.csproj"> |
|
93 |
<Project>{ee9aaabc-1678-43a4-878e-cedbb577cf01}</Project> |
|
94 |
<Name>CommonLib</Name> |
|
95 |
</ProjectReference> |
|
96 |
</ItemGroup> |
|
91 | 97 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
92 | 98 |
</Project> |
FinalService/KCOM_FinalService/KCOMDataModel/Properties/Settings.Designer.cs | ||
---|---|---|
1 | 1 |
//------------------------------------------------------------------------------ |
2 | 2 |
// <auto-generated> |
3 |
// This code was generated by a tool.
|
|
4 |
// Runtime Version:4.0.30319.42000
|
|
3 |
// 이 코드는 도구를 사용하여 생성되었습니다.
|
|
4 |
// 런타임 버전:4.0.30319.42000
|
|
5 | 5 |
// |
6 |
// Changes to this file may cause incorrect behavior and will be lost if
|
|
7 |
// the code is regenerated.
|
|
6 |
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
|
|
7 |
// 이러한 변경 내용이 손실됩니다.
|
|
8 | 8 |
// </auto-generated> |
9 | 9 |
//------------------------------------------------------------------------------ |
10 | 10 |
|
... | ... | |
12 | 12 |
|
13 | 13 |
|
14 | 14 |
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
15 |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")]
|
|
15 |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
|
|
16 | 16 |
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { |
17 | 17 |
|
18 | 18 |
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); |
... | ... | |
22 | 22 |
return defaultInstance; |
23 | 23 |
} |
24 | 24 |
} |
25 |
|
|
26 |
[global::System.Configuration.ApplicationScopedSettingAttribute()] |
|
27 |
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
28 |
[global::System.Configuration.DefaultSettingValueAttribute("data source=cloud.devdoftech.co.kr,7777;database={0};user id=doftech;password=dof" + |
|
29 |
"1073#")] |
|
30 |
public string ProjectConnectionString { |
|
31 |
get { |
|
32 |
return ((string)(this["ProjectConnectionString"])); |
|
33 |
} |
|
34 |
} |
|
35 | 25 |
} |
36 | 26 |
} |
FinalService/KCOM_FinalService/KCOMDataModel/Properties/Settings.settings | ||
---|---|---|
1 | 1 |
<?xml version='1.0' encoding='utf-8'?> |
2 |
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="KCOMDataModel.Properties" GeneratedClassName="Settings">
|
|
2 |
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> |
|
3 | 3 |
<Profiles /> |
4 |
<Settings> |
|
5 |
<Setting Name="ProjectConnectionString" Type="System.String" Scope="Application"> |
|
6 |
<Value Profile="(Default)">data source=cloud.devdoftech.co.kr,7777;database={0};user id=doftech;password=dof1073#</Value> |
|
7 |
</Setting> |
|
8 |
</Settings> |
|
4 |
<Settings /> |
|
9 | 5 |
</SettingsFile> |
FinalService/KCOM_FinalService/KCOM_FinalService.sln | ||
---|---|---|
23 | 23 |
EndProject |
24 | 24 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonLib", "CommonLib\CommonLib.csproj", "{EE9AAABC-1678-43A4-878E-CEDBB577CF01}" |
25 | 25 |
EndProject |
26 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConnectionStrEncrypt", "ConnectionStrEncrypt\ConnectionStrEncrypt.csproj", "{61F76FC9-A54E-4311-865F-05329DCACBDC}" |
|
27 |
EndProject |
|
26 | 28 |
Global |
27 | 29 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
28 | 30 |
Debug|Any CPU = Debug|Any CPU |
... | ... | |
127 | 129 |
{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|x64.Build.0 = Release|Any CPU |
128 | 130 |
{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|x86.ActiveCfg = Release|Any CPU |
129 | 131 |
{EE9AAABC-1678-43A4-878E-CEDBB577CF01}.Release|x86.Build.0 = Release|Any CPU |
132 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
133 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
134 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Debug|x64.ActiveCfg = Debug|Any CPU |
|
135 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Debug|x64.Build.0 = Debug|Any CPU |
|
136 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
137 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Debug|x86.Build.0 = Debug|Any CPU |
|
138 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
139 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Release|Any CPU.Build.0 = Release|Any CPU |
|
140 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Release|x64.ActiveCfg = Release|Any CPU |
|
141 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Release|x64.Build.0 = Release|Any CPU |
|
142 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Release|x86.ActiveCfg = Release|Any CPU |
|
143 |
{61F76FC9-A54E-4311-865F-05329DCACBDC}.Release|x86.Build.0 = Release|Any CPU |
|
130 | 144 |
EndGlobalSection |
131 | 145 |
GlobalSection(SolutionProperties) = preSolution |
132 | 146 |
HideSolutionNode = FALSE |
FinalService/KCOM_FinalService/KCOM_FinalService/FinalService.ini | ||
---|---|---|
11 | 11 |
[FinalServiceName] |
12 | 12 |
NAME=FinalService |
13 | 13 |
[UpLoadServiceUrl] |
14 |
URL= |
|
14 |
URL= |
|
15 |
[ConnectionString] |
|
16 |
STRING=EVCOYxwadMNh7qzjMvRTwOacwyFatXgWjx//sssrSKTsvMkdvpdBa3Sj3mmhwABTiweSqNnWYgsIxUWXaBe8XE8G1CLaux2zPbyBWvqxJruTX0H5MqABZSEXXG82XaGL |
FinalService/KCOM_FinalService/KCOM_FinalService/FinalService_Daelim.ini | ||
---|---|---|
1 |
[PDFMovePath] |
|
2 |
URL=\\172.20.121.220\comment3\finalPDF\ |
|
3 |
[ApprovedImgPath] |
|
4 |
URL=\\172.20.121.220\comment3\TileSource\approved.png |
|
5 |
[CheckmarkImgPath] |
|
6 |
URL=\\172.20.121.220\comment3\TileSource\checkmark.png |
|
7 |
[DebugSavePath] |
|
8 |
URL=D:\\Develop\\Ensemble\\{0}_app\\VPCS_DOCLIB\\{1}\\{2}\\ToVendor\\ |
|
9 |
[DebugResultUrlPath] |
|
10 |
URL=http://cloud.devdoftech.co.kr:5977/FinalPDF/{0}_app/VPCS_DOCLIB/{1}/{2}/ToVendor/{3} |
|
11 |
[FinalServiceName] |
|
12 |
NAME=FinalService |
|
13 |
[UpLoadServiceUrl] |
|
14 |
URL=http://172.20.110.75:8880/ifweb/services/DLMWebService?wsdl |
|
15 |
[ConnectionString] |
|
16 |
STRING=61VMQbitlv3KSBCT5dBNbNkw6bSkCZ8pEW0vqGl1UCT3fm06j4VHu2nh5qH6D/dIlz0XKWJfMkmriZ+Y1SKbkQkKMp4Ln+GWrS5rzRu9WBMQ8Gk+/KKYgxTQhIjv6uNV |
FinalService/KCOM_FinalService/KCOM_FinalService/Remoting/RemFinalPDFStation.cs | ||
---|---|---|
207 | 207 |
|
208 | 208 |
try |
209 | 209 |
{ |
210 |
System.Text.StringBuilder url = new System.Text.StringBuilder(512); |
|
211 |
CommonLib.Common.GetPrivateProfileString("UpLoadServiceUrl", "URL", "", url, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini")); |
|
212 |
string soapurl = url.ToString(); |
|
210 |
string soapurl = CommonLib.Common.GetConfigString("UpLoadServiceUrl", "URL", ""); |
|
213 | 211 |
|
214 | 212 |
if(!string.IsNullOrEmpty(soapurl)) |
215 | 213 |
{ |
... | ... | |
229 | 227 |
else |
230 | 228 |
{ |
231 | 229 |
///TODO: 저장할 폴더 위치를 configuration으로 빼주세요 |
232 |
System.Text.StringBuilder pdfsavepath = new System.Text.StringBuilder(512); |
|
233 |
CommonLib.Common.GetPrivateProfileString("DebugSavePath", "URL", "(NONE)", pdfsavepath, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini"));
|
|
230 |
|
|
231 |
string savepath = CommonLib.Common.GetConfigString("DebugSavePath", "URL", "");
|
|
234 | 232 |
|
235 |
|
|
236 |
string saveFolder = String.Format(pdfsavepath.ToString(), _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID); |
|
233 |
string saveFolder = String.Format(savepath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID); |
|
237 | 234 |
if (!System.IO.Directory.Exists(saveFolder)) |
238 | 235 |
{ |
239 | 236 |
System.IO.Directory.CreateDirectory(saveFolder); |
... | ... | |
253 | 250 |
{ |
254 | 251 |
var item = _entity.DOCUMENT_ITEM.Where(d => d.DOCUMENT_ID == _item.DOCUMENT_ID).FirstOrDefault(); |
255 | 252 |
///TODO: RESULT FILE 경로 위치를 configuration으로 빼주세요 |
256 |
System.Text.StringBuilder resultFileFolder = new System.Text.StringBuilder(512);
|
|
257 |
CommonLib.Common.GetPrivateProfileString("DebugResultUrlPath", "URL", "(NONE)", resultFileFolder, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini")); |
|
258 |
item.RESULT_FILE = String.Format(resultFileFolder.ToString(), _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
|
|
253 |
string resultpath = CommonLib.Common.GetConfigString("DebugResultUrlPath", "URL", "");
|
|
254 |
|
|
255 |
item.RESULT_FILE = String.Format(resultpath, _item.PROJECT_NO, Convert.ToInt32(_item.DOCUMENT_ID) / 100, _item.DOCUMENT_ID, e.OriginPDFName);
|
|
259 | 256 |
sendReqLog("RESULT_FILE_PATH", item.RESULT_FILE); |
260 | 257 |
_entity.SaveChanges(); |
261 | 258 |
SetFinalState(_item.ID, FinalStatus.Success); |
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_Image.cs | ||
---|---|---|
18 | 18 |
public static void DrawSign(System.Windows.Point startPoint, System.Windows.Point endPoint, List<System.Windows.Point> pointSet, PdfContentByte contentByte, string UserID, double Angle, double opac, string projectNo) |
19 | 19 |
{ |
20 | 20 |
contentByte.SaveState(); |
21 |
System.Text.StringBuilder url = new System.Text.StringBuilder(512); |
|
22 |
CommonLib.Common.GetPrivateProfileString("UpLoadServiceUrl", "URL", "", url, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini")); |
|
23 |
string soapurl = url.ToString(); |
|
21 |
string soapurl = CommonLib.Common.GetConfigString("UpLoadServiceUrl", "URL", ""); |
|
24 | 22 |
|
25 | 23 |
if (!string.IsNullOrEmpty(soapurl)) |
26 | 24 |
{ |
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
13 | 13 |
using System.Net; |
14 | 14 |
using System.Runtime.InteropServices; |
15 | 15 |
using System.Text; |
16 |
using System.Web; |
|
16 | 17 |
using System.Windows; |
17 | 18 |
using System.Windows.Media; |
18 | 19 |
|
... | ... | |
77 | 78 |
|
78 | 79 |
private string GetFileName(string hrefLink) |
79 | 80 |
{ |
80 |
return System.IO.Path.GetFileName(hrefLink.Replace("/", "\\")); |
|
81 |
try |
|
82 |
{ |
|
83 |
if (hrefLink.Contains("vpcs_doclib")) |
|
84 |
{ |
|
85 |
return System.IO.Path.GetFileName(hrefLink.Replace("/", "\\")); |
|
86 |
} |
|
87 |
else |
|
88 |
{ |
|
89 |
Uri fileurl = new Uri(hrefLink); |
|
90 |
int index = hrefLink.IndexOf("?"); |
|
91 |
string filename = HttpUtility.ParseQueryString(fileurl.Query).Get("fileName"); |
|
92 |
return filename; |
|
93 |
} |
|
94 |
} |
|
95 |
catch (Exception ex) |
|
96 |
{ |
|
97 |
throw ex; |
|
98 |
} |
|
81 | 99 |
} |
82 | 100 |
|
83 | 101 |
public Point GetPdfPointSystem(Point point) |
... | ... | |
211 | 229 |
#region 파일 체크 |
212 | 230 |
if (_files.Count() == 1) |
213 | 231 |
{ |
214 |
if (_files.First().Name.ToLower() == GetFileName(documentItem.ORIGINAL_FILE).ToLower())
|
|
232 |
if (_files.First().Name.ToLower() == GetFileName(HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE).ToLower()))
|
|
215 | 233 |
{ |
216 | 234 |
OriginFileName = _files.First().Name; |
217 | 235 |
PdfFilePath = _files.First().CopyTo(TestFile, true); |
218 | 236 |
} |
219 | 237 |
else |
220 | 238 |
{ |
221 |
throw new Exception("현재 폴더 내 파일명이 데이터베이스와 상이합니다");
|
|
239 |
throw new Exception("현재 폴더 내 파일명이 데이터베이스와 상이합니다.filename:" + _files.First().Name.ToLower() + ",url:" + HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE).ToLower());
|
|
222 | 240 |
} |
223 | 241 |
} |
224 | 242 |
else if (_files.Count() > 1) |
225 | 243 |
{ |
226 |
var originalFile = _files.Where(data => data.Name == GetFileName(documentItem.ORIGINAL_FILE)).FirstOrDefault();
|
|
244 |
var originalFile = _files.Where(data => data.Name == GetFileName(HttpUtility.UrlDecode(documentItem.ORIGINAL_FILE))).FirstOrDefault();
|
|
227 | 245 |
|
228 | 246 |
if (originalFile == null) |
229 | 247 |
{ |
... | ... | |
299 | 317 |
EndFinal(this, new EndFinalEventArgs |
300 | 318 |
{ |
301 | 319 |
OriginPDFName = OriginFileName, |
302 |
FinalPDFPath = _FinalPDFStorgeRemote + "\\" + FinalPDFPath.Name,
|
|
320 |
FinalPDFPath = FinalPDFPath.FullName,
|
|
303 | 321 |
Error = "", |
304 | 322 |
Message = "", |
305 | 323 |
FinalPDF = FinalPDF, |
... | ... | |
1024 | 1042 |
SolidColorBrush FontColor = _SetColor; |
1025 | 1043 |
double Angle = control.Angle; |
1026 | 1044 |
double Opacity = control.Opac; |
1027 |
|
|
1028 |
StringBuilder ApprovedImgPath = new StringBuilder(512); |
|
1029 |
GetPrivateProfileString("ApprovedImgPath", "URL", "(NONE)", ApprovedImgPath, 512, Path.Combine(AppDataFolder, "FinalService.ini")); |
|
1030 |
|
|
1031 |
Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawApproval(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, ApprovedImgPath.ToString()); |
|
1045 |
|
|
1046 |
string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", ""); |
|
1047 |
Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawApproval(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath); |
|
1032 | 1048 |
} |
1033 | 1049 |
break; |
1034 | 1050 |
case "SymControl": |
... | ... | |
1040 | 1056 |
SolidColorBrush FontColor = _SetColor; |
1041 | 1057 |
double Angle = control.Angle; |
1042 | 1058 |
double Opacity = control.Opac; |
1043 |
|
|
1044 |
StringBuilder imgpath = new StringBuilder(512); |
|
1045 |
GetPrivateProfileString("CheckmarkImgPath", "URL", "(NONE)", imgpath, 512, Path.Combine(AppDataFolder, "FinalService.ini")); |
|
1046 |
|
|
1047 |
Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath.ToString()); |
|
1059 |
|
|
1060 |
string imgpath = CommonLib.Common.GetConfigString("ApprovedImgPath", "URL", ""); |
|
1061 |
Controls_PDF.HoneyPDFLib_DrawSet_Symbol.DrawCheckMark(StartPoint, EndPoint, pointSet, contentByte, _SetColor, Angle, Opacity, imgpath); |
|
1048 | 1062 |
} |
1049 | 1063 |
break; |
1050 | 1064 |
#endregion |
... | ... | |
1097 | 1111 |
FinalPDFPath = new FileInfo(pdfFilePath); |
1098 | 1112 |
|
1099 | 1113 |
///TODO : 복사할 경로를 configuration으로 빼주세요 |
1100 |
//File.Move(FinalPDFPath.FullName, @"\\192.168.0.67\finalpdf\" + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1101 |
//FinalPDFPath = new FileInfo(@"\\192.168.0.67\finalpdf\" + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1102 |
StringBuilder PDFMovePath = new StringBuilder(512); |
|
1103 |
GetPrivateProfileString("PDFMovePath", "URL", "(NONE)", PDFMovePath, 512, Path.Combine(AppDataFolder, "FinalService.ini")); |
|
1104 |
File.Move(FinalPDFPath.FullName, PDFMovePath.ToString() + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1105 |
FinalPDFPath = new FileInfo(PDFMovePath.ToString() + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1114 |
|
|
1115 |
string pdfmovepath = CommonLib.Common.GetConfigString("PDFMovePath", "URL", ""); |
|
1116 |
File.Move(FinalPDFPath.FullName, pdfmovepath + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1117 |
FinalPDFPath = new FileInfo(pdfmovepath + FinalPDFPath.Name.Replace(".tmp", ".pdf")); |
|
1106 | 1118 |
|
1107 | 1119 |
try |
1108 | 1120 |
{ |
... | ... | |
1129 | 1141 |
public void Dispose() |
1130 | 1142 |
{ |
1131 | 1143 |
throw new NotImplementedException(); |
1132 |
} |
|
1133 |
|
|
1134 |
[DllImport("kernel32")] |
|
1135 |
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); |
|
1136 |
|
|
1137 |
public static string AppDataFolder |
|
1138 |
{ |
|
1139 |
get |
|
1140 |
{ |
|
1141 |
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS"); |
|
1142 |
} |
|
1143 |
} |
|
1144 |
} |
|
1144 | 1145 |
|
1145 | 1146 |
#endregion |
1146 | 1147 |
} |
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.csproj | ||
---|---|---|
71 | 71 |
</Reference> |
72 | 72 |
<Reference Include="System.Runtime.Serialization" /> |
73 | 73 |
<Reference Include="System.Security" /> |
74 |
<Reference Include="System.Web" /> |
|
74 | 75 |
<Reference Include="System.Windows.Forms" /> |
75 | 76 |
<Reference Include="System.Xaml" /> |
76 | 77 |
<Reference Include="System.Xml.Linq" /> |
FinalService_daelim.wxs | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> |
|
3 |
<Product Id="*" Name="FinalService" Language="1033" Version="1.0.0.0" Manufacturer="DOFTECH(C)" UpgradeCode="3E187583-A5AF-4DA2-89A1-83C192A0E60A"> |
|
4 |
<Package Platform="x64" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> |
|
5 |
|
|
6 |
<MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A newer version of [ProductName] is already installed. Setup will now exit." AllowSameVersionUpgrades="yes"/> |
|
7 |
<MediaTemplate EmbedCab="yes"/> |
|
8 |
|
|
9 |
<WixVariable Id="WixUIBannerBmp" Value="DOFTECH_LOGO.bmp" /> |
|
10 |
|
|
11 |
<Feature Id="ProductFeature" Title="FinalService" Level="1"> |
|
12 |
<ComponentGroupRef Id="FinalService" /> |
|
13 |
</Feature> |
|
14 |
</Product> |
|
15 |
|
|
16 |
<Fragment> |
|
17 |
<Directory Id="TARGETDIR" Name="SourceDir"> |
|
18 |
<Directory Id="DesktopFolder" Name="Desktop"> |
|
19 |
<Component Id="DesktopShortcut" Guid="D2FB7154-BFE6-4B11-BD62-69CF1E63DA23" Feature="ProductFeature"> |
|
20 |
<RegistryValue Root="HKCU" Key="Software\DOFTECH\MARKUS\FinalService" Name="installed" Type="integer" Value="1" KeyPath="yes"/> |
|
21 |
<Shortcut Id="DesktopShortcut" |
|
22 |
Directory="DesktopFolder" |
|
23 |
Name="FinalService" |
|
24 |
Description="FinalService" |
|
25 |
Target="[INSTALLFOLDER]KCOM_FinalService.exe" |
|
26 |
WorkingDirectory="INSTALLFOLDER" /> |
|
27 |
<RemoveFolder Id="DesktopFolder" On="uninstall"/> |
|
28 |
</Component> |
|
29 |
</Directory> |
|
30 |
|
|
31 |
<Directory Id="ProgramFiles64Folder"> |
|
32 |
<Directory Id="COMPANYFOLDER" Name="DOFTECH"> |
|
33 |
<Directory Id="PRODUCTFOLDER" Name="MARKUS"> |
|
34 |
<Directory Id="INSTALLFOLDER" Name="FinalService" /> |
|
35 |
</Directory> |
|
36 |
</Directory> |
|
37 |
</Directory> |
|
38 |
</Directory> |
|
39 |
|
|
40 |
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" /> |
|
41 |
<UI> |
|
42 |
<UIRef Id="WixUI_InstallDir"/> |
|
43 |
<Publish Dialog="WelcomeDlg" |
|
44 |
Control="Next" |
|
45 |
Event="NewDialog" |
|
46 |
Value="InstallDirDlg" |
|
47 |
Order="2">1</Publish> |
|
48 |
<Publish Dialog="InstallDirDlg" |
|
49 |
Control="Back" |
|
50 |
Event="NewDialog" |
|
51 |
Value="WelcomeDlg" |
|
52 |
Order="2">1</Publish> |
|
53 |
<Publish Dialog="ExitDialog" |
|
54 |
Control="Finish" |
|
55 |
Event="DoAction" |
|
56 |
Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed |
|
57 |
</Publish> |
|
58 |
</UI> |
|
59 |
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch FinalService" /> |
|
60 |
<Property Id="WixShellExecTarget" Value="[INSTALLFOLDER]KCOM_FinalService.exe" /> |
|
61 |
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" /> |
|
62 |
</Fragment> |
|
63 |
|
|
64 |
<Fragment> |
|
65 |
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> |
|
66 |
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> |
|
67 |
<!-- <Component Id="ProductComponent"> --> |
|
68 |
<!-- TODO: Insert files, registry keys, and other resources here. --> |
|
69 |
<!-- </Component> --> |
|
70 |
</ComponentGroup> |
|
71 |
</Fragment> |
|
72 |
|
|
73 |
<Fragment> |
|
74 |
<DirectoryRef Id="INSTALLFOLDER"> |
|
75 |
<Directory Id="CommonAppDataFolder"> |
|
76 |
<Directory Id="MyAppDataFolder" Name="MARKUS" > |
|
77 |
<Component Id="CreateMyAppDataFolder" Guid="E62CA3BD-D561-4554-A4D7-B48D4A2B9D90" Win64='yes'> |
|
78 |
<CreateFolder /> |
|
79 |
</Component> |
|
80 |
</Directory> |
|
81 |
</Directory> |
|
82 |
</DirectoryRef> |
|
83 |
|
|
84 |
<DirectoryRef Id="TARGETDIR"> |
|
85 |
<Component Id="RegistryEntries" Guid="66BB5464-863E-4E67-8953-2625EBA52C0A"> |
|
86 |
<RegistryKey Root="HKLM" |
|
87 |
Key="Software\DOFTECH\MARKUS\FinalService" |
|
88 |
Action="createAndRemoveOnUninstall"> |
|
89 |
<RegistryValue Type="string" Name="Path" Value="[INSTALLFOLDER]"/> |
|
90 |
</RegistryKey> |
|
91 |
</Component> |
|
92 |
</DirectoryRef> |
|
93 |
</Fragment> |
|
94 |
|
|
95 |
<Fragment> |
|
96 |
<ComponentGroup Id="FinalService"> |
|
97 |
<ComponentRef Id="CreateMyAppDataFolder" /> |
|
98 |
<ComponentRef Id="RegistryEntries" /> |
|
99 |
|
|
100 |
<Component Id="cmpEFC8E4FEAD65C6F8432B4EB578EBEA5F" Directory="INSTALLFOLDER" Guid="1230238F-1516-4116-92F9-7A8943FF08D7" Win64='yes'> |
|
101 |
<File Id="filD04D74C9E941CA5FA1661C44EBD7C811" KeyPath="yes" Source=".\Setup\FinalService\IFinalPDF.dll" /> |
|
102 |
</Component> |
|
103 |
<Component Id="cmp1DE0B23F7942D4E47B62522F774F3C76" Directory="INSTALLFOLDER" Guid="B836FAB1-44B5-4282-A119-1A59FA5655AA" Win64='yes'> |
|
104 |
<File Id="filF35DB5A41DFF81B0642F8FCBC3DFB906" KeyPath="yes" Source=".\Setup\FinalService\itextsharp.dll" /> |
|
105 |
</Component> |
|
106 |
<Component Id="cmp93004A2A70CA6CC5550444DB6A0BB24B" Directory="INSTALLFOLDER" Guid="6FF9EACB-DBFE-425B-9C7B-F58F1EA7D7DA" Win64='yes'> |
|
107 |
<File Id="fil718E22AC4914F03FC39F7293CDC8C672" KeyPath="yes" Source=".\Setup\FinalService\itextsharp.xml" /> |
|
108 |
</Component> |
|
109 |
<Component Id="cmp40B0E7C91C025AAEEF1F0DEC51A66549" Directory="INSTALLFOLDER" Guid="8D734532-A754-49A0-BCEC-B514661FAFB5" Win64='yes'> |
|
110 |
<File Id="filF60CE67197837613CD57BE23CB07368E" KeyPath="yes" Source=".\Setup\FinalService\KCOMDataModel.dll" /> |
|
111 |
</Component> |
|
112 |
<Component Id="cmpEE8E531D52E746388211D454A7B652CD" Directory="INSTALLFOLDER" Guid="92F3D524-0681-4F59-9AFE-8875CE5F2FCC" Win64='yes'> |
|
113 |
<File Id="filF33A63AB801D7E78849A4330E53EBD7B" KeyPath="yes" Source=".\Setup\FinalService\KCOMDataModel.dll.config" /> |
|
114 |
</Component> |
|
115 |
<Component Id="cmp599C0D2E83328F2696719B080E32F4DF" Directory="INSTALLFOLDER" Guid="84BB02E7-D578-47DC-A549-4B09FEDA4309" Win64='yes'> |
|
116 |
<File Id="fil5A455357091A4ADF7BA95765CC16064C" KeyPath="yes" Source=".\Setup\FinalService\KCOM_FinalService.exe" /> |
|
117 |
<ServiceInstall Id="ServiceInstaller" |
|
118 |
Type="ownProcess" |
|
119 |
Name="FinalService" |
|
120 |
DisplayName="MARKUS FinalService" |
|
121 |
Description="convert user comments to pdf file" |
|
122 |
Start="auto" |
|
123 |
ErrorControl="normal" /> |
|
124 |
<!-- Tell WiX to start the Service --> |
|
125 |
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="FinalService" Wait="yes" /> |
|
126 |
</Component> |
|
127 |
<Component Id="cmp2662FB243DAE8DF43E45C18BBC6963D6" Directory="INSTALLFOLDER" Guid="BEE89177-9874-4FE9-9E4D-8A8B5E04DA13" Win64='yes'> |
|
128 |
<File Id="fil310CC5D3573552ED8BE7E9CC58ACB9A1" KeyPath="yes" Source=".\Setup\FinalService\KCOM_FinalService.exe.config" /> |
|
129 |
</Component> |
|
130 |
<Component Id="cmpFE0047A5420B60BC9070B49ED04A3DF7" Directory="INSTALLFOLDER" Guid="4A9C0F5D-36EE-4922-B67F-2768588297D1" Win64='yes'> |
|
131 |
<File Id="filDB2B5EE0EF352042DCB528551CFF336A" KeyPath="yes" Source=".\Setup\FinalService\MarkupToPDF.dll" /> |
|
132 |
</Component> |
|
133 |
<Component Id="cmpBF387E9588F2B8473B629AAB925D2239" Directory="INSTALLFOLDER" Guid="D32E9C4E-0033-4ECC-B3B0-00E71AB6CC18" Win64='yes'> |
|
134 |
<File Id="fil3BBE868726AE8A4E2066B45DD738F0E3" KeyPath="yes" Source=".\Setup\FinalService\MarkupToPDF.dll.config" /> |
|
135 |
</Component> |
|
136 |
<Component Id="cmpFE0047A5420B60BC9070B49ED04A3DF6" Directory="INSTALLFOLDER" Guid="680810dd-f815-4c72-bffd-a31e18636c4f" Win64='yes'> |
|
137 |
<File Id="filDB2B5EE0EF352042DCB528551CFF336B" KeyPath="yes" Source=".\Setup\FinalService\UploadFinal.dll" /> |
|
138 |
</Component> |
|
139 |
<Component Id="cmpBF387E9588F2B8473B629AAB925D2237" Directory="INSTALLFOLDER" Guid="533eb951-9d38-403b-80d6-dbbca7b9e0fc" Win64='yes'> |
|
140 |
<File Id="fil3BBE868726AE8A4E2066B45DD738F0E2" KeyPath="yes" Source=".\Setup\FinalService\UploadFinal.dll.config" /> |
|
141 |
</Component> |
|
142 |
<Component Id="cmp7F07F6231918203727082BB6A28CC75F" Directory="INSTALLFOLDER" Guid="2F0F7F57-22BE-4A3C-8CF1-874B48A0F055" Win64='yes'> |
|
143 |
<File Id="fil3E19A0F06927704B530947F360809AD8" KeyPath="yes" Source=".\Setup\FinalService\Telerik.Windows.Zip.dll" /> |
|
144 |
</Component> |
|
145 |
<Component Id="cmpFF91FE36548D6FA9C8D0DC80206BE1EF" Directory="INSTALLFOLDER" Guid="28E25268-EB14-44B5-9C70-7A5D620A63F6" Win64='yes'> |
|
146 |
<File Id="fil898D8F5BF92067A65BDD539092A9A061" KeyPath="yes" Source=".\Setup\FinalService\Telerik.Windows.Zip.xml" /> |
|
147 |
</Component> |
|
148 |
<Component Id="commonlib.dll" Directory="INSTALLFOLDER" Guid="a766f7cf-1bc2-4b28-abe5-b35eedc05e01" Win64='yes'> |
|
149 |
<File Id="commonlib.dll" KeyPath="yes" Source=".\Setup\FinalService\CommonLib.dll" /> |
|
150 |
</Component> |
|
151 |
<Component Id="monitorservice" Directory="INSTALLFOLDER" Guid="44c71fdb-afa5-490e-b111-40a23039f665" Win64='yes'> |
|
152 |
<File Id="monitorservice" KeyPath="yes" Source=".\Setup\FinalService\FinalService_Watcher.exe" /> |
|
153 |
<ServiceInstall Id="MonitorServiceInstaller" |
|
154 |
Type="ownProcess" |
|
155 |
Name="FinalService_Watcher" |
|
156 |
DisplayName="MARKUS FinalService Watcher" |
|
157 |
Description="convert user comments to pdf file monitoring" |
|
158 |
Start="auto" |
|
159 |
ErrorControl="normal" /> |
|
160 |
<!-- Tell WiX to start the Service --> |
|
161 |
<ServiceControl Id="MonitorServiceController" Start="install" Stop="both" Remove="uninstall" Name="FinalService_Watcher" Wait="yes" /> |
|
162 |
</Component> |
|
163 |
<Component Id="cmpA8E411F92BD54821B9A3CEF8E01BBE63" Directory="MyAppDataFolder" Guid="6BF0D3C5-0684-4E7D-BC53-4CE092A48FFE" Win64='yes'> |
|
164 |
<File Id="fil49E6FDC6BDFC49A5AB05A71FB2D3A5AE" KeyPath="yes" Source=".\FinalService\KCOM_FinalService\KCOM_FinalService\FinalService_Daelim.ini" /> |
|
165 |
</Component> |
|
166 |
</ComponentGroup> |
|
167 |
</Fragment> |
|
168 |
</Wix> |
build.bat | ||
---|---|---|
25 | 25 |
IF %ERRORLEVEL% NEQ 0 goto :ERROR |
26 | 26 |
%LIGHT% -out ".\Setup\MARKUS-%1.msi" ".\Setup\MARKUS.wixobj" -ext WixUIExtension -ext WixUtilExtension |
27 | 27 |
%LIGHT% -out ".\Setup\FinalService\FinalService-%1.msi" ".\Setup\FinalService\FinalService.wixobj" -ext WixUIExtension -ext WixUtilExtension |
28 |
%LIGHT% -out ".\Setup\FinalService\FinalService-Daelim-%1.msi" ".\Setup\FinalService\FinalService.wixobj" -ext WixUIExtension -ext WixUtilExtension |
|
28 | 29 |
IF %ERRORLEVEL% NEQ 0 goto :ERROR |
29 | 30 |
|
30 | 31 |
%SIGNTOOLPATH% sign /v /f %SIGNPATH% /p Doftech1073# /tr http://timestamp.digicert.com /td sha256 /fd sha256 "c:\Temp\workspace\MARKUS\Setup\*.msi" |
내보내기 Unified diff