markus / ConvertService / ServiceBase / ConnectionStringBuild / MainWindow.xaml.cs @ 731c84b8
이력 | 보기 | 이력해설 | 다운로드 (2.22 KB)
1 |
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 |
using Markus.Service; |
16 |
using Markus.Service.DataBase.Repositories; |
17 |
using Markus.Service.Extensions; |
18 |
using Markus.Service.Helper; |
19 |
using static Markus.Service.Extensions.Encrypt; |
20 |
|
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 |
|
46 |
private async void ButtonTest_Click(object sender, RoutedEventArgs e) |
47 |
{ |
48 |
try |
49 |
{ |
50 |
using (ConvertDocRepository database = new ConvertDocRepository(txtDecrypt.Text,Markus.Service.DataBase.DBMSType.MSSQL)) |
51 |
{ |
52 |
var result = await database.GetConvertDocAsync((int)Markus.Message.StatusCodeType.Wait); |
53 |
|
54 |
txtLog.Text += "Test Ok" + result.Count().ToString(); |
55 |
} |
56 |
} |
57 |
catch (Exception ex) |
58 |
{ |
59 |
txtLog.Text += ex.ToString(); |
60 |
} |
61 |
} |
62 |
|
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 |
} |
69 |
} |