markus / ConvertService / ServiceBase / ConnectionStringBuild / MainWindow.xaml.cs @ f333dcc2
이력 | 보기 | 이력해설 | 다운로드 (2.22 KB)
1 | 53c9637d | taeseongkim | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading.Tasks; |
||
6 | using System.Windows; |
||
7 | using System.Windows.Controls; |
||
8 | using System.Windows.Data; |
||
9 | using System.Windows.Documents; |
||
10 | using System.Windows.Input; |
||
11 | using System.Windows.Media; |
||
12 | using System.Windows.Media.Imaging; |
||
13 | using System.Windows.Navigation; |
||
14 | using System.Windows.Shapes; |
||
15 | d5096d58 | taeseongkim | using Markus.Service; |
16 | a5e5fff6 | taeseongkim | using Markus.Service.DataBase.Repositories; |
17 | 53c9637d | taeseongkim | using Markus.Service.Extensions; |
18 | d5096d58 | taeseongkim | using Markus.Service.Helper; |
19 | using static Markus.Service.Extensions.Encrypt; |
||
20 | 53c9637d | taeseongkim | |
21 | namespace ConnectionStringBuild |
||
22 | { |
||
23 | /// <summary> |
||
24 | /// MainWindow.xaml에 대한 상호 작용 논리 |
||
25 | /// </summary> |
||
26 | public partial class MainWindow : Window |
||
27 | { |
||
28 | public MainWindow() |
||
29 | { |
||
30 | InitializeComponent(); |
||
31 | } |
||
32 | |||
33 | private void Button_Click(object sender, RoutedEventArgs e) |
||
34 | { |
||
35 | if(!string.IsNullOrWhiteSpace(txtDecrypt.Text) && string.IsNullOrWhiteSpace(txtEncrypt.Text)) |
||
36 | { |
||
37 | txtEncrypt.Text = Encrypt.AESEncrypter.Encrypt(txtDecrypt.Text); |
||
38 | } |
||
39 | else if (string.IsNullOrWhiteSpace(txtDecrypt.Text) && !string.IsNullOrWhiteSpace(txtEncrypt.Text)) |
||
40 | { |
||
41 | txtDecrypt.Text = Encrypt.AESEncrypter.Decrypt(txtEncrypt.Text); |
||
42 | } |
||
43 | |||
44 | } |
||
45 | 0a89a17f | taeseongkim | |
46 | a5e5fff6 | taeseongkim | private async void ButtonTest_Click(object sender, RoutedEventArgs e) |
47 | 0a89a17f | taeseongkim | { |
48 | try |
||
49 | { |
||
50 | 731c84b8 | taeseongkim | using (ConvertDocRepository database = new ConvertDocRepository(txtDecrypt.Text,Markus.Service.DataBase.DBMSType.MSSQL)) |
51 | 0a89a17f | taeseongkim | { |
52 | a5e5fff6 | taeseongkim | var result = await database.GetConvertDocAsync((int)Markus.Message.StatusCodeType.Wait); |
53 | 0a89a17f | taeseongkim | |
54 | a5e5fff6 | taeseongkim | txtLog.Text += "Test Ok" + result.Count().ToString(); |
55 | 0a89a17f | taeseongkim | } |
56 | } |
||
57 | catch (Exception ex) |
||
58 | { |
||
59 | txtLog.Text += ex.ToString(); |
||
60 | } |
||
61 | } |
||
62 | d5096d58 | taeseongkim | |
63 | private void ButtonTest2_Click(object sender, RoutedEventArgs e) |
||
64 | { |
||
65 | var convetContext = ObjectToBytesStringConvert.BytesStringToObject<ProcessContext>(AESEncrypter.Decrypt(txtEncrypt.Text)); |
||
66 | System.Diagnostics.Debug.WriteLine(convetContext.OriginFilePath); |
||
67 | } |
||
68 | 53c9637d | taeseongkim | } |
69 | } |