프로젝트

일반

사용자정보

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

markus / FinalServiceV3 / KCOM_FinalService / DatabaseLoadTest / Program.cs @ faf998c6

이력 | 보기 | 이력해설 | 다운로드 (4.3 KB)

1

2
using Markus.EntityModel;
3
using System;
4
using System.Collections.Generic;
5
using System.Linq;
6
using System.Text;
7
using System.Threading.Tasks;
8

    
9
namespace DatabaseLoadTest
10
{
11
    class Program
12
    {
13
        private static string MarkusConnectionString;
14
        private static string CIConnectionString;
15

    
16
        static void Main(string[] args)
17
        {
18
            try
19
            {
20

    
21
                using (Markus.EntityModel.MarkusModel _entity = new Markus.EntityModel.MarkusModel(MarkusConnectionString))
22
                {
23
                    var items = _entity.FINAL_PDF;
24

    
25
                    Console.WriteLine("FinalPDF Count : " + items.Count());
26

    
27
                    foreach (var item in items)
28
                    {
29
                        List<MARKUP_DATA> MarkupDataSet = null;
30
                        DOCINFO DocInfoItem = null;
31

    
32
                        using (Markus.EntityModel.MarkusModel _ciEntity = new Markus.EntityModel.MarkusModel(CIConnectionString))
33
                        {
34
                            DocInfoItem = _ciEntity.DOCINFO.Where(x => x.DOCUMENT_ID == item.DOCUMENT_ID).FirstOrDefault();
35

    
36
                            var markupinfoItem = DocInfoItem.MARKUP_INFO.Where(x => x.DOCINFO_ID == DocInfoItem.ID && x.CONSOLIDATE == 1 && x.AVOID_CONSOLIDATE == 0 && x.PART_CONSOLIDATE == 0).FirstOrDefault();
37

    
38
                            if (markupinfoItem.MARKUP_INFO_VERSION.Count > 0)
39
                            {
40
                                MarkupDataSet = markupinfoItem.MARKUP_INFO_VERSION.OrderBy(x => x.CREATE_DATE).LastOrDefault().MARKUP_DATA.ToList().OrderBy(x => x.PAGENUMBER).ToList();
41
                            }
42
                        }
43

    
44
                        List<MARKUP_DATA> MarkupDataSet2 = null;
45
                        DOCINFO DocInfoItem2 = null;
46
                        MARKUP_INFO MarkupInfoItem = null;
47

    
48
                        using (Markus.EntityModel.MarkusModel _ciEntity = new Markus.EntityModel.MarkusModel(CIConnectionString))
49
                        {
50
                            var _DOCINFO = _ciEntity.DOCINFO.Where(x => x.DOCUMENT_ID == item.DOCUMENT_ID);
51

    
52
                            if (_DOCINFO.Count() > 0)
53
                            {
54
                                DocInfoItem2 = _DOCINFO.First();
55

    
56
                                var infoItems = _ciEntity.MARKUP_INFO.Where(x => x.DOCINFO_ID == DocInfoItem.ID && x.CONSOLIDATE == 1 && x.AVOID_CONSOLIDATE == 0 && x.PART_CONSOLIDATE == 0);
57

    
58
                                if (infoItems.Count() == 0)
59
                                {
60
                                    throw new Exception("콘솔리데잇이 작업 요청 후에 수정 / 삭제 되었습니다");
61
                                }
62
                                else
63
                                {
64
                                    MarkupInfoItem = infoItems.First();
65

    
66
                                    var markupInfoVerItems = _ciEntity.MARKUP_INFO_VERSION.Where(x => x.MARKUPINFO_ID == MarkupInfoItem.ID).ToList();
67

    
68
                                    if (markupInfoVerItems.Count() > 0)
69
                                    {
70
                                        var markupInfoVerItem = markupInfoVerItems.OrderByDescending(x => x.CREATE_DATE).First();
71

    
72
                                        MarkupDataSet2 = _ciEntity.MARKUP_DATA.Where(x => x.MARKUPINFO_VERSION_ID == markupInfoVerItem.ID).OrderBy(d => d.PAGENUMBER).ToList();
73
                                    }
74
                                    else
75
                                    {
76
                                        throw new Exception("MARKUP_INFO_VERSION 이 존재 하지 않습니다");
77
                                    }
78
                                }
79
                            }
80
                        }
81

    
82

    
83
                        if (MarkupDataSet?.Count() != MarkupDataSet?.Count())
84
                        {
85
                            Console.WriteLine($"Document ID : {item.DOCUMENT_ID} Error");
86
                        }
87

    
88
                        System.Threading.Thread.Sleep(100);
89
                    }
90

    
91
                }
92
            }
93
            catch (Exception ex)
94
            {
95
                Console.WriteLine(ex.ToString());
96
            }
97
            Console.WriteLine("완료");
98
            Console.ReadLine();
99
        }
100

    
101
        static void Write(string Log)
102
        {
103

    
104
        }
105
    }
106
}
클립보드 이미지 추가 (최대 크기: 500 MB)