프로젝트

일반

사용자정보

개정판 950e6b84

ID950e6b8458c985d7b12a09457b481c3196cfb675
상위 5ba8f2d5
하위 d91efe5c

김태성이(가) 2년 이상 전에 추가함

issue #00000 convert service
- markus library 수정 후 적용
- pdf download를 plugin으로 변경
- convert 안정화

Change-Id: Ibafcf7fb59445659f8361922f80d47e3e6610a65

차이점 보기:

AppDemo/App.config
1
<?xml version="1.0" encoding="utf-8" ?>
2
<configuration>
3
    <startup> 
4
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
5
    </startup>
6
</configuration>
AppDemo/AppDemo.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>{59119151-FD5A-4705-A0CD-BE95A7F05913}</ProjectGuid>
8
    <OutputType>Exe</OutputType>
9
    <RootNamespace>KcomDemo</RootNamespace>
10
    <AssemblyName>KcomDemo</AssemblyName>
11
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12
    <FileAlignment>512</FileAlignment>
13
    <Deterministic>true</Deterministic>
14
    <PublishUrl>publish\</PublishUrl>
15
    <Install>true</Install>
16
    <InstallFrom>Disk</InstallFrom>
17
    <UpdateEnabled>false</UpdateEnabled>
18
    <UpdateMode>Foreground</UpdateMode>
19
    <UpdateInterval>7</UpdateInterval>
20
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
21
    <UpdatePeriodically>false</UpdatePeriodically>
22
    <UpdateRequired>false</UpdateRequired>
23
    <MapFileExtensions>true</MapFileExtensions>
24
    <ApplicationRevision>0</ApplicationRevision>
25
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
26
    <IsWebBootstrapper>false</IsWebBootstrapper>
27
    <UseApplicationTrust>false</UseApplicationTrust>
28
    <BootstrapperEnabled>true</BootstrapperEnabled>
29
  </PropertyGroup>
30
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
31
    <PlatformTarget>AnyCPU</PlatformTarget>
32
    <DebugSymbols>true</DebugSymbols>
33
    <DebugType>full</DebugType>
34
    <Optimize>false</Optimize>
35
    <OutputPath>bin\Debug\</OutputPath>
36
    <DefineConstants>DEBUG;TRACE</DefineConstants>
37
    <ErrorReport>prompt</ErrorReport>
38
    <WarningLevel>4</WarningLevel>
39
  </PropertyGroup>
40
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
41
    <PlatformTarget>AnyCPU</PlatformTarget>
42
    <DebugType>pdbonly</DebugType>
43
    <Optimize>true</Optimize>
44
    <OutputPath>bin\Release\</OutputPath>
45
    <DefineConstants>TRACE</DefineConstants>
46
    <ErrorReport>prompt</ErrorReport>
47
    <WarningLevel>4</WarningLevel>
48
  </PropertyGroup>
49
  <ItemGroup>
50
    <Reference Include="System" />
51
    <Reference Include="System.Core" />
52
    <Reference Include="System.ServiceModel.Web" />
53
    <Reference Include="System.Windows.Forms" />
54
    <Reference Include="System.Xml.Linq" />
55
    <Reference Include="System.Data.DataSetExtensions" />
56
    <Reference Include="Microsoft.CSharp" />
57
    <Reference Include="System.Data" />
58
    <Reference Include="System.Net.Http" />
59
    <Reference Include="System.Xml" />
60
  </ItemGroup>
61
  <ItemGroup>
62
    <Compile Include="Program.cs" />
63
    <Compile Include="Properties\AssemblyInfo.cs" />
64
    <Compile Include="VistaSecurity.cs" />
65
  </ItemGroup>
66
  <ItemGroup>
67
    <None Include="App.config" />
68
  </ItemGroup>
69
  <ItemGroup>
70
    <Folder Include="WebService\" />
71
  </ItemGroup>
72
  <ItemGroup>
73
    <Content Include="Markus.mdf">
74
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
75
    </Content>
76
    <Content Include="Markus_log.ldf">
77
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
78
      <DependentUpon>Markus.mdf</DependentUpon>
79
    </Content>
80
  </ItemGroup>
81
  <ItemGroup>
82
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
83
      <Visible>False</Visible>
84
      <ProductName>.NET Framework 3.5 SP1</ProductName>
85
      <Install>false</Install>
86
    </BootstrapperPackage>
87
  </ItemGroup>
88
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
89
</Project>
AppDemo/Program.cs
1
using KCOM;
2
using System;
3
using System.Collections.Generic;
4
using System.Linq;
5
using System.Text;
6
using System.Threading.Tasks;
7

  
8
namespace KcomDemo
9
{
10
    class Program
11
    {
12
        static void Main(string[] args)
13
        {
14
            if (VistaSecurity.IsAdmin())
15
            {
16
                service = new Service1();
17

  
18
                Uri baseAddress = new Uri("http://localhost:5000");
19
                host = host.WcfCreate(service, typeof(OwinTest.IService1), new Uri("http://localhost:5000/Service1.svc"));
20

  
21

  
22

  
23
                Console.WriteLine("The service is ready at {0}", baseAddress);
24
                Console.WriteLine("Press <Enter> to stop the service.");
25
                Console.ReadLine();
26

  
27
            }
28
            else
29
            {
30
                VistaSecurity.RestartElevated();
31
            }
32
        }
33
    }
34
}
AppDemo/Properties/AssemblyInfo.cs
1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4

  
5
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
6
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
7
// 이러한 특성 값을 변경하세요.
8
[assembly: AssemblyTitle("KcomDemo")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("KcomDemo")]
13
[assembly: AssemblyCopyright("Copyright ©  2021")]
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("59119151-fd5a-4705-a0cd-be95a7f05913")]
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")]
AppDemo/VistaSecurity.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using System.Runtime.InteropServices;
5
using System.Diagnostics;
6
using System.Security.Principal;
7
using System.Windows.Forms;
8

  
9
namespace KCOM
10
{
11
    public static class VistaSecurity
12
    {
13
        [DllImport("user32")]
14
        public static extern UInt32 SendMessage(IntPtr hWnd, UInt32 msg, UInt32 wParam, UInt32 lParam);
15

  
16
        internal const int BCM_FIRST = 0x1600;
17
        internal const int BCM_SETSHIELD = (BCM_FIRST + 0x000C);
18

  
19
        static internal bool IsVistaOrHigher()
20
        {
21
            return Environment.OSVersion.Version.Major < 6;
22
        }
23

  
24
        /// <summary>
25
        /// Checks if the process is elevated
26
        /// </summary>
27
        /// <returns>If is elevated</returns>
28
        static internal bool IsAdmin()
29
        {
30
            WindowsIdentity id = WindowsIdentity.GetCurrent();
31
            WindowsPrincipal p = new WindowsPrincipal(id);
32
            return p.IsInRole(WindowsBuiltInRole.Administrator);
33
        }
34

  
35

  
36
        /// <summary>
37
        /// Restart the current process with administrator credentials
38
        /// </summary>
39
        internal static void RestartElevated()
40
        {
41
            ProcessStartInfo startInfo = new ProcessStartInfo();
42
            startInfo.UseShellExecute = true;
43
            startInfo.WorkingDirectory = Environment.CurrentDirectory;
44
            startInfo.FileName = Application.ExecutablePath;
45
            startInfo.Verb = "runas";
46
            try
47
            {
48
                Process p = Process.Start(startInfo);
49
            }
50
            catch(System.ComponentModel.Win32Exception ex)
51
            {
52
                return; //If cancelled, do nothing
53
            }
54

  
55
            Application.Exit();
56
        }
57
    }
58
}
ConvertService/ServiceBase/ConnectionStringBuild/App.xaml
1
<Application x:Class="ConnectionStringBuild.App"
2
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4
             xmlns:local="clr-namespace:ConnectionStringBuild"
5
             StartupUri="MainWindow.xaml">
6
    <Application.Resources>
7
         
8
    </Application.Resources>
1
<Application
2
    x:Class="ConnectionStringBuild.App"
3
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5
    xmlns:local="clr-namespace:ConnectionStringBuild"
6
    StartupUri="MainWindow.xaml">
7
    <Application.Resources />
9 8
</Application>
ConvertService/ServiceBase/ConnectionStringBuild/ConnectionStringBuild.csproj
45 45
    <Reference Include="Markus.EntityModel, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
46 46
      <HintPath>..\packages\MarkusDatabase.1.8.0\lib\net45\Markus.EntityModel.dll</HintPath>
47 47
    </Reference>
48
    <Reference Include="Markus.Message, Version=1.5.3.0, Culture=neutral, PublicKeyToken=null" />
48
    <Reference Include="Markus.Message, Version=1.5.5.0, Culture=neutral, processorArchitecture=MSIL">
49
      <HintPath>..\packages\Markus.Message.1.5.5\lib\net45\Markus.Message.dll</HintPath>
50
    </Reference>
49 51
    <Reference Include="System" />
50 52
    <Reference Include="System.ComponentModel.DataAnnotations" />
51 53
    <Reference Include="System.Data" />
ConvertService/ServiceBase/ConnectionStringBuild/packages.config
2 2
<packages>
3 3
  <package id="EntityFramework" version="6.2.0" targetFramework="net45" />
4 4
  <package id="EntityFramework.ko" version="6.2.0" targetFramework="net45" />
5
  <package id="Markus.Message" version="1.5.4" targetFramework="net45" />
5
  <package id="Markus.Message" version="1.5.5" targetFramework="net45" />
6 6
  <package id="MarkusDatabase" version="1.8.0" targetFramework="net45" developmentDependency="true" />
7 7
  <package id="Microsoft.CSharp" version="4.5.0" targetFramework="net45" />
8 8
</packages>
ConvertService/ServiceBase/ConvertResultBSENG/ConvertResultBSENG.csproj
18 18
    <DebugSymbols>true</DebugSymbols>
19 19
    <DebugType>full</DebugType>
20 20
    <Optimize>false</Optimize>
21
    <OutputPath>..\publish\Plugin\</OutputPath>
21
    <OutputPath>..\publish\Plugin\ConvertResultBSENG\</OutputPath>
22 22
    <DefineConstants>DEBUG;TRACE</DefineConstants>
23 23
    <ErrorReport>prompt</ErrorReport>
24 24
    <WarningLevel>4</WarningLevel>
......
26 26
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27 27
    <DebugType>pdbonly</DebugType>
28 28
    <Optimize>true</Optimize>
29
    <OutputPath>bin\Release\</OutputPath>
29
    <OutputPath>..\publish\Plugin\ConvertResultBSENG\</OutputPath>
30 30
    <DefineConstants>TRACE</DefineConstants>
31 31
    <ErrorReport>prompt</ErrorReport>
32 32
    <WarningLevel>4</WarningLevel>
ConvertService/ServiceBase/DocItemCheck/DocItemCheck.csproj
17 17
    <DebugSymbols>true</DebugSymbols>
18 18
    <DebugType>full</DebugType>
19 19
    <Optimize>false</Optimize>
20
    <OutputPath>..\publish\Plugin\</OutputPath>
20
    <OutputPath>..\publish\Plugin\DocItemCheck\</OutputPath>
21 21
    <DefineConstants>DEBUG;TRACE</DefineConstants>
22 22
    <ErrorReport>prompt</ErrorReport>
23 23
    <WarningLevel>4</WarningLevel>
......
25 25
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26 26
    <DebugType>pdbonly</DebugType>
27 27
    <Optimize>true</Optimize>
28
    <OutputPath>bin\Release\</OutputPath>
28
    <OutputPath>..\publish\Plugin\DocItemCheck\</OutputPath>
29 29
    <DefineConstants>TRACE</DefineConstants>
30 30
    <ErrorReport>prompt</ErrorReport>
31 31
    <WarningLevel>4</WarningLevel>
ConvertService/ServiceBase/DownloadPlugin/DirectDownload/DirectDownload.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>{23271B3D-FE31-4039-B9CD-9F00C43117D8}</ProjectGuid>
8
    <OutputType>Library</OutputType>
9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10
    <RootNamespace>DirectDownload</RootNamespace>
11
    <AssemblyName>DirectDownload</AssemblyName>
12
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13
    <FileAlignment>512</FileAlignment>
14
    <Deterministic>true</Deterministic>
15
  </PropertyGroup>
16
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
    <DebugSymbols>true</DebugSymbols>
18
    <DebugType>full</DebugType>
19
    <Optimize>false</Optimize>
20
    <OutputPath>..\..\publish\DownloadPlugin\DirectDownload\</OutputPath>
21
    <DefineConstants>DEBUG;TRACE</DefineConstants>
22
    <ErrorReport>prompt</ErrorReport>
23
    <WarningLevel>4</WarningLevel>
24
  </PropertyGroup>
25
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26
    <DebugType>pdbonly</DebugType>
27
    <Optimize>true</Optimize>
28
    <OutputPath>..\publish\DownloadPlugin\DirectDownload\</OutputPath>
29
    <DefineConstants>TRACE</DefineConstants>
30
    <ErrorReport>prompt</ErrorReport>
31
    <WarningLevel>4</WarningLevel>
32
  </PropertyGroup>
33
  <ItemGroup>
34
    <Reference Include="System" />
35
    <Reference Include="System.Core" />
36
    <Reference Include="System.Web" />
37
    <Reference Include="System.Xml.Linq" />
38
    <Reference Include="System.Data.DataSetExtensions" />
39
    <Reference Include="Microsoft.CSharp" />
40
    <Reference Include="System.Data" />
41
    <Reference Include="System.Net.Http" />
42
    <Reference Include="System.Xml" />
43
  </ItemGroup>
44
  <ItemGroup>
45
    <Compile Include="Downloader.cs" />
46
    <Compile Include="Properties\AssemblyInfo.cs" />
47
  </ItemGroup>
48
  <ItemGroup>
49
    <ProjectReference Include="..\..\Markus.Service.Convert.IPlugin\Markus.Service.Convert.IPlugin.csproj">
50
      <Project>{a5ba7325-379c-4ccb-b156-1704fc2175e3}</Project>
51
      <Name>Markus.Service.Convert.IPlugin</Name>
52
    </ProjectReference>
53
    <ProjectReference Include="..\..\Markus.Service.Extensions\Markus.Service.Extensions.csproj">
54
      <Project>{5f983789-3e8f-4f9a-a601-138c3a83ca5f}</Project>
55
      <Name>Markus.Service.Extensions</Name>
56
    </ProjectReference>
57
  </ItemGroup>
58
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
59
</Project>
ConvertService/ServiceBase/DownloadPlugin/DirectDownload/Downloader.cs
1
using Markus.Service.Helper;
2
using System;
3
using System.Collections.Generic;
4
using System.Linq;
5
using System.Text;
6
using System.Threading.Tasks;
7
using System.Web;
8

  
9
namespace DirectDownload
10
{
11
    public class DirectDownload : Markus.Service.Convert.Plugin.IDownloadPlugin
12
    {
13
        public string Exception { get; set; }
14
        public string Name => nameof(DirectDownload);
15

  
16
        /// <summary>
17
        /// PdfFileFullPath의 경로를 받아 SaveDirectory하위에 PdfFileFullPath파일명으로 저장
18
        /// </summary>
19
        /// <param name="PdfFilePath">PDF의 full path</param>
20
        /// <param name="SavePath">pdf를 다운받고자 하는 directory</param>
21
        public bool Do(string PdfFileFullPath, string SaveDirectory, ref string DownloadFilePath)
22
        {
23
            bool result = false;
24
            try
25
            {
26
                var originFilePath = HttpUtility.UrlDecode(PdfFileFullPath); //PDF 전체 경로
27

  
28
                string FileName = DownloadUri.GetFileName(originFilePath);
29
                string downloadFilePath = System.IO.Path.Combine(SaveDirectory, FileName);
30

  
31
                using (System.Net.WebClient webClient = new System.Net.WebClient())
32
                {
33
                    webClient.UseDefaultCredentials = true;
34
                    webClient.Headers.Add("Authorization: BASIC SGVsbG8="); //가상의 인증
35
                    webClient.Proxy = null;
36

  
37
                    if (!System.IO.Directory.Exists(SaveDirectory))
38
                    {
39
                        System.IO.Directory.CreateDirectory(SaveDirectory);
40
                    }
41

  
42
                    webClient.DownloadFile(originFilePath, downloadFilePath);
43

  
44
                    webClient.Dispose();
45

  
46
                    DownloadFilePath = downloadFilePath;
47
                }
48
            }
49
            catch (Exception ex)
50
            {
51
                this.Exception = ex.ToString();
52
            }
53

  
54
            return result;
55
        }
56
    }
57
}
ConvertService/ServiceBase/DownloadPlugin/DirectDownload/Properties/AssemblyInfo.cs
1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4

  
5
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
6
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
7
// 이러한 특성 값을 변경하세요.
8
[assembly: AssemblyTitle("DirectDownload")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("DirectDownload")]
13
[assembly: AssemblyCopyright("Copyright ©  2022")]
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("23271b3d-fe31-4039-b9cd-9f00c43117d8")]
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")]
ConvertService/ServiceBase/EmailClient/EmailClient.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Net.Mail;
6

  
7
namespace EmailClient
8
{
9
    public class EmailClient : IDisposable
10
    {
11
        public event EventHandler<SendEmailResult> EmailSendCompleted;
12
        private const string _CompanyAddress = "daelim.co.kr";
13
        private const string SmtpClientAddress = "any.daelim.co.kr";
14
        private Guid _token;
15
        private SendEmailResult _result;
16
        private bool _Async = false;
17
        MailMessage mail = new MailMessage();
18

  
19
        /// <summary>
20
        /// mail client 초기화
21
        /// </summary>
22
        /// <param name="fromAddress"></param>
23
        public EmailClient(string UserID)
24
        {
25
            mail.From = new MailAddress(UserID + "@" + _CompanyAddress);
26
        }
27

  
28
        /// <summary>
29
        /// mail client 초기화
30
        /// </summary>
31
        /// <param name="fromAddress"></param>
32
        public EmailClient(MailAddress fromAddress)
33
        {
34
            mail.From = fromAddress;
35
        }
36

  
37
        /// <summary>
38
        /// 비동기 email send
39
        /// </summary>
40
        /// <param name="toAddress"></param>
41
        /// <param name="ccAddress"></param>
42
        /// <param name="subject"></param>
43
        /// <param name="message"></param>
44
        public void SendEmailAsync(string toAddress, string ccAddress, string subject, string message,bool IsHtmlMsg)
45
        {
46
            _Async = true;
47
            mail.To.Clear();
48
            mail.CC.Clear();
49
            SendEmail(new List<string> { toAddress }, new List<string> { ccAddress }, subject, message, IsHtmlMsg);
50
        }
51

  
52
        /// <summary>
53
        /// 비동기 email send
54
        /// </summary>
55
        /// <param name="toAddress"></param>
56
        /// <param name="ccAddress"></param>
57
        /// <param name="subject"></param>
58
        /// <param name="message"></param>
59
        public void SendEmailAsync(List<string> toAddress, List<string> ccAddress, string subject, string message, bool isHtmlMsg)
60
        {
61
            _Async = true;
62
            Send(toAddress, ccAddress, subject, message, isHtmlMsg);
63
        }
64

  
65
        /// <summary>
66
        /// 동기 email send
67
        /// </summary>
68
        /// <param name="toAddress"></param>
69
        /// <param name="ccAddress"></param>
70
        /// <param name="subject"></param>
71
        /// <param name="message"></param>
72
        /// <returns></returns>
73
        public SendEmailResult SendEmail(string toAddress, string ccAddress, string subject, string message,bool isHtmlMsg)
74
        {
75
            List<string> _toAddr = new List<string>();
76
            List<string> _ccAddr = new List<string>();
77
            mail.To.Clear();
78
            mail.CC.Clear();
79
            if (!string.IsNullOrEmpty(toAddress)) _toAddr.Add(toAddress);
80
            if (!string.IsNullOrEmpty(ccAddress)) _ccAddr.Add(ccAddress);
81

  
82
            Send(_toAddr, _ccAddr, subject, message, isHtmlMsg);
83
            return _result;
84
        }
85

  
86
        public SendEmailResult SendEmail(List<string> toAddress, List<string> ccAddress, string subject, string message, bool isHtmlMsg)
87
        {
88
            Send(toAddress, ccAddress, subject, message, isHtmlMsg);
89
            return _result;
90
        }
91

  
92
        private void Send(string toAddress, string ccAddress, string subject, string message, bool isHtmlMsg)
93
        {
94
            List<string> _toAddr = new List<string>();
95
            List<string> _ccAddr = new List<string>();
96
            
97
            if (!string.IsNullOrWhiteSpace(toAddress)) _toAddr.Add(toAddress);
98
            if (!string.IsNullOrWhiteSpace(ccAddress)) _ccAddr.Add(ccAddress);
99

  
100
            Send(_toAddr,_ccAddr, subject, message,isHtmlMsg);
101
        }
102

  
103
        private void Send(List<string> toAddress, List<string> ccAddress, string subject, string message, bool isHtmlMsg)
104
        {
105
            try
106
            {
107
                /// foreach가 더 빠르다.
108

  
109
                //대림 메일 보류(강인구)
110
                //(from add in toAddress.Distinct()
111
                // let addr = (add.ToLower().IndexOf("@") < 0) ? add + "@" + _CompanyAddress: add
112
                // select addr)
113
                //.ToList().ForEach(ad => mail.To.Add(new MailAddress(ad)));
114

  
115
                //(from add in ccAddress.Distinct()
116
                // let addr = (add.ToLower().IndexOf("@") < 0) ? add + "@" + _CompanyAddress : add
117
                // select addr)
118
                //    .ToList().ForEach(ad => mail.CC.Add(new MailAddress(ad)));
119

  
120
                mail.To.Add(new MailAddress("kig881111@naver.com"));
121

  
122
                //Subject 
123
                //mail.Subject = subject;
124
                mail.Subject = subject.Replace('\r', ' ').Replace('\n', ' ');
125
                mail.SubjectEncoding = System.Text.Encoding.UTF8;
126

  
127
                //Message           
128
                mail.Body = message;
129
                mail.BodyEncoding = System.Text.Encoding.UTF8;
130
                mail.IsBodyHtml = isHtmlMsg;
131

  
132
                //SmtpClient client = new SmtpClient(SmtpClientAddress);
133

  
134
                MailAddress sendAddress = new MailAddress("kig881111@gmail.com");
135

  
136

  
137
                SmtpClient client = null;
138
                //client = new SmtpClient
139
                //{
140
                //    Host = "smtp.gmail.com",
141
                //    EnableSsl = true,
142
                //    DeliveryMethod = SmtpDeliveryMethod.Network,
143
                //    Credentials = new System.Net.NetworkCredential("kig881111@gmail.com", "amlswud123!"),
144
                //    Timeout = 20000
145
                //};
146

  
147
                //mail = new MailMessage(sendAddress, sendAddress)
148
                //{
149
                //    Subject = "제목 없슴다",
150
                //    Body = "내용 없슴다"
151
                //};
152

  
153
                client = new SmtpClient
154
                {
155
                    Host = "smtp.gmail.com",
156
                    EnableSsl = true,
157
                    DeliveryMethod = SmtpDeliveryMethod.Network,
158
                    Credentials = new System.Net.NetworkCredential(sendAddress.Address, "amlswud123!"),
159
                    Timeout = 20000
160
                };
161

  
162
                //mail = new MailMessage(sendAddress, sendAddress)
163
                //{
164
                //    Subject = "Markup 메일 발송 테스트",
165
                //    Body = "메일 발송 테스트"
166
                //};
167

  
168
                client.Send(mail);
169

  
170

  
171
                //if (_Async)
172
                //{
173
                //    client.SendCompleted += new SendCompletedEventHandler(Smtpclient_SendCompleted);
174
                //    _token = Guid.NewGuid();
175
                //    client.SendAsync(mail, mail.Headers);
176
                //}
177
                //else
178
                //{
179
                //    client.Send(mail);
180
                //    _result = new SendEmailResult(true, null);
181
                //    GC.Collect(2);
182
                //    GC.Collect(2);
183
                //}
184
            }
185
            catch (Exception e)
186
            {
187
                _result = new SendEmailResult(false, e);
188
            }
189
        }
190

  
191
        void Smtpclient_SendCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
192
        {
193
            //if (_token == (Guid)e.UserState)
194
            //{
195
                EmailSendCompleted(this,new SendEmailResult(true, null));
196
                GC.Collect(2);
197
                GC.Collect(2);
198
            //}
199
        }
200

  
201
        public void Dispose()
202
        {
203
            mail.Dispose();
204
            GC.Collect(2);
205
            GC.Collect(2);
206
        }
207
    }
208
}
ConvertService/ServiceBase/EmailClient/EmailClient.csproj
1
<?xml version="1.0" encoding="utf-8"?>
2
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
  <PropertyGroup>
4
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6
    <ProductVersion>8.0.30703</ProductVersion>
7
    <SchemaVersion>2.0</SchemaVersion>
8
    <ProjectGuid>{50EBCC06-AB49-4C8F-A4C4-1A7520AC2F2D}</ProjectGuid>
9
    <OutputType>Library</OutputType>
10
    <AppDesignerFolder>Properties</AppDesignerFolder>
11
    <RootNamespace>EmailClient</RootNamespace>
12
    <AssemblyName>EmailClient</AssemblyName>
13
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14
    <FileAlignment>512</FileAlignment>
15
  </PropertyGroup>
16
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
    <DebugSymbols>true</DebugSymbols>
18
    <DebugType>full</DebugType>
19
    <Optimize>false</Optimize>
20
    <OutputPath>bin\Debug\</OutputPath>
21
    <DefineConstants>DEBUG;TRACE</DefineConstants>
22
    <ErrorReport>prompt</ErrorReport>
23
    <WarningLevel>4</WarningLevel>
24
  </PropertyGroup>
25
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26
    <DebugType>pdbonly</DebugType>
27
    <Optimize>true</Optimize>
28
    <OutputPath>bin\Release\</OutputPath>
29
    <DefineConstants>TRACE</DefineConstants>
30
    <ErrorReport>prompt</ErrorReport>
31
    <WarningLevel>4</WarningLevel>
32
  </PropertyGroup>
33
  <ItemGroup>
34
    <Reference Include="System" />
35
    <Reference Include="System.Core" />
36
    <Reference Include="System.Xml.Linq" />
37
    <Reference Include="System.Data.DataSetExtensions" />
38
    <Reference Include="Microsoft.CSharp" />
39
    <Reference Include="System.Data" />
40
    <Reference Include="System.Xml" />
41
  </ItemGroup>
42
  <ItemGroup>
43
    <Compile Include="EmailClient.cs" />
44
    <Compile Include="Properties\AssemblyInfo.cs" />
45
    <Compile Include="SendEmailResult.cs" />
46
  </ItemGroup>
47
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
48
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
49
       Other similar extension points exist, see Microsoft.Common.targets.
50
  <Target Name="BeforeBuild">
51
  </Target>
52
  <Target Name="AfterBuild">
53
  </Target>
54
  -->
55
</Project>
ConvertService/ServiceBase/EmailClient/Properties/AssemblyInfo.cs
1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4

  
5
// General Information about an assembly is controlled through the following 
6
// set of attributes. Change these attribute values to modify the information
7
// associated with an assembly.
8
[assembly: AssemblyTitle("EmailClient")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("EmailClient")]
13
[assembly: AssemblyCopyright("Copyright ©  2012")]
14
[assembly: AssemblyTrademark("")]
15
[assembly: AssemblyCulture("")]
16

  
17
// Setting ComVisible to false makes the types in this assembly not visible 
18
// to COM components.  If you need to access a type in this assembly from 
19
// COM, set the ComVisible attribute to true on that type.
20
[assembly: ComVisible(false)]
21

  
22
// The following GUID is for the ID of the typelib if this project is exposed to COM
23
[assembly: Guid("2ba23a01-1e53-4968-83f0-abd9174f94d8")]
24

  
25
// Version information for an assembly consists of the following four values:
26
//
27
//      Major Version
28
//      Minor Version 
29
//      Build Number
30
//      Revision
31
//
32
// You can specify all the values or you can default the Build and Revision Numbers 
33
// by using the '*' as shown below:
34
// [assembly: AssemblyVersion("1.0.*")]
35
[assembly: AssemblyVersion("1.0.0.0")]
36
[assembly: AssemblyFileVersion("1.0.0.0")]
ConvertService/ServiceBase/EmailClient/SendEmailResult.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5

  
6
namespace EmailClient
7
{
8
    public class SendEmailResult : EventArgs
9
    {
10
        public SendEmailResult(bool Seccess,Exception Exception)
11
        {
12
            this.Seccess = Seccess;
13

  
14
            if(Exception!=null)
15
                this._Exception = Exception;
16
        }
17

  
18
        private bool _Seccess;
19

  
20
        public bool Seccess
21
        {
22
            get { return _Seccess; }
23
            private set { _Seccess = value; }
24
        }
25
        private Exception _Exception;
26

  
27
        public Exception Exception
28
        {
29
            get { return _Exception; }
30
            private set { _Exception = value; }
31
        }
32
    }
33
}
ConvertService/ServiceBase/ErrorNotice/ErrorNotice.cs
7 7
using System.Data.Entity.Core.Objects;
8 8
using System.Data.Entity.Infrastructure;
9 9
using System.Linq;
10
using System.Net.Mail;
10 11
using System.Text;
11 12
using System.Threading.Tasks;
13
using static Markus.Service.Extensions.Encrypt;
12 14

  
13 15
namespace ErrorNotice
14 16
{
......
21 23

  
22 24
        private const string MARKUS_ConnectionString_KEY = "MARKUS_ConnectionString";
23 25
        private const string MARKUS_NoticeStatus_KEY = "NoticeStatus";
26
        private const string MARKUS_SMTP_SERVER_KEY = "SMTP_SERVER";
27
        private const string MARKUS_SMTP_SERVER_PORT_KEY = "SMTP_SERVER_PORT";
28
        private const string MARKUS_IS_SMTP_SERVER_SSL_KEY = "IS_SMTP_SERVER_SSL";
29
        private const string MARKUS_SMTP_ID_KEY = "SMTP_ID";
30
        private const string MARKUS_SMTP_PASSWORD_KEY = "SMTP_PASSWORD";
31
        private const string MARKUS_SEND_ADDRESS_KEY = "SEND_ADDRESS";
32
        private const string MARKUS_RECEIVE_ADDRESS_LIST_KEY = "RECEIVE_ADDRESS_LIST";
33
        private const string MARKUS_MAIL_TEMPLATE_KEY = "MAIL_TEMPLATE";
24 34

  
25 35
        bool IPlugin.Do(string ConvertID, Dictionary<string, object> Parameters)
26 36
        {
......
31 41

  
32 42
            try
33 43
            {
34
                if (Parameters.Keys.Count(x => x == MARKUS_ConnectionString_KEY) > 0)
44
                if (Parameters.TryGetValue(MARKUS_ConnectionString_KEY, out object connection) &&
45
                    Parameters.TryGetValue(MARKUS_NoticeStatus_KEY, out object statusStr))
35 46
                {
36
                    string connectionString = Parameters[MARKUS_ConnectionString_KEY].ToString();
37
                    var noticeStatusArray = Parameters[MARKUS_ConnectionString_KEY].ToString();
47
                    string connectionString = connection.ToString();
48
                    var noticeStatusArray = statusStr.ToString();
38 49

  
39
                    /// 5를 기본으로 하고 config에 status가 있으면 기본값을 삭제 후 적용
40
                    List<int> status = new List<int> {5};
50
                    List<int> status = new List<int>();
41 51

  
42
                    if(!string.IsNullOrWhiteSpace(noticeStatusArray))
52
                    if (!string.IsNullOrWhiteSpace(noticeStatusArray))
43 53
                    {
44 54
                        status = new List<int>();
45
                        status.AddRange(noticeStatusArray.Split(';').ToList().ConvertAll(x=>int.Parse(x)));
55
                        status.AddRange(noticeStatusArray.Split(',').ToList().ConvertAll(x => int.Parse(x)));
46 56
                    }
47 57

  
48 58
                    using (var entities = new Markus.EntityModel.MarkusModel(Markus.Service.Extensions.Encrypt.AESEncrypter.Decrypt(connectionString)))
......
53 63
                        {
54 64
                            var convertItem = items.First();
55 65

  
56
                            if(status.Contains(convertItem.STATUS))
66
                            if (status.Contains(convertItem.STATUS))
57 67
                            {
58
                                SendNotice(convertItem);
68
                                try
69
                                {
70
                                    SendNotice(convertItem, Parameters);
71
                                }
72
                                catch (Exception ex)
73
                                {
74
                                    this.Exception = "SendNotice Error : " + ex.ToString(); 
75
                                }
59 76
                            }
60 77
                        }
61 78
                        else
......
80 97
            return result;
81 98
        }
82 99

  
83
        private void SendNotice(CONVERTER_DOC convertItem)
100
        private void SendNotice(CONVERTER_DOC convertItem, Dictionary<string, object> Parameters)
84 101
        {
85
            // convertItem.EXCEPTION
86
            //convertItem.STATUS
87
            //((Markus.Message.StatusCodeType)convertItem.STATUS).ToString() 
102
            if (Parameters.TryGetValue(MARKUS_SMTP_SERVER_KEY, out var address) &&
103
                Parameters.TryGetValue(MARKUS_SMTP_SERVER_PORT_KEY, out var port) &&
104
                Parameters.TryGetValue(MARKUS_IS_SMTP_SERVER_SSL_KEY, out var isSSL) &&
105
                Parameters.TryGetValue(MARKUS_SEND_ADDRESS_KEY, out var sendAddress) &&
106
                Parameters.TryGetValue(MARKUS_SMTP_ID_KEY, out var mailID) &&
107
                Parameters.TryGetValue(MARKUS_SMTP_PASSWORD_KEY, out var password) &&
108
                Parameters.TryGetValue(MARKUS_SEND_ADDRESS_KEY, out var fromAddress) &&
109
                Parameters.TryGetValue(MARKUS_RECEIVE_ADDRESS_LIST_KEY, out var toAddress) &&
110
                Parameters.TryGetValue(MARKUS_MAIL_TEMPLATE_KEY, out var mailbody))
111

  
112
            {
113
                SmtpClient client = new SmtpClient(address.ToString(), Convert.ToInt32(port));
114
                client.UseDefaultCredentials = false;
115
                client.EnableSsl = Convert.ToBoolean(isSSL);
116
                client.DeliveryMethod = SmtpDeliveryMethod.Network;
117
                client.Credentials = new System.Net.NetworkCredential(mailID.ToString(), AESEncrypter.Decrypt(password.ToString()));
118

  
119
                MailAddress from = new MailAddress(fromAddress.ToString());
120
                MailAddress to = new MailAddress(toAddress.ToString());
121
                MailMessage message = new MailMessage(from, to);
122

  
123
                foreach (var item in toAddress.ToString().Split(','))
124
                {
125
                    message.To.Add(new MailAddress(item));
126
                }
127
                message.Subject = "Convert Notice";
128
                message.IsBodyHtml = true;
129
                var body = string.Join("",System.IO.File.ReadAllLines(mailbody.ToString()));
130

  
131
                body = body.Replace("[TITLE]", "Convert Notice");
132
                body = body.Replace("[time]", convertItem.CREATE_DATETIME.ToString());
133
                body = body.Replace("[projectno]", convertItem.PROJECT_NO?.ToString());
134
                body = body.Replace("[documentid]", convertItem.DOCUMENT_ID?.ToString());
135
                body = body.Replace("[documenturl]", convertItem.DOCUMENT_URL?.ToString());
136
                body = body.Replace("[errorcode]", convertItem.STATUS.ToString());
137
                body = body.Replace("[message]", convertItem.EXCEPTION?.ToString());
138
                
139
                message.Body = body;
140
                message.BodyEncoding = System.Text.Encoding.UTF8;
141

  
142
                client.Send(message);
143
                message.Dispose();
144
            }
88 145
        }
89 146
    }
90 147
}
ConvertService/ServiceBase/ErrorNotice/ErrorNotice.csproj
17 17
    <DebugSymbols>true</DebugSymbols>
18 18
    <DebugType>full</DebugType>
19 19
    <Optimize>false</Optimize>
20
    <OutputPath>bin\Debug\</OutputPath>
20
    <OutputPath>..\publish\Plugin\ErrorNotice\</OutputPath>
21 21
    <DefineConstants>DEBUG;TRACE</DefineConstants>
22 22
    <ErrorReport>prompt</ErrorReport>
23 23
    <WarningLevel>4</WarningLevel>
......
26 26
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27 27
    <DebugType>pdbonly</DebugType>
28 28
    <Optimize>true</Optimize>
29
    <OutputPath>bin\Release\</OutputPath>
29
    <OutputPath>..\publish\Plugin\ErrorNotice\</OutputPath>
30 30
    <DefineConstants>TRACE</DefineConstants>
31 31
    <ErrorReport>prompt</ErrorReport>
32 32
    <WarningLevel>4</WarningLevel>
......
59 59
      <Version>2.0.8</Version>
60 60
    </PackageReference>
61 61
    <PackageReference Include="Markus.Message">
62
      <Version>1.5.4</Version>
62
      <Version>1.5.5</Version>
63 63
    </PackageReference>
64 64
    <PackageReference Include="MarkusDatabase">
65 65
      <Version>1.8.0</Version>
......
77 77
      <Name>Markus.Service.Extensions</Name>
78 78
    </ProjectReference>
79 79
  </ItemGroup>
80
  <ItemGroup>
81
    <None Include="MailTemplate.html">
82
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
83
    </None>
84
  </ItemGroup>
80 85
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
81 86
</Project>
ConvertService/ServiceBase/ErrorNotice/MailTemplate.html
1
<div style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></div>
2
<b>
3

  
4
    <div style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><hr style="height: 1px; background-color: rgb(0, 0, 0); border: 0px;"></div>&nbsp; &nbsp; [TITLE]
5
</b>
6
<br>
7
<hr style="height: 1px; background-color: rgb(0, 0, 0); border: 0px;">
8
<table border="1" cellspacing="0" cellpadding="0" style="word-break: normal; font-size: 10pt; width: 1514px; border-collapse: collapse; border: 1px none rgb(0, 0, 0); margin-left: 0px;">
9
    <tbody>
10
        <tr>
11
            <td style="border: 0px solid rgb(0, 0, 0); width: 92px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
12
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">time</p>
13
            </td>
14
            <td style="border: 0px solid rgb(0, 0, 0); width: 10px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
15
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">:</p>
16
            </td>
17
            <td style="border: 0px solid rgb(0, 0, 0); width: 564px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
18
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">[time]</p>
19
            </td>
20
            <td style="border: 0px solid rgb(0, 0, 0); width: 843px; height: 20px;" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
21
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
22
            </td>
23
        </tr>
24
        <tr>
25
            <td style="border: 0px solid rgb(0, 0, 0); width: 92px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
26
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">Project No</p>
27
            </td>
28
            <td style="border: 0px solid rgb(0, 0, 0); width: 10px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
29
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">:</p>
30
            </td>
31
            <td style="border: 0px solid rgb(0, 0, 0); width: 564px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
32
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">[projectno]</p>
33
            </td>
34
            <td style="border: 0px solid rgb(0, 0, 0); width: 843px; height: 20px;" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
35
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
36
            </td>
37
        </tr>
38
        <tr>
39
            <td style="border: 0px solid rgb(0, 0, 0); width: 92px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
40
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">Document ID</p>
41
            </td>
42
            <td style="border: 0px solid rgb(0, 0, 0); width: 10px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
43
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">:</p>
44
            </td>
45
            <td style="border: 0px solid rgb(0, 0, 0); width: 564px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
46
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">[documentid]</p>
47
            </td>
48
            <td style="border: 0px solid rgb(0, 0, 0); width: 843px; height: 20px;" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
49
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
50
            </td>
51
        </tr>
52
        <tr>
53
            <td style="border: 0px solid rgb(0, 0, 0); width: 92px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
54
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">Document Url</p>
55
            </td>
56
            <td style="border: 0px solid rgb(0, 0, 0); width: 10px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
57
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">:</p>
58
            </td>
59
            <td style="border: 0px solid rgb(0, 0, 0); width: 564px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
60
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><span style="font-size: 13.3333px; font-family: &quot;맑은 고딕&quot;;">[documenturl]</span></p>
61
            </td>
62
            <td style="border: 0px solid rgb(0, 0, 0); width: 843px; height: 20px;" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
63
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
64
            </td>
65
        </tr>
66
        <tr>
67
            <td style="border: 0px solid rgb(0, 0, 0); width: 92px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
68
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">error code</p>
69
            </td>
70
            <td style="border: 0px solid rgb(0, 0, 0); width: 10px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
71
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">:</p>
72
            </td>
73
            <td style="border: 0px solid rgb(0, 0, 0); width: 564px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
74
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">[errorcode]</p>
75
            </td>
76
            <td style="border: 0px solid rgb(0, 0, 0); width: 843px; height: 20px;" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
77
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
78
            </td>
79
        </tr>
80
        <tr>
81
            <td style="border: 0px solid rgb(0, 0, 0); width: 92px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
82
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">message</p>
83
            </td>
84
            <td style="border: 0px solid rgb(0, 0, 0); width: 10px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
85
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">:</p>
86
            </td>
87
            <td style="border: 0px solid rgb(0, 0, 0); width: 564px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
88
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;">[message]</p>
89
            </td>
90
            <td style="border: 0px solid rgb(0, 0, 0); width: 843px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
91
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
92
            </td>
93
        </tr>
94
        <tr>
95
            <td style="border: 0px solid rgb(0, 0, 0); width: 92px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
96
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
97
            </td>
98
            <td style="border: 0px solid rgb(0, 0, 0); width: 10px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
99
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
100
            </td>
101
            <td style="border: 0px solid rgb(0, 0, 0); width: 564px; height: 20px; background-color: rgb(255, 255, 255); white-space: nowrap;" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
102
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
103
            </td>
104
            <td style="border: 0px solid rgb(0, 0, 0); width: 843px; height: 20px; background-color: rgb(255, 255, 255);" class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
105
                <p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
106
            </td>
107
        </tr>
108
    </tbody>
109
</table>
110
<p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
111
<p style="font-family: &quot;맑은 고딕&quot;; font-size: 10pt; line-height: 150%; margin-top: 0px; margin-bottom: 0px;"><br></p>
ConvertService/ServiceBase/FileDownloadTest/FileDownloadTest.csproj
45 45
    <Reference Include="Markus.LibraryInstaller, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
46 46
      <HintPath>..\packages\Markus.LibraryInstaller.1.5.1\lib\net45\Markus.LibraryInstaller.dll</HintPath>
47 47
    </Reference>
48
    <Reference Include="Markus.Message, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL">
49
      <HintPath>..\packages\Markus.Message.1.5.4\lib\net45\Markus.Message.dll</HintPath>
48
    <Reference Include="Markus.Message, Version=1.5.5.0, Culture=neutral, processorArchitecture=MSIL">
49
      <HintPath>..\packages\Markus.Message.1.5.5\lib\net45\Markus.Message.dll</HintPath>
50 50
    </Reference>
51
    <Reference Include="MarkusPDF, Version=1.0.7178.16502, Culture=neutral, processorArchitecture=AMD64">
52
      <HintPath>..\packages\MarkusPDF.1.7.0\lib\net45\MarkusPDF.dll</HintPath>
51
    <Reference Include="MarkusPDF, Version=1.0.8301.29734, Culture=neutral, processorArchitecture=AMD64">
52
      <HintPath>..\packages\MarkusPDF.2.1.0\lib\net45\MarkusPDF.dll</HintPath>
53 53
    </Reference>
54 54
    <Reference Include="System" />
55 55
    <Reference Include="System.ComponentModel.DataAnnotations" />
......
77 77
    <ProjectReference Include="..\Markus.Service.Convert\Markus.Service.Convert.csproj">
78 78
      <Project>{867e065c-3c22-47b1-9c2a-130a78dddd51}</Project>
79 79
      <Name>Markus.Service.Convert</Name>
80
      <EmbedInteropTypes>False</EmbedInteropTypes>
81 80
    </ProjectReference>
82 81
    <ProjectReference Include="..\Markus.Service.DataBase\Markus.Service.DataBase.csproj">
83 82
      <Project>{400736fb-92c9-4bc0-b447-e8274103d813}</Project>
ConvertService/ServiceBase/FileDownloadTest/Program.cs
34 34
                        {
35 35
                            Markus.MarkusPDF markusPDF = new Markus.MarkusPDF();
36 36

  
37
                            markusPDF.pdfLoad(saveitem.PdfFilePath, -1, 450);
37
                            markusPDF.pdfLoad(saveitem.PdfFilePath, -1, 450, @"C:\MarkusFonts");
38 38
                            Console.WriteLine("pdf page : " + markusPDF.PageCount());
39 39

  
40 40
                            for (int i = 1; i < 20; i++)
ConvertService/ServiceBase/FileDownloadTest/packages.config
2 2
<packages>
3 3
  <package id="EntityFramework" version="6.2.0" targetFramework="net45" />
4 4
  <package id="Markus.LibraryInstaller" version="1.5.1" targetFramework="net45" />
5
  <package id="Markus.Message" version="1.5.4" targetFramework="net45" />
5
  <package id="Markus.Message" version="1.5.5" targetFramework="net45" />
6 6
  <package id="MarkusDatabase" version="1.8.0" targetFramework="net45" developmentDependency="true" />
7
  <package id="MarkusPDF" version="1.7.0" targetFramework="net45" />
7
  <package id="MarkusPDF" version="2.1.0" targetFramework="net45" />
8 8
</packages>
ConvertService/ServiceBase/FontErrorNotice/ErrorNotice.cs
1
using log4net;
2
using Markus.EntityModel;
3
using Markus.Service.Convert.Plugin;
4
using Markus.Service.Extensions;
5
using System;
6
using System.Collections.Generic;
7
using System.Data.Entity.Core.Objects;
8
using System.Data.Entity.Infrastructure;
9
using System.Linq;
10
using System.Text;
11
using System.Threading.Tasks;
12

  
13
namespace ErrorNotice
14
{
15
    public class ErrorNotice : Markus.Service.Convert.Plugin.IPlugin
16
    {
17
        public string Name => nameof(ErrorNotice);
18

  
19
        public string Exception { get; set; }
20
        public string gConvertID;
21

  
22
        private const string MARKUS_ConnectionString_KEY = "MARKUS_ConnectionString";
23
        private const string MARKUS_NoticeStatus_KEY = "NoticeStatus";
24

  
25
        bool IPlugin.Do(string ConvertID, Dictionary<string, object> Parameters)
26
        {
27
            bool result = true;
28

  
29
            log4net.Config.BasicConfigurator.Configure();
30
            log4net.ILog log = log4net.LogManager.GetLogger(typeof(ErrorNotice));
31

  
32
            try
33
            {
34
                if (Parameters.Keys.Count(x => x == MARKUS_ConnectionString_KEY) > 0)
35
                {
36
                    string connectionString = Parameters[MARKUS_ConnectionString_KEY].ToString();
37
                    var noticeStatusArray = Parameters[MARKUS_ConnectionString_KEY].ToString();
38

  
39
                    /// 5를 기본으로 하고 config에 status가 있으면 기본값을 삭제 후 적용
40
                    List<int> status = new List<int> {5};
41

  
42
                    if(!string.IsNullOrWhiteSpace(noticeStatusArray))
43
                    {
44
                        status = new List<int>();
45
                        status.AddRange(noticeStatusArray.Split(';').ToList().ConvertAll(x=>int.Parse(x)));
46
                    }
47

  
48
                    using (var entities = new Markus.EntityModel.MarkusModel(Markus.Service.Extensions.Encrypt.AESEncrypter.Decrypt(connectionString)))
49
                    {
50
                        var items = entities.CONVERTER_DOC.Where(x => x.ID == ConvertID);
51

  
52
                        if (items.Count() > 0)
53
                        {
54
                            var convertItem = items.First();
55

  
56
                            if(status.Contains(convertItem.STATUS))
57
                            {
58
                                SendNotice(convertItem);
59
                            }
60
                        }
61
                        else
62
                        {
63
                            this.Exception = $"Find Not ConvertItem by Id{ConvertID}";
64
                        }
65
                    }
66
                }
67
                else
68
                {
69
                    this.Exception = "MARKUS_ConnectionString SECTION Not Found";
70
                }
71
            }
72

  
73
            catch (Exception ex)
74
            {
75
                log.Error(ex);
76
                this.Exception = ex.ToString();
77
                result = false;
78
            }
79

  
80
            return result;
81
        }
82

  
83
        private void SendNotice(CONVERTER_DOC convertItem)
84
        {
85
            // convertItem.EXCEPTION
86
            //convertItem.STATUS
87
            //((Markus.Message.StatusCodeType)convertItem.STATUS).ToString() 
88
        }
89
    }
90
}
ConvertService/ServiceBase/FontErrorNotice/ErrorNotice.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>{77D97EC3-F93E-445A-A585-FFC40ACBCF3D}</ProjectGuid>
8
    <OutputType>Library</OutputType>
9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10
    <RootNamespace>ErrorNotice</RootNamespace>
11
    <AssemblyName>ErrorNotice</AssemblyName>
12
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13
    <FileAlignment>512</FileAlignment>
14
    <Deterministic>true</Deterministic>
15
  </PropertyGroup>
16
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17
    <DebugSymbols>true</DebugSymbols>
18
    <DebugType>full</DebugType>
19
    <Optimize>false</Optimize>
20
    <OutputPath>bin\Debug\</OutputPath>
21
    <DefineConstants>DEBUG;TRACE</DefineConstants>
22
    <ErrorReport>prompt</ErrorReport>
23
    <WarningLevel>4</WarningLevel>
24
    <PlatformTarget>x64</PlatformTarget>
25
  </PropertyGroup>
26
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27
    <DebugType>pdbonly</DebugType>
28
    <Optimize>true</Optimize>
29
    <OutputPath>bin\Release\</OutputPath>
30
    <DefineConstants>TRACE</DefineConstants>
31
    <ErrorReport>prompt</ErrorReport>
32
    <WarningLevel>4</WarningLevel>
33
  </PropertyGroup>
34
  <ItemGroup>
35
    <Reference Include="Markus.EntityModel">
36
      <HintPath>..\packages\MarkusDatabase.1.8.0\lib\net45\Markus.EntityModel.dll</HintPath>
37
    </Reference>
38
    <Reference Include="System" />
39
    <Reference Include="System.Core" />
40
    <Reference Include="System.Xml.Linq" />
41
    <Reference Include="System.Data.DataSetExtensions" />
42
    <Reference Include="Microsoft.CSharp" />
43
    <Reference Include="System.Data" />
44
    <Reference Include="System.Net.Http" />
45
    <Reference Include="System.Xml" />
46
  </ItemGroup>
47
  <ItemGroup>
48
    <Compile Include="ErrorNotice.cs" />
49
    <Compile Include="Properties\AssemblyInfo.cs" />
50
  </ItemGroup>
51
  <ItemGroup>
52
    <PackageReference Include="EntityFramework">
53
      <Version>6.2.0</Version>
54
    </PackageReference>
55
    <PackageReference Include="EntityFramework.ko">
56
      <Version>6.2.0</Version>
57
    </PackageReference>
58
    <PackageReference Include="log4net">
59
      <Version>2.0.8</Version>
60
    </PackageReference>
61
    <PackageReference Include="Markus.Message">
62
      <Version>1.5.5</Version>
63
    </PackageReference>
64
    <PackageReference Include="MarkusDatabase">
65
      <Version>1.8.0</Version>
66
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
67
      <PrivateAssets>all</PrivateAssets>
68
    </PackageReference>
69
  </ItemGroup>
70
  <ItemGroup>
71
    <ProjectReference Include="..\Markus.Service.Convert.IPlugin\Markus.Service.Convert.IPlugin.csproj">
72
      <Project>{a5ba7325-379c-4ccb-b156-1704fc2175e3}</Project>
73
      <Name>Markus.Service.Convert.IPlugin</Name>
74
    </ProjectReference>
75
    <ProjectReference Include="..\Markus.Service.Extensions\Markus.Service.Extensions.csproj">
76
      <Project>{5f983789-3e8f-4f9a-a601-138c3a83ca5f}</Project>
77
      <Name>Markus.Service.Extensions</Name>
78
    </ProjectReference>
79
  </ItemGroup>
80
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
81
</Project>
ConvertService/ServiceBase/FontErrorNotice/Properties/AssemblyInfo.cs
1
using System.Reflection;
2
using System.Runtime.CompilerServices;
3
using System.Runtime.InteropServices;
4

  
5
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
6
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
7
// 이러한 특성 값을 변경하세요.
8
[assembly: AssemblyTitle("ErrorNotice")]
9
[assembly: AssemblyDescription("")]
10
[assembly: AssemblyConfiguration("")]
11
[assembly: AssemblyCompany("")]
12
[assembly: AssemblyProduct("ErrorNotice")]
13
[assembly: AssemblyCopyright("Copyright ©  2020")]
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("77d97ec3-f93e-445a-a585-ffc40acbcf3d")]
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")]
ConvertService/ServiceBase/IServiceBase/Markus.Service.Interface.csproj
49 49
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
50 50
  </PropertyGroup>
51 51
  <ItemGroup>
52
    <Reference Include="Markus.Message, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL">
53
      <HintPath>..\packages\Markus.Message.1.5.4\lib\net45\Markus.Message.dll</HintPath>
52
    <Reference Include="Markus.Message, Version=1.5.5.0, Culture=neutral, processorArchitecture=MSIL">
53
      <HintPath>..\packages\Markus.Message.1.5.5\lib\net45\Markus.Message.dll</HintPath>
54 54
    </Reference>
55 55
    <Reference Include="System" />
56 56
    <Reference Include="System.Core" />
ConvertService/ServiceBase/IServiceBase/ProcessContext.cs
67 67
        /// 상태값을 보내는 간격(페이지간격)
68 68
        /// </summary>
69 69
        public int SendStatusInterval { get; set; }
70

  
71
        public string FontsFolder { get; set; }
72

  
73
        public bool IsApiDownload { get; set; }
70 74
    }
71 75
}
ConvertService/ServiceBase/IServiceBase/packages.config
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<packages>
3
  <package id="Markus.Message" version="1.5.4" targetFramework="net45" />
3
  <package id="Markus.Message" version="1.5.5" targetFramework="net45" />
4 4
</packages>
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)