개정판 41fa3d98
issue #1123: docinfo update 수정. ignore true 옵션 추가.
Change-Id: I82f28d36d2485116fc009ec008ccb05ae48cc2ad
ConvertService/ServiceBase/Markus.Service.DataBase/ConvertDatabase.cs | ||
---|---|---|
138 | 138 |
string docId = new Guid().CreateUniqueGuid().ToString(); |
139 | 139 |
|
140 | 140 |
var docinfo = entities.DOCINFO.FirstOrDefault(x => x.PROJECT_NO == convertDoc.PROJECT_NO && x.DOCUMENT_ID == convertDoc.DOCUMENT_ID); |
141 |
|
|
141 |
|
|
142 | 142 |
if (docinfo != null) |
143 | 143 |
{ |
144 |
// 기존 코멘트 유지 |
|
145 |
docId = docinfo.ID; |
|
144 |
// 기존 Docpage 삭제. |
|
146 | 145 |
entities.DOCPAGE.RemoveRange(docinfo.DOCPAGE); |
147 |
entities.DOCINFO.Remove(docinfo); |
|
146 |
|
|
147 |
// 기존 코멘트 유지를 위한 Docinfo update |
|
148 |
docinfo.PROJECT_NO = convertDoc.PROJECT_NO; |
|
149 |
docinfo.ORIGINAL_FILE = convertDoc.DOCUMENT_URL; |
|
150 |
docinfo.PAGE_COUNT = totalPage; |
|
151 |
docinfo.DOCPAGE = pageinfo; |
|
148 | 152 |
entities.SaveChanges(); |
153 |
result = true; |
|
149 | 154 |
} |
150 |
|
|
151 |
DOCINFO instace = new DOCINFO |
|
152 |
{ |
|
153 |
ID = docId, |
|
154 |
PROJECT_NO = convertDoc.PROJECT_NO, |
|
155 |
ORIGINAL_FILE = convertDoc.DOCUMENT_URL, |
|
156 |
DOCUMENT_ID = convertDoc.DOCUMENT_ID, |
|
157 |
PAGE_COUNT = totalPage, |
|
158 |
DOCPAGE = pageinfo |
|
159 |
}; |
|
160 |
|
|
161 |
entities.DOCINFO.Add(instace); |
|
162 |
var save = entities.SaveChanges(); |
|
163 |
|
|
164 |
if (save == pageinfo.Count() + 1) |
|
155 |
else |
|
165 | 156 |
{ |
166 |
result = true; |
|
157 |
DOCINFO instace = new DOCINFO |
|
158 |
{ |
|
159 |
ID = docId, |
|
160 |
PROJECT_NO = convertDoc.PROJECT_NO, |
|
161 |
ORIGINAL_FILE = convertDoc.DOCUMENT_URL, |
|
162 |
DOCUMENT_ID = convertDoc.DOCUMENT_ID, |
|
163 |
PAGE_COUNT = totalPage, |
|
164 |
DOCPAGE = pageinfo |
|
165 |
}; |
|
166 |
|
|
167 |
entities.DOCINFO.Add(instace); |
|
168 |
var save = entities.SaveChanges(); |
|
169 |
|
|
170 |
if (save == pageinfo.Count() + 1) |
|
171 |
{ |
|
172 |
result = true; |
|
173 |
} |
|
167 | 174 |
} |
175 |
|
|
176 |
|
|
177 |
|
|
168 | 178 |
} |
169 | 179 |
|
170 | 180 |
return result; |
내보내기 Unified diff