프로젝트

일반

사용자정보

개정판 82705273

ID82705273400bdec9af8e7e47bd7c1978531807a5
상위 c0420a29
하위 86886d41

유성호이(가) 일년 이상 전에 추가함

issue #0000
repository, controller 예외처리 추가

Change-Id: I36131f1b27f8e0095ea07f19a349ac0a5ded1904

차이점 보기:

ID2.Manager/ID2.Manager.Controller/Controllers/DocumentController.cs
18 18

  
19 19
        public IEnumerable<Documents> GetAllDocuments()
20 20
        {
21
            using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
21
            try
22 22
            {
23
                return rep.GetAllDocuments();
23
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
24
                {
25
                    return rep.GetAllDocuments();
26
                }
27
            }
28
            catch (Exception ex)
29
            {
30
                throw ex;
24 31
            }
25 32
        }
26 33

  
27 34
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
28 35
        {
29
            using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
36
            try
37
            {
38
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
39
                {
40
                    return rep.GetDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult);
41
                }
42
            }
43
            catch (Exception ex)
30 44
            {
31
                return rep.GetDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult);
45
                throw ex;
32 46
            }
33 47
        }
34 48

  
35 49
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(List<ID2ProjectInfo> id2Infos, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
36 50
        {
37
            IEnumerable<Documents> docs = this.GetDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult).dwgs;
38
            List<ID2Drawings> id2docs = null;
39

  
40
            if (id2Infos.Any())
51
            try
41 52
            {
42
                id2docs = new List<ID2Drawings>();
43
                id2Infos.ForEach(x =>
53
                IEnumerable<Documents> docs = this.GetDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult).dwgs;
54
                List<ID2Drawings> id2docs = null;
55

  
56
                if (id2Infos.Any())
44 57
                {
45
                    id2docs.AddRange(new DocumentController(x).GetID2DrawingsByProject(x));
46
                });
47
            }
48

  
49
            if (docs != null && id2docs != null && docs.Any() && id2docs.Any())
50
            {
51
                var result = from doc in docs
52
                             join id2 in id2docs on new { projCd = doc.RefProjectCode, DocNo = doc.DocumentNo } equals new { projCd = id2.PROJECTNAME, DocNo = id2.DOCNAME } into gj
53
                             from dw in gj.DefaultIfEmpty()
54
                             select new Documents()
55
                             {
56
                                 Seq = doc.Seq,
57
                                 DocID = doc.DocID,
58
                                 DocumentNo = doc.DocumentNo,
59
                                 RevisonNo = doc.RevisonNo,
60
                                 RefProjectCode = doc.RefProjectCode,
61
                                 IsLatest = doc.IsLatest,
62
                                 AutoCADFilie = doc.AutoCADFilie,
63
                                 PDFFile = doc.PDFFile,
64
                                 MarkupLink = doc.MarkupLink,
65
                                 AVEVALink = doc.AVEVALink,
66
                                 DocFilePath = doc.DocFilePath,
67
                                 DocFileName = doc.DocFileName,
68
                                 JobLevel = doc.JobLevel,
69
                                 IsTypical = doc.IsTypical,
70
                                 PersonInCharge = doc.PersonInCharge,
71
                                 IsDeleted = doc.IsDeleted,
72
                                 RegisteredDate = doc.RegisteredDate,
73
                                 ModifiedDate = doc.ModifiedDate,
74
                                 DeletedDate = doc.DeletedDate,
75
                                 ToIsDiscussion = doc.ToIsDiscussion,
76
                                 ToRemarks = doc.ToRemarks,
77
                                 ToCreator = doc.ToCreator,
78
                                 ToCapture = doc.ToCapture,
79
                                 ToIsMarkup = doc.ToIsMarkup,
80
                                 FrReviewStatus = doc.FrReviewStatus,
81
                                 FrRemarks = doc.FrRemarks,
82
                                 FrCreator = doc.FrCreator,
83
                                 FrCapture = doc.FrCapture,
84
                                 FrIsMarkup = doc.FrIsMarkup,
85
                                 IsID2Work = doc.IsID2Work,
86
                                 ID2Connection = doc.ID2Connection,
87
                                 ID2StartDate = doc.ID2StartDate,
88
                                 ID2EndDate = dw?.DATETIME == null ? (DateTime?)null : Convert.ToDateTime(dw?.DATETIME),
89
                                 ID2JobTime = doc.ID2JobTime,
90
                                 ID2Status = doc.ID2Status,
91
                                 ID2Issues = doc.ID2Issues,
92
                                 AVEVAConnection = doc.AVEVAConnection,
93
                                 AVEVAConvertDate = doc.AVEVAConvertDate,
94
                                 AVEVAReviewDate = doc.AVEVAReviewDate,
95
                                 AVEVAStatus = doc.AVEVAStatus,
96
                                 AVEVAIssues = doc.AVEVAIssues,
97
                                 ReviewFilePath = doc.ReviewFilePath,
98
                                 ReviewFileName = doc.ReviewFileName,
99
                                 ProdReviewer = doc.ProdReviewer,
100
                                 ProdIsResult = doc.ProdIsResult,
101
                                 ProdRemarks = doc.ProdRemarks,
102
                                 ClientReviewer = doc.ClientReviewer,
103
                                 ClientIsResult = doc.ClientIsResult,
104
                                 ClientRemarks = doc.ClientRemarks,
105
                                 DTIsGateWay = doc.DTIsGateWay,
106
                                 DTIsImport = doc.DTIsImport,
107
                                 DTIsRegSystem = doc.DTIsRegSystem,
108
                                 DTRemarks = doc.DTRemarks,
109
                                 MarkupText = doc.MarkupText
110
                             };
111

  
112
                return (result, 0);
113

  
114
            }
115
            return (docs, 0);
58
                    id2docs = new List<ID2Drawings>();
59
                    id2Infos.ForEach(x =>
60
                    {
61
                        id2docs.AddRange(new DocumentController(x).GetID2DrawingsByProject(x));
62
                    });
63
                }
64

  
65
                if (docs != null && id2docs != null && docs.Any() && id2docs.Any())
66
                {
67
                    var result = from doc in docs
68
                                 join id2 in id2docs on new { projCd = doc.RefProjectCode, DocNo = doc.DocumentNo } equals new { projCd = id2.PROJECTNAME, DocNo = id2.DOCNAME } into gj
69
                                 from dw in gj.DefaultIfEmpty()
70
                                 select new Documents()
71
                                 {
72
                                     Seq = doc.Seq,
73
                                     DocID = doc.DocID,
74
                                     DocumentNo = doc.DocumentNo,
75
                                     RevisonNo = doc.RevisonNo,
76
                                     RefProjectCode = doc.RefProjectCode,
77
                                     IsLatest = doc.IsLatest,
78
                                     AutoCADFilie = doc.AutoCADFilie,
79
                                     PDFFile = doc.PDFFile,
80
                                     MarkupLink = doc.MarkupLink,
81
                                     AVEVALink = doc.AVEVALink,
82
                                     DocFilePath = doc.DocFilePath,
83
                                     DocFileName = doc.DocFileName,
84
                                     JobLevel = doc.JobLevel,
85
                                     IsTypical = doc.IsTypical,
86
                                     PersonInCharge = doc.PersonInCharge,
87
                                     IsDeleted = doc.IsDeleted,
88
                                     RegisteredDate = doc.RegisteredDate,
89
                                     ModifiedDate = doc.ModifiedDate,
90
                                     DeletedDate = doc.DeletedDate,
91
                                     ToIsDiscussion = doc.ToIsDiscussion,
92
                                     ToRemarks = doc.ToRemarks,
93
                                     ToCreator = doc.ToCreator,
94
                                     ToCapture = doc.ToCapture,
95
                                     ToIsMarkup = doc.ToIsMarkup,
96
                                     FrReviewStatus = doc.FrReviewStatus,
97
                                     FrRemarks = doc.FrRemarks,
98
                                     FrCreator = doc.FrCreator,
99
                                     FrCapture = doc.FrCapture,
100
                                     FrIsMarkup = doc.FrIsMarkup,
101
                                     IsID2Work = doc.IsID2Work,
102
                                     ID2Connection = doc.ID2Connection,
103
                                     ID2StartDate = doc.ID2StartDate,
104
                                     ID2EndDate = dw?.DATETIME == null ? (DateTime?)null : Convert.ToDateTime(dw?.DATETIME),
105
                                     ID2JobTime = doc.ID2JobTime,
106
                                     ID2Status = doc.ID2Status,
107
                                     ID2Issues = doc.ID2Issues,
108
                                     AVEVAConnection = doc.AVEVAConnection,
109
                                     AVEVAConvertDate = doc.AVEVAConvertDate,
110
                                     AVEVAReviewDate = doc.AVEVAReviewDate,
111
                                     AVEVAStatus = doc.AVEVAStatus,
112
                                     AVEVAIssues = doc.AVEVAIssues,
113
                                     ReviewFilePath = doc.ReviewFilePath,
114
                                     ReviewFileName = doc.ReviewFileName,
115
                                     ProdReviewer = doc.ProdReviewer,
116
                                     ProdIsResult = doc.ProdIsResult,
117
                                     ProdRemarks = doc.ProdRemarks,
118
                                     ClientReviewer = doc.ClientReviewer,
119
                                     ClientIsResult = doc.ClientIsResult,
120
                                     ClientRemarks = doc.ClientRemarks,
121
                                     DTIsGateWay = doc.DTIsGateWay,
122
                                     DTIsImport = doc.DTIsImport,
123
                                     DTIsRegSystem = doc.DTIsRegSystem,
124
                                     DTRemarks = doc.DTRemarks,
125
                                     MarkupText = doc.MarkupText
126
                                 };
127

  
128
                    return (result, 0);
129

  
130
                }
131
                return (docs, 0);
132
            }
133
            catch (Exception ex)
134
            {
135
                throw ex;
136
            }
116 137
        }
117 138

  
118 139
        public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList, string userId)
119 140
        {
120
            using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
141
            try
121 142
            {
122
                return rep.SetDocumentData(docList, delDocList, userId);
143
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
144
                {
145
                    return rep.SetDocumentData(docList, delDocList, userId);
146
                }
147
            }
148
            catch (Exception ex)
149
            {
150
                throw ex;
123 151
            }
124 152
        }
125 153

  
126 154
        public Documents SetID2Worker(Documents doc, string userId)
127 155
        {
128
            using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
156
            try
157
            {
158
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
159
                {
160
                    return rep.SetDocumentDataField(doc, userId);
161
                }
162
            }
163
            catch (Exception ex)
129 164
            {
130
                return rep.SetDocumentDataField(doc, userId);
165
                throw ex;
131 166
            }
132 167
        }
133 168

  
134 169
        public Documents SetDocumentDataField(Documents doc, string userId)
135 170
        {
136
            using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
171
            try
137 172
            {
138
                return rep.SetDocumentDataField(doc, userId);
173
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
174
                {
175
                    return rep.SetDocumentDataField(doc, userId);
176
                }
177
            }
178
            catch (Exception ex)
179
            {
180
                throw ex;
139 181
            }
140 182
        }
141 183

  
......
143 185
        //ID2
144 186
        public IEnumerable<ID2Drawings> GetID2DrawingsByProject(ID2ProjectInfo id2Info)
145 187
        {
146
            using (DocumentRepository rep = new DocumentRepository(this._ID2CONNSTR))
188
            try
189
            {
190
                using (DocumentRepository rep = new DocumentRepository(this._ID2CONNSTR))
191
                {
192
                    return rep.GetID2DrawingsByProject(id2Info);
193
                }
194
            }
195
            catch (Exception ex)
147 196
            {
148
                return rep.GetID2DrawingsByProject(id2Info);
197
                throw ex;
149 198
            }
150 199
        }
151 200

  
ID2.Manager/ID2.Manager.Controller/Controllers/FileController.cs
13 13
    {
14 14
        public IEnumerable<FileInfo> GetFileList(string documentID)
15 15
        {
16
            using (FileRepository rep = new FileRepository(this._MSSQLCONNSTR))
16
            try
17 17
            {
18
                return rep.GetFileList(documentID);
18
                using (FileRepository rep = new FileRepository(this._MSSQLCONNSTR))
19
                {
20
                    return rep.GetFileList(documentID);
21
                }
22
            }
23
            catch (Exception ex)
24
            {
25
                throw ex;
19 26
            }
20 27
        }
21 28

  
22 29
        public bool SetUserInfo(List<FileInfo> fileList)
23 30
        {
24
            using (FileRepository rep = new FileRepository(this._MSSQLCONNSTR))
31
            try
32
            {
33
                using (FileRepository rep = new FileRepository(this._MSSQLCONNSTR))
34
                {
35
                    return rep.SetFileInfo(fileList);
36
                }
37
            }
38
            catch (Exception ex)
25 39
            {
26
                return rep.SetFileInfo(fileList);
40
                throw ex;
27 41
            }
28 42
        }
29 43
    }
ID2.Manager/ID2.Manager.Controller/Controllers/ID2Controller.cs
14 14
    {
15 15
        public IEnumerable<ID2ProjectInfo> GetID2ProjectList()
16 16
        {
17
            using (ID2Repository rep = new ID2Repository(this._SQLITECONNSTR, DatabaseType.SQLITE))
17
            try
18 18
            {
19
                return rep.GetID2ProjectList();
19
                using (ID2Repository rep = new ID2Repository(this._SQLITECONNSTR, DatabaseType.SQLITE))
20
                {
21
                    return rep.GetID2ProjectList();
22
                }
23
            }
24
            catch (Exception ex)
25
            {
26
                throw ex;
20 27
            }
21 28
        }
22 29
    }
ID2.Manager/ID2.Manager.Controller/Controllers/ProjectController.cs
13 13
    {
14 14
        public IEnumerable<ProjectInfo> GetAllProjectList()
15 15
        {
16
            using (ProjectRepository rep = new ProjectRepository(this._MSSQLCONNSTR))
16
            try
17 17
            {
18
                var id2Project = new ID2Controller().GetID2ProjectList();
19
                var allProject = rep.GetAllProjectList();
18
                using (ProjectRepository rep = new ProjectRepository(this._MSSQLCONNSTR))
19
                {
20
                    var id2Project = new ID2Controller().GetID2ProjectList();
21
                    var allProject = rep.GetAllProjectList();
20 22

  
21
                return from mg in allProject
22
                       join id2 in id2Project on mg.Code equals id2.Name into gj
23
                       from prjs in gj.DefaultIfEmpty()
24
                       select new ProjectInfo()
25
                       {
26
                           ProjectID = mg.ProjectID,
27
                           Code = mg.Code,
28
                           Name = mg.Name,
29
                           Description = mg.Description,
30
                           ID2Path = prjs?.Path ?? null,
31
                           GroupID = mg.GroupID,
32
                           GroupName = mg.GroupName,
33
                           Level = mg.Level,
34
                           ID2Info = prjs ?? new ID2ProjectInfo(),
35
                       };
23
                    return from mg in allProject
24
                           join id2 in id2Project on mg.Code equals id2.Name into gj
25
                           from prjs in gj.DefaultIfEmpty()
26
                           select new ProjectInfo()
27
                           {
28
                               ProjectID = mg.ProjectID,
29
                               Code = mg.Code,
30
                               Name = mg.Name,
31
                               Description = mg.Description,
32
                               ID2Path = prjs?.Path ?? null,
33
                               GroupID = mg.GroupID,
34
                               GroupName = mg.GroupName,
35
                               Level = mg.Level,
36
                               ID2Info = prjs ?? new ID2ProjectInfo(),
37
                           };
38
                }
39
            }
40
            catch (Exception ex)
41
            {
42
                throw ex;
36 43
            }
37 44
        }
38 45

  
39 46
        public ProjectInfo GetProjectInfo(string ProjectID)
40 47
        {
41
            using (ProjectRepository rep = new ProjectRepository(this._MSSQLCONNSTR))
48
            try
42 49
            {
43
                var id2Project = new ID2Controller().GetID2ProjectList();
44
                var project = rep.GetProjectInfo(ProjectID);
50
                using (ProjectRepository rep = new ProjectRepository(this._MSSQLCONNSTR))
51
                {
52
                    var id2Project = new ID2Controller().GetID2ProjectList();
53
                    var project = rep.GetProjectInfo(ProjectID);
45 54

  
46
                var id2 = id2Project.Where(x => x.Name.Equals(project.Code)).FirstOrDefault();
47
                project.ID2Path = id2?.Path ?? null;
48
                project.ID2Info = id2 ?? new ID2ProjectInfo();
55
                    var id2 = id2Project.Where(x => x.Name.Equals(project.Code)).FirstOrDefault();
56
                    project.ID2Path = id2?.Path ?? null;
57
                    project.ID2Info = id2 ?? new ID2ProjectInfo();
49 58

  
50
                return rep.GetProjectInfo(ProjectID);
59
                    return rep.GetProjectInfo(ProjectID);
60
                }
61
            }
62
            catch (Exception ex)
63
            {
64
                throw ex;
51 65
            }
52 66
        }
53 67

  
54 68
        public bool SetProjectData(ProjectInfo projectInfo, List<ID2ProjectInfo> id2ProjectList)
55 69
        {
56
            using (ProjectRepository rep = new ProjectRepository(this._MSSQLCONNSTR))
70
            try
57 71
            {
58
                return rep.SetProjectData(projectInfo, id2ProjectList);
72
                using (ProjectRepository rep = new ProjectRepository(this._MSSQLCONNSTR))
73
                {
74
                    return rep.SetProjectData(projectInfo, id2ProjectList);
75
                }
76
            }
77
            catch (Exception ex)
78
            {
79
                throw ex;
59 80
            }
60 81
        }
61 82

  
62 83
        public bool SetProjectGroupData(ProjectInfo projectInfo)
63 84
        {
64
            using (ProjectRepository rep = new ProjectRepository(this._MSSQLCONNSTR))
85
            try
86
            {
87
                using (ProjectRepository rep = new ProjectRepository(this._MSSQLCONNSTR))
88
                {
89
                    return rep.SetProjectGroupData(projectInfo);
90
                }
91
            }
92
            catch (Exception ex)
65 93
            {
66
                return rep.SetProjectGroupData(projectInfo);
94
                throw ex;
67 95
            }
68 96
        }
69 97
    }
ID2.Manager/ID2.Manager.Controller/Controllers/UserController.cs
14 14
    {
15 15
        public IEnumerable<UserInfo> GetAllUserInfo()
16 16
        {
17
            IEnumerable<UserInfo> ret = null;
18

  
19 17
            try
20 18
            {
21 19
                using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR))
22 20
                {
23
                    ret = rep.GetAllUserInfo();
21
                    return rep.GetAllUserInfo();
24 22
                }
25 23
            }
26 24
            catch (Exception ex)
27 25
            {
28 26
                throw ex;
29 27
            }
30

  
31
            return ret;
32 28
        }
33 29

  
34 30
        public UserInfo GetUserInfo(string userId, string userPW)
35 31
        {
36
            UserInfo ret = null;
37

  
38 32
            try
39 33
            {
40 34
                using (UserRepository rep = new UserRepository(this._MSSQLCONNSTR))
41 35
                {
42
                    ret = rep.GetUserInfo(userId, userPW);
36
                    return rep.GetUserInfo(userId, userPW);
43 37
                }
44 38
            }
45 39
            catch (Exception ex)
46 40
            {
47 41
                throw ex;
48 42
            }
49

  
50
            return ret;
51 43
        }
52 44

  
53 45
        public bool SetUserInfo(UserInfo userInfo)
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs
18 18

  
19 19
        public IEnumerable<Documents> GetAllDocuments()
20 20
        {
21
            string query = $@"
21
            try
22
            {
23
                string query = $@"
22 24
select   doc.*
23 25
from     dbo.Documents doc
24 26
where    doc.IsDeleted=0
25 27
order by doc.Seq;";
26
            return Query<Documents>(query);
28
                return Query<Documents>(query);
29
            }
30
            catch (Exception ex)
31
            {
32
                throw ex;
33
            }
27 34
        }
28 35

  
29 36
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
......
94 101
                parameters.Add("ClientIsResult", clientIsResult);
95 102
            }
96 103

  
97
            string query = $@"
104
            try
105
            {
106
                string query = $@"
98 107
select   doc.*, datediff(SECOND, doc.ID2StartDate, doc.ID2EndDate) as ID2JobTime,
99 108

  
100 109
  (
......
109 118
select @Total=count(*) from dbo.Documents
110 119
select @Total;";
111 120

  
112
            if (parameters.Count > 0)
113
            {
114
                dynamicParameters.AddDynamicParams(parameters);
115
            }
121
                if (parameters.Count > 0)
122
                {
123
                    dynamicParameters.AddDynamicParams(parameters);
124
                }
116 125

  
117
            var ret = Query<Documents>(query, dynamicParameters);
126
                var ret = Query<Documents>(query, dynamicParameters);
118 127

  
119
            int totalCount = dynamicParameters.Get<int>("Total");
128
                int totalCount = dynamicParameters.Get<int>("Total");
120 129

  
121
            return (ret, totalCount);
130
                return (ret, totalCount);
131
            }
132
            catch (Exception ex)
133
            {
134
                throw ex;
135
            }
122 136
        }
123 137

  
124 138
        public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList, string userId)
......
436 450
        //ID2
437 451
        public IEnumerable<ID2Drawings> GetID2DrawingsByProject(ID2ProjectInfo id2Info)
438 452
        {
439
            string query = $@"
453
            try
454
            {
455
                string query = $@"
440 456
select @Name PROJECTNAME
441 457
      ,dw.[UID], dw.[NAME], left(dw.[NAME], len(dw.[NAME]) - dw.lastidx) DOCNAME
442 458
      ,case when rtrim(ltrim(isnull(convert(varchar, dw.[DATETIME]),''))) = '' then null else convert(datetime, convert(varchar, dw.[DATETIME])) end [DATETIME]
......
446 462
    select [UID], [NAME], [DATETIME], OCCUPIED, [Image], charindex('.', reverse([NAME])) lastidx
447 463
    from   dbo.Drawings
448 464
) dw;";
449
            return Query<ID2Drawings>(query, id2Info);
465
                return Query<ID2Drawings>(query, id2Info);
466
            }
467
            catch (Exception ex)
468
            {
469
                throw ex;
470
            }
450 471
        }
451 472
    }
452 473
}
ID2.Manager/ID2.Manager.Dapper/Repository/FileRepository.cs
14 14

  
15 15
        public IEnumerable<FileInfo> GetFileList(string documentID)
16 16
        {
17
            string query = $@"
17
            try
18
            {
19
                string query = $@"
18 20
select * from dbo.Files where RefDocID=@documentID order by CreatedDate";
19

  
20
            return Query<FileInfo>(query, new { documentID });
21
                return Query<FileInfo>(query, new { documentID });
22
            }
23
            catch (Exception ex)
24
            {
25
                throw ex;
26
            }
21 27
        }
22 28

  
23 29
        public bool SetFileInfo(List<FileInfo> fileList)
ID2.Manager/ID2.Manager.Dapper/Repository/ID2Repository.cs
41 41

  
42 42
                results = Query<ID2ProjectInfo>(query);
43 43
            }
44
            catch
44
            catch (Exception ex)
45 45
            {
46
                results = new List<ID2ProjectInfo>();
46
                throw ex;
47
                //results = new List<ID2ProjectInfo>();//이걸 앞쪽으로 빼기
47 48
            }
48 49

  
49 50
            return results;
ID2.Manager/ID2.Manager.Dapper/Repository/ProjectRepository.cs
14 14

  
15 15
        public IEnumerable<ProjectInfo> GetAllProjectList()
16 16
        {
17
            string query = $@"
17
            try
18
            {
19
                string query = $@"
18 20
;with Prj as
19 21
(
20 22
    select ProjectID
......
43 45
from   prj
44 46
order  by [Level], [Name];";
45 47

  
46
            return Query<ProjectInfo>(query);
48
                return Query<ProjectInfo>(query);
49
            }
50
            catch (Exception ex)
51
            {
52
                throw ex;
53
            }
47 54
        }
48 55

  
49 56
        public ProjectInfo GetProjectInfo(string ProjectID)
50 57
        {
51
            string query = $@"
58
            try
59
            {
60
                string query = $@"
52 61
;with Prj as
53 62
(
54 63
    select ProjectID
......
77 86
from   prj
78 87
where  ProjectID=@ProjectID";
79 88

  
80
            return Query<ProjectInfo>(query, new { ProjectID }).FirstOrDefault();
89
                return Query<ProjectInfo>(query, new { ProjectID }).FirstOrDefault();
90
            }
91
            catch (Exception ex)
92
            {
93
                throw ex;
94
            }
81 95
        }
82 96

  
83 97
        public bool SetProjectData(ProjectInfo projectInfo, List<ID2ProjectInfo> id2ProjectList)
ID2.Manager/ID2.Manager.Dapper/Repository/UserRepository.cs
14 14

  
15 15
        public IEnumerable<UserInfo> GetAllUserInfo()
16 16
        {
17
            string query = $@"select * from dbo.Users order by [Name]";
17
            try
18
            {
19
                string query = $@"select * from dbo.Users order by [Name]";
18 20

  
19
            return Query<UserInfo>(query);
21
                return Query<UserInfo>(query);
22
            }
23
            catch (Exception ex)
24
            {
25
                throw ex;
26
            }
20 27
        }
21 28

  
22 29
        public UserInfo GetUserInfo(string userId, string userPW)
23 30
        {
24
            string query = $@"select * from dbo.Users where ID=@userId and Password=@userPW";
31
            try
32
            {
33
                string query = $@"select * from dbo.Users where ID=@userId and Password=@userPW";
25 34

  
26
            return Query<UserInfo>(query, new { userId, userPW }).FirstOrDefault();
35
                return Query<UserInfo>(query, new { userId, userPW }).FirstOrDefault();
36
            }
37
            catch (Exception ex)
38
            {
39
                throw ex;
40
            }
27 41
        }
28 42

  
29 43
        public bool SetUserInfo(UserInfo userInfo, DMLType dmlType)

내보내기 Unified diff

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