프로젝트

일반

사용자정보

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

markus / MARKUSStart / Markus / MainWindow.xaml.cs @ b2948d06

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

1
using Newtonsoft.Json;
2
using System;
3
using System.Collections.Generic;
4
using System.Diagnostics;
5
using System.Linq;
6
using System.Text;
7
using System.Threading.Tasks;
8
using System.Windows;
9
using System.Windows.Controls;
10
using System.Windows.Data;
11
using System.Windows.Documents;
12
using System.Windows.Input;
13
using System.Windows.Media;
14
using System.Windows.Media.Imaging;
15
using System.Windows.Navigation;
16
using System.Windows.Shapes;
17

    
18
namespace Markus
19
{
20
    /// <summary>
21
    /// MainWindow.xaml에 대한 상호 작용 논리
22
    /// </summary>
23
    public partial class MainWindow : Window
24
    {
25
        public MainWindow()
26
        {
27
            InitializeComponent();
28
        }
29

    
30
        private void Button_Click(object sender, RoutedEventArgs e)
31
        {
32
            string MarkusLink = "kcom://" + CreateMarkusParam(this.ProjectNO.Text, this.DocumentItemID.Text, UserID.Text, this.Partner.IsChecked , this.CreateFinal.IsChecked, this.NewComment.IsChecked);
33

    
34
            this.URL.Text = MarkusLink;
35
            ProcessStartInfo startInfo = null;
36

    
37
            startInfo = new ProcessStartInfo("iexplore.exe", MarkusLink);
38

    
39
            Process.Start(startInfo);
40
        }
41

    
42
        public static string CreateMarkusParam(string projectNo, string documentID, string userID, bool? partner, bool? createfinal, bool? newcomment)
43
        {
44
            ViewInfo viewInfo = new ViewInfo();
45

    
46
            viewInfo.DocumentItemID = documentID;
47
            viewInfo.ProjectNO = projectNo;
48
            viewInfo.UserID = userID;
49
            viewInfo.bPartner = partner;
50
            viewInfo.CreateFinalPDFPermission = createfinal;
51
            viewInfo.NewCommentPermission = newcomment;
52

    
53
            return ParamEncoding(JsonConvert.SerializeObject(viewInfo));
54

    
55
        }
56
        public static string ParamEncoding(string EncodingText, System.Text.Encoding oEncoding = null)
57
        {
58

    
59
            if (oEncoding == null)
60
                oEncoding = System.Text.Encoding.UTF8;
61

    
62
            return Convert.ToBase64String(oEncoding.GetBytes(EncodingText));
63

    
64
        }
65
    }
66
        /// <summary>
67
        /// 생성자 
68
        /// </summary>
69
        //public ViewInfo()
70
        //{
71
        //    bPartner = false;
72
        //    CreateFinalPDFPermission = true;
73
        //    NewCommentPermission = true;
74
        //}
75

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