markus / KCOM / Events / Save.cs @ 959b3ef2
이력 | 보기 | 이력해설 | 다운로드 (5.52 KB)
1 | 787a4489 | KangIngu | using IKCOM; |
---|---|---|---|
2 | using KCOM.Common; |
||
3 | using KCOMDataModel.Common; |
||
4 | using KCOMDataModel.DataModel; |
||
5 | using MarkupToPDF.Common; |
||
6 | using MarkupToPDF.Controls.Parsing; |
||
7 | using System; |
||
8 | using System.Collections.Generic; |
||
9 | using System.Linq; |
||
10 | using System.Text; |
||
11 | using System.Windows.Controls; |
||
12 | |||
13 | namespace KCOM.Events |
||
14 | { |
||
15 | public class Save |
||
16 | { |
||
17 | #region Properties |
||
18 | |||
19 | public ViewInfo _ViewInfo; |
||
20 | public string Project_No |
||
21 | { |
||
22 | get; |
||
23 | set; |
||
24 | } |
||
25 | public string document_id |
||
26 | { |
||
27 | get; |
||
28 | set; |
||
29 | } |
||
30 | |||
31 | public string user_id |
||
32 | { |
||
33 | get; |
||
34 | set; |
||
35 | } |
||
36 | |||
37 | public int page_no |
||
38 | { |
||
39 | get; |
||
40 | set; |
||
41 | } |
||
42 | #endregion |
||
43 | |||
44 | |||
45 | |||
46 | //GUID생성(최민수 사원 수정) //조장원 대리 다시 변경 |
||
47 | public static string shortGuid() |
||
48 | { |
||
49 | byte[] bytes = new byte[16]; |
||
50 | using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create()) |
||
51 | { |
||
52 | provider.GetBytes(bytes); |
||
53 | } |
||
54 | |||
55 | var guid = new Guid(bytes); |
||
56 | |||
57 | return Convert.ToBase64String(guid.ToByteArray()) |
||
58 | .Substring(0, 10) |
||
59 | .Replace("/", "") |
||
60 | .Replace("+", "") + DateTime.UtcNow.Ticks.ToString("x"); |
||
61 | } |
||
62 | |||
63 | //조장원 네자리 |
||
64 | public static string shortCommentKey() |
||
65 | { |
||
66 | byte[] bytes = new byte[3]; |
||
67 | using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create()) |
||
68 | { |
||
69 | provider.GetBytes(bytes); |
||
70 | } |
||
71 | |||
72 | return Convert.ToBase64String(bytes); |
||
73 | } |
||
74 | |||
75 | //강인구 추가 |
||
76 | public static string shortFileKey() |
||
77 | { |
||
78 | //byte[] bytes = new byte[3]; |
||
79 | //using (var provider = System.IO.Path.GetRandomFileName()) |
||
80 | //{ |
||
81 | // provider.GetBytes(bytes); |
||
82 | //} |
||
83 | |||
84 | return System.IO.Path.GetRandomFileName(); |
||
85 | } |
||
86 | |||
87 | public void MarkupConsolidate() |
||
88 | { |
||
89 | |||
90 | } |
||
91 | |||
92 | //마크업 저장하기 |
||
93 | cb33ad14 | humkyung | public void MarkupSave(MarkupInfoItem UserState, int iPageNo) |
94 | 787a4489 | KangIngu | { |
95 | 6c781c0c | djkim | try |
96 | 787a4489 | KangIngu | { |
97 | 6c781c0c | djkim | List<MARKUP_DATA> ml_markupdata = new List<MARKUP_DATA>(); |
98 | 787a4489 | KangIngu | |
99 | cb33ad14 | humkyung | ///ViewerDataModel.Instance.MarkupList_USER.Where(d => d.MarkupInfoID == UserState.MarkupInfoID).ToList().GroupBy(p => p.ID).Select(g => g.First()).ToList().ForEach(value => |
100 | ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == UserState.MarkupInfoID).ToList().GroupBy(p => p.CommentID).Select(g => g.First()).ToList().ForEach(value => |
||
101 | 787a4489 | KangIngu | { |
102 | cb33ad14 | humkyung | ml_markupdata.Add(value.GetMarkupData(App.ViewInfo.UserID, iPageNo, UserState.MarkupVersionID)); |
103 | 6c781c0c | djkim | }); |
104 | 787a4489 | KangIngu | |
105 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetMarkupDataListperPage: ", UserState + "," + Project_No + "," + document_id + "," + user_id + "," + ml_markupdata, 1); |
106 | Logger.sendResLog("GetMarkupDataListperPage", Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveMarkupData(UserState, Project_No, document_id, user_id, ml_markupdata).ToString(), 1); |
||
107 | a20d338f | ljiyeon | TempFile.Remove(); //임시파일삭제 |
108 | 787a4489 | KangIngu | } |
109 | 6c781c0c | djkim | catch (Exception) |
110 | { |
||
111 | throw; |
||
112 | } |
||
113 | 787a4489 | KangIngu | } |
114 | |||
115 | public void SymbolSave(string Name, string Url, string Data) |
||
116 | { |
||
117 | 6c781c0c | djkim | try |
118 | 787a4489 | KangIngu | { |
119 | SYMBOL_PRIVATE symbol_private = new SYMBOL_PRIVATE |
||
120 | { |
||
121 | ID = shortGuid(), |
||
122 | MEMBER_USER_ID = App.ViewInfo.UserID, |
||
123 | NAME = Name, |
||
124 | IMAGE_URL = Url, |
||
125 | DATA = Data |
||
126 | }; |
||
127 | 0f065e57 | ljiyeon | |
128 | Logger.sendReqLog("SaveSymbolAsync: ", symbol_private.ID + "," + symbol_private.MEMBER_USER_ID + "," + symbol_private.NAME + "," + symbol_private.IMAGE_URL + "," + symbol_private.DATA, 1); |
||
129 | 6c781c0c | djkim | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveSymbolAsync(symbol_private); |
130 | } |
||
131 | catch(Exception) |
||
132 | { |
||
133 | throw; |
||
134 | } |
||
135 | } |
||
136 | 498f0fc9 | ljiyeon | public void SymbolSave_Public(string Name, string Url, string Data, string Department) |
137 | { |
||
138 | try |
||
139 | { |
||
140 | SYMBOL_PUBLIC symbol_public = new SYMBOL_PUBLIC |
||
141 | { |
||
142 | ID = shortGuid(), |
||
143 | DEPARTMENT = Department, |
||
144 | NAME = Name, |
||
145 | IMAGE_URL = Url, |
||
146 | DATA = Data |
||
147 | }; |
||
148 | 787a4489 | KangIngu | |
149 | 498f0fc9 | ljiyeon | Logger.sendReqLog("AddPublicSymbol: ", symbol_public.ID + "," + symbol_public.DEPARTMENT + "," + symbol_public.NAME + "," + symbol_public.IMAGE_URL + "," + symbol_public.DATA, 1); |
150 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddPublicSymbol(symbol_public); |
||
151 | } |
||
152 | catch (Exception) |
||
153 | { |
||
154 | throw; |
||
155 | } |
||
156 | } |
||
157 | 6c781c0c | djkim | public void PageAngleSave(string project_no, List<DOCPAGE> _mldocpage) |
158 | { |
||
159 | try |
||
160 | { |
||
161 | 0f065e57 | ljiyeon | |
162 | Logger.sendReqLog("SavePageAngle: ", project_no + "," + _mldocpage, 1); |
||
163 | Logger.sendResLog("SavePageAngle", Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SavePageAngle(project_no, _mldocpage).ToString(), 1); |
||
164 | 2b19f5f2 | djkim | Common.ViewerDataModel.Instance.RotationDocs.Clear(); |
165 | 6c781c0c | djkim | } |
166 | catch (Exception) |
||
167 | { |
||
168 | throw; |
||
169 | 787a4489 | KangIngu | } |
170 | } |
||
171 | } |
||
172 | } |