hytos / ID2.Manager / ID2.Manager.Controller / Controllers / MarkusInfoController.cs @ 4a7e4492
이력 | 보기 | 이력해설 | 다운로드 (2.77 KB)
1 | c112c3c3 | taeseongkim | 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 | c7f3eb42 | taeseongkim | //public IEnumerable<MarkupText> GetMarkupData(IEnumerable<string> ProjectNoList, IEnumerable<string> DocumentNoList) |
15 | //{ |
||
16 | // IEnumerable<MarkupText> result = null; |
||
17 | 0b008ea6 | taeseongkim | |
18 | c7f3eb42 | taeseongkim | // using (MarkusRepository rep = new MarkusRepository(this._MARKUSCONNSTR)) |
19 | // { |
||
20 | // result = rep.GetMarkupText(ProjectNoList, DocumentNoList); |
||
21 | // } |
||
22 | 0b008ea6 | taeseongkim | |
23 | c7f3eb42 | taeseongkim | // return result; |
24 | //} |
||
25 | c112c3c3 | taeseongkim | |
26 | public bool SetMarkusInfo(List<Documents> docList) |
||
27 | { |
||
28 | bool result = false; |
||
29 | |||
30 | fe57f64a | yoush97 | using (MarkusRepository rep = new MarkusRepository(this._MARKUSCONNSTR)) |
31 | c112c3c3 | taeseongkim | { |
32 | foreach (var item in docList) |
||
33 | { |
||
34 | try |
||
35 | { |
||
36 | 6c3bdda6 | yoush97 | result = rep.Insert(item.RefProjectCode, item.DocumentNo); |
37 | c112c3c3 | taeseongkim | |
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 | 5b086e44 | taeseongkim | |
55 | public bool SetMembers(IEnumerable<UserInfo> users) |
||
56 | { |
||
57 | bool result = false; |
||
58 | |||
59 | try |
||
60 | { |
||
61 | using (MarkusRepository rep = new MarkusRepository(this._MARKUSCONNSTR)) |
||
62 | { |
||
63 | foreach (var user in users) |
||
64 | { |
||
65 | rep.InsertOrUpdateUsers(new Dapper.Entities.MEMBER |
||
66 | { |
||
67 | ID = user.ID, |
||
68 | NAME = user.Name, |
||
69 | DEPARTMENT = "SAMSUNG ELEC", |
||
70 | POSITION = user.Role, |
||
71 | EMAIL_ADDRESS = user.ID, |
||
72 | PASSWORD = "", |
||
73 | COMPANY = "SAMSUNG ELEC", |
||
74 | CREATE_DATETIME = DateTime.Now, |
||
75 | MODIFIED_DATETIME = DateTime.Now, |
||
76 | ISLICENSE = 1 |
||
77 | }); |
||
78 | } |
||
79 | |||
80 | result = true; |
||
81 | } |
||
82 | } |
||
83 | catch (Exception) |
||
84 | { |
||
85 | throw; |
||
86 | } |
||
87 | |||
88 | return result; |
||
89 | } |
||
90 | c112c3c3 | taeseongkim | } |
91 | } |