프로젝트

일반

사용자정보

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

markus / DataBase / WpfDataBaseTest / MainWindow.xaml.cs @ 43e1d368

이력 | 보기 | 이력해설 | 다운로드 (2.72 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
                try
38
                {
39
                    var connectstr = "data source=cloud.devdoftech.co.kr,7777;initial catalog=Markus;persist security info=True;user id=doftech;Password=dof1073#;MultipleActiveResultSets=True;";
40
                    var entities = new Markus.EntityModel.MarkusModel(connectstr);
41
     
42
                }
43
                catch (Exception ex)
44
                {
45
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
46
                    throw ex;
47
                }
48

    
49
                datagrid.ItemsSource = null;
50
                using (DatabseModelCRUDSampleDLL.TestDataBase db = new DatabseModelCRUDSampleDLL.TestDataBase(txtConnStr.Text))
51
                {
52
                    datagrid.ItemsSource = db.GetConvertDoc(10);
53
                    txtLog.Text = "Ok";
54
                }
55
            }
56
            catch (Exception ex)
57
            {
58
                txtLog.Text = ex.ToString();
59
            }
60
        }
61

    
62
        /// <summary>
63
        /// 직접 Markus 모델을 참조하여 호출 한다.
64
        /// </summary>
65
        /// <param name="sender"></param>
66
        /// <param name="e"></param>
67
        private void ModelCall_Click(object sender, RoutedEventArgs e)
68
        {
69
            try
70
            {
71
                datagrid.ItemsSource = null;
72
                using (Markus.EntityModel.MarkusModel model = new Markus.EntityModel.MarkusModel(txtConnStr.Text))
73
                {
74
                    datagrid.ItemsSource = model.CONVERTER_DOC.Take(10).ToList();
75
                }
76
            }
77
            catch (Exception ex)
78
            {
79
                txtLog.Text = ex.ToString();
80
                txtLog.Text = "Ok";
81
            }
82
        }
83

    
84
        private void Clear_Click(object sender, RoutedEventArgs e)
85
        {
86
            datagrid.ItemsSource = null;
87
        }
88
    }
89
}
클립보드 이미지 추가 (최대 크기: 500 MB)