hytos / ID2.Manager / ID2.Manager.Controller / Controllers / MarkusInfoController.cs @ 81d15568
이력 | 보기 | 이력해설 | 다운로드 (1.21 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 |
|
15 |
public bool SetMarkusInfo(List<Documents> docList) |
16 |
{ |
17 |
bool result = false; |
18 |
|
19 |
using (MarkusRepository rep = new MarkusRepository(this._MarkusConnectionStr)) |
20 |
{ |
21 |
foreach (var item in docList) |
22 |
{ |
23 |
try |
24 |
{ |
25 |
result = rep.Insert(item.Place, item.DocumentNo); |
26 |
|
27 |
if (!result) |
28 |
{ |
29 |
throw new Exception($"Insert Item Error."); |
30 |
} |
31 |
} |
32 |
catch (Exception ex) |
33 |
{ |
34 |
result = false; |
35 |
this.Exception = new Exception($"{JsonConvert.SerializeObject(item)}",ex); |
36 |
break; |
37 |
} |
38 |
} |
39 |
} |
40 |
|
41 |
return result; |
42 |
} |
43 |
} |
44 |
} |