markus / DataBase / WpfDataBaseTest / MainWindow.xaml.cs @ c854511f
이력 | 보기 | 이력해설 | 다운로드 (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 |
|
16 |
namespace WpfDataBaseTest |
17 |
{ |
18 |
/// <summary> |
19 |
/// MainWindow.xaml에 대한 상호 작용 논리 |
20 |
/// </summary> |
21 |
public partial class MainWindow : Window |
22 |
{ |
23 |
public MainWindow() |
24 |
{ |
25 |
InitializeComponent(); |
26 |
} |
27 |
|
28 |
/// <summary> |
29 |
/// markus 모델을 참조하여 개발한 dll을 호출한다. |
30 |
/// </summary> |
31 |
/// <param name="sender"></param> |
32 |
/// <param name="e"></param> |
33 |
private void DataCall_Click(object sender, RoutedEventArgs e) |
34 |
{ |
35 |
try |
36 |
{ |
37 |
datagrid.ItemsSource = null; |
38 |
using (DatabseModelCRUDSampleDLL.TestDataBase db = new DatabseModelCRUDSampleDLL.TestDataBase(txtConnStr.Text)) |
39 |
{ |
40 |
datagrid.ItemsSource = db.GetConvertDoc(10); |
41 |
txtLog.Text = "Ok"; |
42 |
} |
43 |
} |
44 |
catch (Exception ex) |
45 |
{ |
46 |
txtLog.Text = ex.ToString(); |
47 |
} |
48 |
} |
49 |
|
50 |
/// <summary> |
51 |
/// 직접 Markus 모델을 참조하여 호출 한다. |
52 |
/// </summary> |
53 |
/// <param name="sender"></param> |
54 |
/// <param name="e"></param> |
55 |
private void ModelCall_Click(object sender, RoutedEventArgs e) |
56 |
{ |
57 |
try |
58 |
{ |
59 |
datagrid.ItemsSource = null; |
60 |
using (Markus.EntityModel.MarkusModel model = new Markus.EntityModel.MarkusModel(txtConnStr.Text)) |
61 |
{ |
62 |
datagrid.ItemsSource = model.CONVERTER_DOC.Take(10).ToList(); |
63 |
} |
64 |
} |
65 |
catch (Exception ex) |
66 |
{ |
67 |
txtLog.Text = ex.ToString(); |
68 |
txtLog.Text = "Ok"; |
69 |
} |
70 |
} |
71 |
|
72 |
private void Clear_Click(object sender, RoutedEventArgs e) |
73 |
{ |
74 |
datagrid.ItemsSource = null; |
75 |
} |
76 |
} |
77 |
} |