프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / MarkupToPDF / Common / GetUserSign.cs @ 366f00c2

이력 | 보기 | 이력해설 | 다운로드 (2.59 KB)

1 787a4489 KangIngu
using KCOMDataModel.Common;
2
using KCOMDataModel.DataModel;
3
using System;
4
using System.Collections.Generic;
5
using System.IO;
6
using System.Linq;
7 eb5cdefc djkim
using System.Net;
8 e52385b9 ljiyeon
using System.Runtime.InteropServices;
9 2aac9b2b djkim
using System.ServiceModel;
10 787a4489 KangIngu
using System.Text;
11
12
namespace MarkupToPDF.Common
13
{
14
    public class GetUserSign
15
    {
16 e52385b9 ljiyeon
        /// 
17 c247e6b4 humkyung
        /// <summary>
18 e52385b9 ljiyeon
        /// Application Data Folder
19
        /// </summary>
20
        /// 
21
        public static string AppDataFolder
22
        {
23
            get
24
            {
25
                return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MARKUS");
26
            }
27
        }
28
29 5928384e djkim
        
30 5529d2a2 humkyung
	    /// <summary>
31 c247e6b4 humkyung
        /// get signature of given user of given project
32
        /// </summary>
33
        /// <param name="UserID"></param>
34
        /// <param name="ProjectNo"></param>
35
        /// <returns></returns>
36 cdfb57ff taeseongkim
        public static string GetSign(string UserID, string ProjectNo,bool isExternal= false)
37 787a4489 KangIngu
        {
38 661b7416 humkyung
            BasicHttpBinding _binding;
39
            EndpointAddress _EndPoint;
40
41 2aac9b2b djkim
            _binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
42
            _binding.MaxBufferSize = 2147483647;
43
            _binding.MaxReceivedMessageSize = 2147483647;
44
            _binding.OpenTimeout = new TimeSpan(0, 1, 0);
45
            _binding.ReceiveTimeout = new TimeSpan(0, 10, 0);
46
            _binding.CloseTimeout = new TimeSpan(0, 5, 0);
47
            _binding.SendTimeout = new TimeSpan(0, 5, 0);
48
            _binding.TextEncoding = System.Text.Encoding.UTF8;
49 eb5cdefc djkim
            _binding.TransferMode = TransferMode.Buffered;
50 7405922f djkim
            string localdomain = CommonLib.Common.GetConfigString("HOST_DOMAIN", "DOMAIN", "");
51
52 366f00c2 taeseongkim
            var hostEntry =  CommonLib.DNSHelper.GetHostEntryTask();
53 7405922f djkim
54
            if (hostEntry == null)
55
            {
56
                System.Diagnostics.Debug.WriteLine("(hostEntry == null");
57
                isExternal = true;
58
            }
59
            else if (!hostEntry.HostName.EndsWith(localdomain))
60
            {
61
                // 외부 사용자
62
                isExternal = true;
63
            }
64 e52385b9 ljiyeon
65 eb5cdefc djkim
            string sBaseServiceURL = CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "", isExternal);
66
            //CommonLib.Common.GetConfigString("BaseClientAddress", "URL", "");
67 c247e6b4 humkyung
68 2aac9b2b djkim
            _EndPoint = new EndpointAddress(string.Format("{0}/ServiceDeepView.svc", sBaseServiceURL));
69
70
            markus_api.ServiceDeepViewClient client = new markus_api.ServiceDeepViewClient(_binding, _EndPoint);
71
            var _sign = client.GetSignData(ProjectNo, UserID);           
72
73
            return _sign;
74 787a4489 KangIngu
        }
75
    }
76 5529d2a2 humkyung
}
클립보드 이미지 추가 (최대 크기: 500 MB)