hytos / ID2.Manager / ID2.Manager.Controller / Controllers / MarkusInfoController.cs @ 00d11333
이력 | 보기 | 이력해설 | 다운로드 (1.62 KB)
1 |
using ID2.Manager.Dapper.Repository; |
---|---|
2 |
using ID2.Manager.Data.Models; |
3 |
using Newtonsoft.Json; |
4 |
using System; |
5 |
using System.Collections.Generic; |
6 |
using System.Linq; |
7 |
using System.Text; |
8 |
using System.Threading.Tasks; |
9 |
|
10 |
namespace ID2.Manager.Controller.Controllers |
11 |
{ |
12 |
public class MarkusInfoController : BaseController |
13 |
{ |
14 |
public IEnumerable<MarkupText> GetMarkupData(IEnumerable<string> ProjectNoList, IEnumerable<string> DocumentNoList) |
15 |
{ |
16 |
IEnumerable<MarkupText> result = null; |
17 |
|
18 |
using (MarkusRepository rep = new MarkusRepository(this._MARKUSCONNSTR)) |
19 |
{ |
20 |
result = rep.GetMarkupText(ProjectNoList, DocumentNoList); |
21 |
} |
22 |
|
23 |
return result; |
24 |
} |
25 |
|
26 |
public bool SetMarkusInfo(List<Documents> docList) |
27 |
{ |
28 |
bool result = false; |
29 |
|
30 |
using (MarkusRepository rep = new MarkusRepository(this._MARKUSCONNSTR)) |
31 |
{ |
32 |
foreach (var item in docList) |
33 |
{ |
34 |
try |
35 |
{ |
36 |
result = rep.Insert(item.RefProjectCode, item.DocumentNo); |
37 |
|
38 |
if (!result) |
39 |
{ |
40 |
throw new Exception($"Insert Item Error."); |
41 |
} |
42 |
} |
43 |
catch (Exception ex) |
44 |
{ |
45 |
result = false; |
46 |
this.Exception = new Exception($"{JsonConvert.SerializeObject(item)}",ex); |
47 |
break; |
48 |
} |
49 |
} |
50 |
} |
51 |
|
52 |
return result; |
53 |
} |
54 |
} |
55 |
} |