개정판 ff990784
issue #0000
- document 저장 성공 시 markus document 저장 하도록 수정
- document no 중복 체크(서버체크)
Change-Id: Id4a5a4f91041447d0080ce8b45e15139a0609a1c
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs | ||
---|---|---|
247 | 247 |
} |
248 | 248 |
} |
249 | 249 |
|
250 |
public int ExistsDocument(string projectGroupID, List<string> newDwgNos) |
|
251 |
{ |
|
252 |
var dynamicParameters = new DynamicParameters(); |
|
253 |
StringBuilder sbWhere = new StringBuilder(); |
|
254 |
var parameters = new Dictionary<string, object>(); |
|
255 |
if (!string.IsNullOrEmpty(projectGroupID)) |
|
256 |
{ |
|
257 |
sbWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID=@RefGroupID) "); |
|
258 |
parameters.Add("RefGroupID", projectGroupID); |
|
259 |
} |
|
260 |
|
|
261 |
if (newDwgNos.Count > 0) |
|
262 |
{ |
|
263 |
string dwgNoList = string.Join("','", newDwgNos.Where(x => !string.IsNullOrEmpty(x)).Select(x => x).ToList()); |
|
264 |
|
|
265 |
if (dwgNoList.Length > 0) |
|
266 |
{ |
|
267 |
if (!string.IsNullOrEmpty(projectGroupID)) |
|
268 |
{ |
|
269 |
sbWhere.Append($@" and doc.DocumentNo in ('{dwgNoList}') "); |
|
270 |
} |
|
271 |
} |
|
272 |
} |
|
273 |
|
|
274 |
try |
|
275 |
{ |
|
276 |
string query = $@" |
|
277 |
select count(*) cnt |
|
278 |
from dbo.Documents doc |
|
279 |
where doc.IsDeleted=0 {sbWhere}"; |
|
280 |
|
|
281 |
if (parameters.Count > 0) |
|
282 |
{ |
|
283 |
dynamicParameters.AddDynamicParams(parameters); |
|
284 |
} |
|
285 |
|
|
286 |
return ExecuteScalar<int>(query, dynamicParameters); |
|
287 |
} |
|
288 |
catch (Exception ex) |
|
289 |
{ |
|
290 |
throw ex; |
|
291 |
} |
|
292 |
} |
|
293 |
|
|
250 | 294 |
public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList, string userId) |
251 | 295 |
{ |
252 | 296 |
bool isSuccess = false; |
내보내기 Unified diff