hytos / ID2.Manager / ID2.Manager.Controller / Controllers / DocumentController.cs @ 00d11333
이력 | 보기 | 이력해설 | 다운로드 (6.72 KB)
1 | 5898479a | yoush97 | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Linq; |
||
4 | using System.Text; |
||
5 | using System.Threading.Tasks; |
||
6 | |||
7 | fe57f64a | yoush97 | using ID2.Manager.Dapper; |
8 | 5898479a | yoush97 | using ID2.Manager.Data.Models; |
9 | using ID2.Manager.Dapper.Repository; |
||
10 | |||
11 | namespace ID2.Manager.Controller.Controllers |
||
12 | { |
||
13 | public class DocumentController : BaseController |
||
14 | { |
||
15 | 91e72bfe | yoush97 | public DocumentController() : base() { } |
16 | fe57f64a | yoush97 | |
17 | public DocumentController(ID2ProjectInfo id2Info) : base(id2Info) { } |
||
18 | |||
19 | 296ffcbd | yoush97 | public IEnumerable<Documents> GetAllDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult) |
20 | 5898479a | yoush97 | { |
21 | fe57f64a | yoush97 | using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR)) |
22 | 5898479a | yoush97 | { |
23 | 296ffcbd | yoush97 | return rep.GetAllDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult); |
24 | 5898479a | yoush97 | } |
25 | } |
||
26 | 709c1971 | yoush97 | |
27 | 296ffcbd | yoush97 | public IEnumerable<Documents> GetAllDocuments(List<ID2ProjectInfo> id2Infos, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult) |
28 | fe57f64a | yoush97 | { |
29 | 296ffcbd | yoush97 | IEnumerable<Documents> docs = this.GetAllDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult); |
30 | fe57f64a | yoush97 | List<ID2Drawings> id2docs = null; |
31 | |||
32 | if (id2Infos.Any()) |
||
33 | { |
||
34 | id2docs = new List<ID2Drawings>(); |
||
35 | id2Infos.ForEach(x => |
||
36 | { |
||
37 | id2docs.AddRange(new DocumentController(x).GetID2DrawingsByProject(x)); |
||
38 | }); |
||
39 | } |
||
40 | |||
41 | if (docs != null && id2docs != null && docs.Any() && id2docs.Any()) |
||
42 | { |
||
43 | var result = from doc in docs |
||
44 | join id2 in id2docs on new { projCd = doc.RefProjectCode, DocNo = doc.DocumentNo } equals new { projCd = id2.PROJECTNAME, DocNo = id2.DOCNAME } into gj |
||
45 | from dw in gj.DefaultIfEmpty() |
||
46 | select new Documents() |
||
47 | { |
||
48 | Seq = doc.Seq, |
||
49 | DocID = doc.DocID, |
||
50 | DocumentNo = doc.DocumentNo, |
||
51 | RevisonNo = doc.RevisonNo, |
||
52 | RefProjectCode = doc.RefProjectCode, |
||
53 | IsLatest = doc.IsLatest, |
||
54 | AutoCADFilie = doc.AutoCADFilie, |
||
55 | PDFFile = doc.PDFFile, |
||
56 | MarkupLink = doc.MarkupLink, |
||
57 | AVEVALink = doc.AVEVALink, |
||
58 | DocFilePath = doc.DocFilePath, |
||
59 | DocFileName = doc.DocFileName, |
||
60 | JobLevel = doc.JobLevel, |
||
61 | IsTypical = doc.IsTypical, |
||
62 | PersonInCharge = doc.PersonInCharge, |
||
63 | IsDeleted = doc.IsDeleted, |
||
64 | RegisteredDate = doc.RegisteredDate, |
||
65 | ModifiedDate = doc.ModifiedDate, |
||
66 | DeletedDate = doc.DeletedDate, |
||
67 | ToIsDiscussion = doc.ToIsDiscussion, |
||
68 | ToRemarks = doc.ToRemarks, |
||
69 | ToCreator = doc.ToCreator, |
||
70 | 00d11333 | yoush97 | ToCapture = doc.ToCapture, |
71 | fe57f64a | yoush97 | ToIsMarkup = doc.ToIsMarkup, |
72 | FrReviewStatus = doc.FrReviewStatus, |
||
73 | FrRemarks = doc.FrRemarks, |
||
74 | FrCreator = doc.FrCreator, |
||
75 | 00d11333 | yoush97 | FrCapture = doc.FrCapture, |
76 | fe57f64a | yoush97 | FrIsMarkup = doc.FrIsMarkup, |
77 | IsID2Work = doc.IsID2Work, |
||
78 | ID2Connection = doc.ID2Connection, |
||
79 | ID2StartDate = doc.ID2StartDate, |
||
80 | ID2EndDate = dw?.DATETIME == null ? (DateTime?)null : Convert.ToDateTime(dw?.DATETIME), |
||
81 | ID2JobTime = doc.ID2JobTime, |
||
82 | ID2Status = doc.ID2Status, |
||
83 | ID2Issues = doc.ID2Issues, |
||
84 | AVEVAConnection = doc.AVEVAConnection, |
||
85 | AVEVAConvertDate = doc.AVEVAConvertDate, |
||
86 | AVEVAReviewDate = doc.AVEVAReviewDate, |
||
87 | AVEVAStatus = doc.AVEVAStatus, |
||
88 | AVEVAIssues = doc.AVEVAIssues, |
||
89 | ReviewFilePath = doc.ReviewFilePath, |
||
90 | ReviewFileName = doc.ReviewFileName, |
||
91 | ProdReviewer = doc.ProdReviewer, |
||
92 | ProdIsResult = doc.ProdIsResult, |
||
93 | ProdRemarks = doc.ProdRemarks, |
||
94 | ClientReviewer = doc.ClientReviewer, |
||
95 | ClientIsResult = doc.ClientIsResult, |
||
96 | ClientRemarks = doc.ClientRemarks, |
||
97 | DTIsGateWay = doc.DTIsGateWay, |
||
98 | DTIsImport = doc.DTIsImport, |
||
99 | DTIsRegSystem = doc.DTIsRegSystem, |
||
100 | DTRemarks = doc.DTRemarks, |
||
101 | MarkupText = doc.MarkupText |
||
102 | }; |
||
103 | |||
104 | return result; |
||
105 | |||
106 | } |
||
107 | return docs; |
||
108 | } |
||
109 | |||
110 | 709c1971 | yoush97 | public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList) |
111 | { |
||
112 | fe57f64a | yoush97 | using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR)) |
113 | 709c1971 | yoush97 | { |
114 | return rep.SetDocumentData(docList, delDocList); |
||
115 | } |
||
116 | } |
||
117 | 978488b0 | yoush97 | |
118 | public Documents SetDocumentDataField(Documents doc, string userId) |
||
119 | { |
||
120 | fe57f64a | yoush97 | using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR)) |
121 | 978488b0 | yoush97 | { |
122 | return rep.SetDocumentDataField(doc, userId); |
||
123 | } |
||
124 | } |
||
125 | fe57f64a | yoush97 | |
126 | |||
127 | //ID2 |
||
128 | public IEnumerable<ID2Drawings> GetID2DrawingsByProject(ID2ProjectInfo id2Info) |
||
129 | { |
||
130 | using (DocumentRepository rep = new DocumentRepository(this._ID2CONNSTR)) |
||
131 | { |
||
132 | return rep.GetID2DrawingsByProject(id2Info); |
||
133 | } |
||
134 | } |
||
135 | 5898479a | yoush97 | } |
136 | } |