markus / MARKUSStart / Markus / MainWindow.xaml.cs @ 38d69491
이력 | 보기 | 이력해설 | 다운로드 (2.62 KB)
1 | 8e6884a5 | taeseongkim | 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 | c206d293 | taeseongkim | string MarkusLink = "kcom://" + CreateMarkusParam(this.ProjectNO.Text, this.DocumentItemID.Text, UserID.Text, this.Partner.IsChecked , this.CreateFinal.IsChecked, this.NewComment.IsChecked); |
33 | 8e6884a5 | taeseongkim | |
34 | this.URL.Text = MarkusLink; |
||
35 | ProcessStartInfo startInfo = null; |
||
36 | |||
37 | startInfo = new ProcessStartInfo("iexplore.exe", MarkusLink); |
||
38 | |||
39 | Process.Start(startInfo); |
||
40 | } |
||
41 | public static string CreateMarkusParam(string projectNo, string documentID, string userID, bool? partner, bool? createfinal, bool? newcomment) |
||
42 | { |
||
43 | ViewInfo viewInfo = new ViewInfo(); |
||
44 | |||
45 | viewInfo.DocumentItemID = documentID; |
||
46 | viewInfo.ProjectNO = projectNo; |
||
47 | viewInfo.UserID = userID; |
||
48 | viewInfo.bPartner = partner; |
||
49 | viewInfo.CreateFinalPDFPermission = createfinal; |
||
50 | viewInfo.NewCommentPermission = newcomment; |
||
51 | |||
52 | return ParamEncoding(JsonConvert.SerializeObject(viewInfo)); |
||
53 | |||
54 | } |
||
55 | public static string ParamEncoding(string EncodingText, System.Text.Encoding oEncoding = null) |
||
56 | { |
||
57 | |||
58 | if (oEncoding == null) |
||
59 | oEncoding = System.Text.Encoding.UTF8; |
||
60 | |||
61 | return Convert.ToBase64String(oEncoding.GetBytes(EncodingText)); |
||
62 | |||
63 | } |
||
64 | 195f079d | taeseongkim | } |
65 | |||
66 | public class ViewInfo |
||
67 | { |
||
68 | public string DocumentItemID { get; set; } |
||
69 | public bool? bPartner { get; set; } = false; |
||
70 | public bool? CreateFinalPDFPermission { get; set; } = false; |
||
71 | public bool? NewCommentPermission { get; set; } = false; |
||
72 | public string ProjectNO { get; set; } |
||
73 | public string UserID { get; set; } |
||
74 | } |
||
75 | |||
76 | /// <summary> |
||
77 | /// 생성자 |
||
78 | /// </summary> |
||
79 | //public ViewInfo() |
||
80 | //{ |
||
81 | // bPartner = false; |
||
82 | // CreateFinalPDFPermission = true; |
||
83 | // NewCommentPermission = true; |
||
84 | //} |
||
85 | |||
86 | 8e6884a5 | taeseongkim | } |
87 | } |