markus / KCOM / Services / BaseServices.cs @ bb3a236d
이력 | 보기 | 이력해설 | 다운로드 (40.8 KB)
1 | 787a4489 | KangIngu | using Microsoft.AspNet.SignalR.Client; |
---|---|---|---|
2 | using IKCOM; |
||
3 | using KCOM.Common; |
||
4 | using KCOM.ServiceDeepView; |
||
5 | using KCOMDataModel.DataModel; |
||
6 | using Newtonsoft.Json; |
||
7 | using RestSharp; |
||
8 | using System; |
||
9 | using System.Collections.Generic; |
||
10 | using System.Collections.ObjectModel; |
||
11 | using System.ComponentModel; |
||
12 | using System.Linq; |
||
13 | using System.Runtime.CompilerServices; |
||
14 | using System.Text; |
||
15 | using System.Windows; |
||
16 | using System.Windows.Controls; |
||
17 | using Telerik.Windows.Controls; |
||
18 | 036650a0 | humkyung | using MarkupToPDF.Controls.Parsing; |
19 | 787a4489 | KangIngu | |
20 | namespace KCOM.Views |
||
21 | { |
||
22 | public partial class MainMenu : UserControl, INotifyPropertyChanged |
||
23 | 29010418 | ljiyeon | { |
24 | 787a4489 | KangIngu | const string DeepZoomUrl = @"http://{baseUrl}/TileSource/{TileSourcePath}/{ItemsPath}/{SharepointItemID}/{PageNo}.jpg"; |
25 | public ServiceDeepViewClient BaseClient; |
||
26 | public ViewInfo _ViewInfo; |
||
27 | public DOCINFO _DocInfo; |
||
28 | public DOCUMENT_ITEM _DocItem; |
||
29 | public MEMBER userData; |
||
30 | |||
31 | public event PropertyChangedEventHandler PropertyChanged; |
||
32 | private void NotifyPropertyChanged([CallerMemberName] String propertyName = "") |
||
33 | { |
||
34 | if (PropertyChanged != null) |
||
35 | { |
||
36 | PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
||
37 | } |
||
38 | } |
||
39 | |||
40 | private Common.DocumentSet _CurrentDoc { get; set; } |
||
41 | public Common.DocumentSet CurrentDoc |
||
42 | { |
||
43 | get |
||
44 | { |
||
45 | return _CurrentDoc; |
||
46 | } |
||
47 | set |
||
48 | { |
||
49 | if (value != CurrentDoc) |
||
50 | { |
||
51 | _CurrentDoc = value; |
||
52 | NotifyPropertyChanged(); |
||
53 | } |
||
54 | } |
||
55 | } |
||
56 | public void ServiceOn() |
||
57 | { |
||
58 | 29010418 | ljiyeon | BaseClient = new ServiceDeepViewClient(App._binding, App._EndPoint); |
59 | |||
60 | 787a4489 | KangIngu | BaseClient.GetDocInfoCompleted += BaseClient_GetDocInfoCompleted; //문서 섬네일, 페이지크기, 마크업 정보 [3] |
61 | 0f065e57 | ljiyeon | BaseClient.GetConversionStateCompleted += BaseClient_GetConversionStateCompleted; //컨버팅의 여부 [2] |
62 | BaseClient.GetSystemDataCompleted += BaseClient_GetSystemDataCompleted; //시스템 정보 [1] |
||
63 | 787a4489 | KangIngu | BaseClient.GetDocumentItemInfoCompleted += BaseClient_GetDocumentItemInfoCompleted; // 문서 자체의 정보 [4] |
64 | 29010418 | ljiyeon | BaseClient.GetMarkupInfoItemsCompleted += BaseClient_GetMarkupInfoItemsCompleted; |
65 | BaseClient.GetDeptDataCompleted += BaseClient_GetDeptDataCompleted; |
||
66 | BaseClient.DeleteMarkupCompleted += BaseClient_DeleteMarkupCompleted; |
||
67 | 787a4489 | KangIngu | BaseClient.GetVPRevisionHistoryCompleted += BaseClient_GetVPRevisionHistoryCompleted; |
68 | 29010418 | ljiyeon | BaseClient.SetFinalPDFCompleted += BaseClient_SetFinalPDFCompleted; |
69 | BaseClient.GetCompareRectCompleted += BaseClient_GetCompareRectCompleted; |
||
70 | BaseClient.DeleteMarkupCompleted += BaseClient_DeleteMarkupCompleted; |
||
71 | BaseClient.DelFavoriteVPCompleted += BaseClient_DelFavoriteVPCompleted; |
||
72 | BaseClient.EditFavoriteVPCompleted += BaseClient_EditFavoriteVPCompleted; |
||
73 | 992a98b4 | KangIngu | } |
74 | |||
75 | 29010418 | ljiyeon | |
76 | 992a98b4 | KangIngu | |
77 | private void BaseClient_EditFavoriteVPCompleted(object sender, EditFavoriteVPCompletedEventArgs e) |
||
78 | { |
||
79 | 0f065e57 | ljiyeon | Logger.sendResLog("EditFavoriteVPCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
80 | |||
81 | 53880c83 | ljiyeon | if (e.Error == null && e.Result != false) |
82 | 992a98b4 | KangIngu | { |
83 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetFavoriteVPAsync", App.ViewInfo.ProjectNO + "," + App.ViewInfo.UserID + "," + App.ViewInfo.DocumentItemID, 1); |
84 | 992a98b4 | KangIngu | BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
85 | } |
||
86 | else |
||
87 | { |
||
88 | DialogMessage_Alert("Unable to delete the file due to a system failure", "Warning"); |
||
89 | } |
||
90 | } |
||
91 | |||
92 | private void BaseClient_DelFavoriteVPCompleted(object sender, DelFavoriteVPCompletedEventArgs e) |
||
93 | { |
||
94 | 0f065e57 | ljiyeon | Logger.sendResLog("DelFavoriteVPCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
95 | |||
96 | 53880c83 | ljiyeon | if (e.Error == null && e.Result != false) |
97 | 992a98b4 | KangIngu | { |
98 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetFavoriteVPAsync", App.ViewInfo.ProjectNO + "," + App.ViewInfo.UserID + "," + App.ViewInfo.DocumentItemID, 1); |
99 | 992a98b4 | KangIngu | BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
100 | } |
||
101 | else |
||
102 | { |
||
103 | DialogMessage_Alert("Unable to delete the file due to a system failure", "Warning"); |
||
104 | } |
||
105 | 787a4489 | KangIngu | } |
106 | |||
107 | 992a98b4 | KangIngu | |
108 | 787a4489 | KangIngu | private void BaseClient_GetCompareRectCompleted(object sender, GetCompareRectCompletedEventArgs e) |
109 | { |
||
110 | 0f065e57 | ljiyeon | Logger.sendResLog("GetCompareRectCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
111 | |||
112 | 787a4489 | KangIngu | if (e.Error != null || e.Result == null) |
113 | { |
||
114 | DialogMessage_Alert("Compare 기능을 원활히 실행하기 위한 데이터가 부족합니다", "안내"); |
||
115 | } |
||
116 | else |
||
117 | { |
||
118 | e.Result.ForEach(d => |
||
119 | { |
||
120 | d.Width = d.Width * 3; |
||
121 | d.Height = d.Height * 3; |
||
122 | var point = MarkupToPDF.Controls.Common.MathSet.getRectMiddlePoint(d); |
||
123 | System.Windows.Shapes.Ellipse myEllipse = new System.Windows.Shapes.Ellipse(); |
||
124 | myEllipse.Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Red); |
||
125 | myEllipse.Opacity = 1; |
||
126 | myEllipse.Width = d.Width; |
||
127 | myEllipse.Height = d.Height; |
||
128 | Canvas.SetLeft(myEllipse, d.X - ((point.X - d.X) / 2.0)); |
||
129 | Canvas.SetTop(myEllipse, d.Y - ((point.Y - d.Y) / 2.0)); |
||
130 | myEllipse.RenderTransformOrigin = point; |
||
131 | canvas_compareBorder.Children.Add(myEllipse); |
||
132 | }); |
||
133 | |||
134 | da.From = 0.8; |
||
135 | da.To = 0; |
||
136 | da.Duration = new Duration(TimeSpan.FromSeconds(1)); |
||
137 | da.AutoReverse = true; |
||
138 | canvas_compareBorder.BeginAnimation(OpacityProperty, da); |
||
139 | } |
||
140 | } |
||
141 | |||
142 | private void BaseClient_SetFinalPDFCompleted(object sender, SetFinalPDFCompletedEventArgs e) |
||
143 | { |
||
144 | 0f065e57 | ljiyeon | Logger.sendResLog("SetFinalPDFCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
145 | 787a4489 | KangIngu | |
146 | 29010418 | ljiyeon | if (e.Error != null || e.Result.Status == FinalStatus.Error) |
147 | 787a4489 | KangIngu | { |
148 | DialogMessage_Alert("최종 파일을 만드는데 문제가 발생하였습니다", "안내"); |
||
149 | } |
||
150 | else |
||
151 | { |
||
152 | 992a98b4 | KangIngu | DialogMessage_Alert("최종 파일 생성 중입니다. 문서관리시스템을 확인해주세요", "안내"); |
153 | 787a4489 | KangIngu | } |
154 | } |
||
155 | |||
156 | private void BaseClient_GetVPRevisionHistoryCompleted(object sender, GetVPRevisionHistoryCompletedEventArgs e) |
||
157 | { |
||
158 | 0f065e57 | ljiyeon | Logger.sendResLog("GetVPRevisionHistoryCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
159 | |||
160 | 787a4489 | KangIngu | if (e.Result != null && e.Error == null) |
161 | { |
||
162 | gridViewHistory.ItemsSource = e.Result; |
||
163 | } |
||
164 | 3b484ebb | ljiyeon | TempFile.TempLoad(); |
165 | 787a4489 | KangIngu | } |
166 | |||
167 | private void BaseClient_DeleteMarkupCompleted(object sender, DeleteMarkupCompletedEventArgs e) |
||
168 | { |
||
169 | 0f065e57 | ljiyeon | Logger.sendResLog("DeleteMarkupCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
170 | |||
171 | 787a4489 | KangIngu | SetDisplayColor(ViewerDataModel.Instance._markupInfoList.ToList(), App.ViewInfo.UserID); |
172 | } |
||
173 | |||
174 | private void BaseClient_GetDeptDataCompleted(object sender, GetDeptDataCompletedEventArgs e) |
||
175 | { |
||
176 | 0f065e57 | ljiyeon | Logger.sendResLog("GetDeptDataCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
177 | |||
178 | 787a4489 | KangIngu | if (e.Result != null) |
179 | { |
||
180 | e.Result.Sort(); |
||
181 | //cbSymbolPublic.ItemsSource = e.Result.ToList(); |
||
182 | } |
||
183 | } |
||
184 | 29010418 | ljiyeon | public MarkupInfoItem PreviewUserMarkupInfoItem { get; set; } |
185 | 787a4489 | KangIngu | |
186 | 35a96e24 | humkyung | /// <summary> |
187 | /// get markupinfo and markupitem from database |
||
188 | /// </summary> |
||
189 | /// <param name="sender"></param> |
||
190 | /// <param name="e"></param> |
||
191 | 787a4489 | KangIngu | private void BaseClient_GetMarkupInfoItemsCompleted(object sender, GetMarkupInfoItemsCompletedEventArgs e) |
192 | { |
||
193 | 0f065e57 | ljiyeon | Logger.sendResLog("GetMarkupInfoItemsCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
194 | |||
195 | 787a4489 | KangIngu | ViewerDataModel.Instance.MarkupControls_USER.Clear(); |
196 | ViewerDataModel.Instance.MarkupControls.Clear(); |
||
197 | if (e.Result != null) |
||
198 | { |
||
199 | var pureItem = e.Result; |
||
200 | 29010418 | ljiyeon | if (pureItem.Count > 0) |
201 | 787a4489 | KangIngu | { |
202 | ViewerDataModel.Instance.MarkupList_USER.Clear(); |
||
203 | } |
||
204 | |||
205 | pureItem.ToList().ForEach(d => d.MarkupList.ForEach(p => |
||
206 | { |
||
207 | 29010418 | ljiyeon | if (d.UserID == App.ViewInfo.UserID) |
208 | 787a4489 | KangIngu | { |
209 | d.userDelete = true; |
||
210 | d.DisplayColor = "#FFFF0000"; |
||
211 | |||
212 | 35a96e24 | humkyung | MarkupItemEx markup = new MarkupItemEx |
213 | 787a4489 | KangIngu | { |
214 | Data = p.Data, |
||
215 | Data_Type = p.Data_Type, |
||
216 | ID = p.ID, |
||
217 | IsUpdate = false, |
||
218 | MarkupInfoID = d.MarkupInfoID, |
||
219 | PageNumber = p.PageNumber, |
||
220 | c8e9b3e4 | ljiyeon | Symbol_ID = p.Symbol_ID, |
221 | 53880c83 | ljiyeon | Group_ID = p.Group_ID |
222 | 35a96e24 | humkyung | }; |
223 | ViewerDataModel.Instance.MarkupList_USER.Add(markup); |
||
224 | |||
225 | var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, d.DisplayColor, "", |
||
226 | d.MarkupInfoID, markup.ID); |
||
227 | control.Visibility = Visibility.Hidden; |
||
228 | 787a4489 | KangIngu | } |
229 | else |
||
230 | { |
||
231 | 35a96e24 | humkyung | MarkupItemEx markup = new MarkupItemEx |
232 | 787a4489 | KangIngu | { |
233 | Data = p.Data, |
||
234 | Data_Type = p.Data_Type, |
||
235 | ID = p.ID, |
||
236 | IsUpdate = false, |
||
237 | MarkupInfoID = d.MarkupInfoID, |
||
238 | PageNumber = p.PageNumber, |
||
239 | c8e9b3e4 | ljiyeon | Symbol_ID = p.Symbol_ID, |
240 | 53880c83 | ljiyeon | Group_ID = p.Group_ID |
241 | 35a96e24 | humkyung | }; |
242 | ViewerDataModel.Instance.MarkupList_Pre.Add(markup); |
||
243 | |||
244 | var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, d.DisplayColor, "", |
||
245 | d.MarkupInfoID, markup.ID); |
||
246 | control.Visibility = Visibility.Hidden; |
||
247 | 787a4489 | KangIngu | } |
248 | })); |
||
249 | |||
250 | var currentUser = e.Result.Where(data => data.UserID == userData.ID).FirstOrDefault(); |
||
251 | if (currentUser == null) |
||
252 | { |
||
253 | 24678e06 | humkyung | var infoId = Commons.shortGuid(); |
254 | 787a4489 | KangIngu | PreviewUserMarkupInfoItem = new MarkupInfoItem |
255 | { |
||
256 | CreateTime = DateTime.Now, |
||
257 | Depatment = userData.DEPARTMENT, |
||
258 | DisplayColor = "#FFFF0000", |
||
259 | UserID = userData.ID, |
||
260 | UserName = userData.NAME, |
||
261 | PageCount = 1, |
||
262 | Description = "", |
||
263 | MarkupInfoID = infoId, |
||
264 | MarkupList = null, |
||
265 | 24678e06 | humkyung | MarkupVersionID = Commons.shortGuid(), |
266 | 787a4489 | KangIngu | Consolidate = 0, |
267 | PartConsolidate = 0, |
||
268 | userDelete = true, |
||
269 | AvoidConsolidate = 0, |
||
270 | IsPreviewUser = true |
||
271 | }; |
||
272 | |||
273 | App.Custom_ViewInfoId = infoId; |
||
274 | } |
||
275 | else |
||
276 | { |
||
277 | App.Custom_ViewInfoId = currentUser.MarkupInfoID; |
||
278 | } |
||
279 | |||
280 | ViewerDataModel.Instance._markupInfoList = SetDisplayColor(pureItem, _ViewInfo.UserID); |
||
281 | |||
282 | 35a96e24 | humkyung | //Consolidation 된 데이터가 최상단에 올 수 있도록 변경 |
283 | var markupItem = ViewerDataModel.Instance._markupInfoList.OrderByDescending(p => p.Consolidate == Convert.ToInt32(true)).ToList(); |
||
284 | 787a4489 | KangIngu | |
285 | markupItem.ForEach(data => |
||
286 | { |
||
287 | 35a96e24 | humkyung | if (data.Depatment == null) data.Depatment = "Unknown"; |
288 | 787a4489 | KangIngu | }); |
289 | gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList; |
||
290 | 29010418 | ljiyeon | SetCommentPages(); |
291 | 992a98b4 | KangIngu | |
292 | var select_item = ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == App.ViewInfo.UserID).OrderByDescending(order => order.Consolidate == Convert.ToInt32(true)).FirstOrDefault(); |
||
293 | this.gridViewMarkup.SelectedItem = select_item; |
||
294 | 787a4489 | KangIngu | } |
295 | } |
||
296 | |||
297 | private void gridViewRevMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) |
||
298 | { |
||
299 | List<MarkupInfoItem> gridSelectionItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
||
300 | //if (ViewerDataModel.Instance.PageBalanceNumber == 0) |
||
301 | //{ |
||
302 | // ViewerDataModel.Instance.PageBalanceNumber = 1; |
||
303 | //} |
||
304 | |||
305 | if (ViewerDataModel.Instance.PageNumber == 0) |
||
306 | { |
||
307 | ViewerDataModel.Instance.PageNumber = 1; |
||
308 | } |
||
309 | if (e.AddedItems.Count() > 0) |
||
310 | { |
||
311 | foreach (var item in gridSelectionItem) |
||
312 | { |
||
313 | //item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageBalanceNumber).ToList().ForEach(delegate (MarkupItem markupitem) |
||
314 | //{ |
||
315 | // layerControl.markupParse(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
||
316 | //}); |
||
317 | item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList().ForEach(delegate (MarkupItem markupitem) |
||
318 | { |
||
319 | 661b7416 | humkyung | MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
320 | 787a4489 | KangIngu | }); |
321 | } |
||
322 | } |
||
323 | else if (e.RemovedItems.Count > 0) |
||
324 | { |
||
325 | var _infoItem = e.RemovedItems.Cast<MarkupInfoItem>().ToList(); |
||
326 | |||
327 | (from A in _infoItem |
||
328 | from B in Common.ViewerDataModel.Instance.MarkupControls_Sync |
||
329 | where A.MarkupInfoID == B.MarkupInfoID |
||
330 | select B).ToList().ForEach(data => |
||
331 | { |
||
332 | Common.ViewerDataModel.Instance.MarkupControls_Sync.Remove(data); |
||
333 | }); |
||
334 | } |
||
335 | } |
||
336 | e7dd7ae8 | humkyung | |
337 | /// <summary> |
||
338 | /// 선택한 항목은 Visibility = Visible, 해제한 항목은 Visibility = Hidden 처리한다. |
||
339 | /// </summary> |
||
340 | /// <param name="sender"></param> |
||
341 | /// <param name="e"></param> |
||
342 | 787a4489 | KangIngu | private void gridViewMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) |
343 | { |
||
344 | var dataSet = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().Where(data => data.UserID == _ViewInfo.UserID); |
||
345 | var dataSet_User = gridViewMarkup.Items.Cast<MarkupInfoItem>().Where(data => data.UserID == _ViewInfo.UserID); |
||
346 | var resultA = (from item_Select in dataSet |
||
347 | from item_Non in dataSet_User |
||
348 | where item_Select == item_Non |
||
349 | select item_Non).ToList(); |
||
350 | |||
351 | if (resultA.Count() >= 2) |
||
352 | { |
||
353 | RadWindow.Confirm(new DialogParameters |
||
354 | { |
||
355 | b9b01f8e | ljiyeon | Owner = Application.Current.MainWindow, |
356 | 787a4489 | KangIngu | Header = "안내", |
357 | Content = "동일한 사용자 데이터가 두개 이상 선택됩니다. Consolidation을 선택할까요?", |
||
358 | Closed = new EventHandler<WindowClosedEventArgs>((sen, ea) => |
||
359 | { |
||
360 | if (e.AddedItems.Count() == 1) |
||
361 | { |
||
362 | MarkupInfoItem instanceItem = e.AddedItems.FirstOrDefault() as MarkupInfoItem; |
||
363 | var result = instanceItem.Consolidate; |
||
364 | |||
365 | if (ea.DialogResult.Value) |
||
366 | { |
||
367 | ConsolidationMethod(); |
||
368 | } |
||
369 | else |
||
370 | { |
||
371 | ((RadGridView)sender).SelectedItem = null; |
||
372 | } |
||
373 | } |
||
374 | }), |
||
375 | Theme = new Windows8Theme(), |
||
376 | ModalBackground = new System.Windows.Media.SolidColorBrush { Color = System.Windows.Media.Colors.Black, Opacity = 0.6 }, |
||
377 | }); |
||
378 | } |
||
379 | else //파라미터로 넘어온 사용자가 걸리지 않은 경우 |
||
380 | { |
||
381 | 6b5d33c6 | djkim | EmptyControlCheck(); |
382 | List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
||
383 | List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
||
384 | List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
||
385 | #region 코멘트 보기 |
||
386 | if (e.AddedItems.Count() > 0) |
||
387 | { |
||
388 | foreach (var item in gridSelectionItem) |
||
389 | { |
||
390 | if ((item.UserID == App.ViewInfo.UserID) && (this.pageNavigator.CurrentPage != null)) |
||
391 | { |
||
392 | 101da246 | humkyung | var controls = Common.ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
393 | if (controls.Count == 0) |
||
394 | 6b5d33c6 | djkim | { |
395 | 101da246 | humkyung | var instance = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
396 | 6b5d33c6 | djkim | foreach (var markup in instance) |
397 | { |
||
398 | 661b7416 | humkyung | MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", |
399 | item.MarkupInfoID, markup.ID); |
||
400 | 6b5d33c6 | djkim | } |
401 | } |
||
402 | 101da246 | humkyung | |
403 | controls = Common.ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
||
404 | foreach (var control in controls) |
||
405 | 6b5d33c6 | djkim | { |
406 | 101da246 | humkyung | control.Visibility = Visibility.Visible; |
407 | 6b5d33c6 | djkim | } |
408 | } |
||
409 | else if (this.pageNavigator.CurrentPage != null) |
||
410 | { |
||
411 | 101da246 | humkyung | var controls = Common.ViewerDataModel.Instance.MarkupControls.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
412 | if (controls.Count == 0) |
||
413 | { |
||
414 | var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
||
415 | foreach (var markup in instance) |
||
416 | { |
||
417 | MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", |
||
418 | item.MarkupInfoID, markup.ID); |
||
419 | } |
||
420 | } |
||
421 | |||
422 | controls = Common.ViewerDataModel.Instance.MarkupControls.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
||
423 | foreach (var control in controls) |
||
424 | 6b5d33c6 | djkim | { |
425 | e7dd7ae8 | humkyung | control.Visibility = Visibility.Visible; |
426 | 6b5d33c6 | djkim | } |
427 | } |
||
428 | } |
||
429 | } |
||
430 | #endregion |
||
431 | #region 코멘트 숨기기 |
||
432 | else if (e.RemovedItems.Count > 0) |
||
433 | { |
||
434 | var _infoItem = e.RemovedItems.Cast<MarkupInfoItem>().ToList(); |
||
435 | |||
436 | (from A in _infoItem |
||
437 | from B in Common.ViewerDataModel.Instance.MarkupControls |
||
438 | where A.MarkupInfoID == B.MarkupInfoID |
||
439 | select B).ToList().ForEach(data => |
||
440 | { |
||
441 | b5ac6d6e | ljiyeon | data.Visibility = Visibility.Hidden; |
442 | 6b5d33c6 | djkim | }); |
443 | |||
444 | b5ac6d6e | ljiyeon | |
445 | 6b5d33c6 | djkim | var myComment = _infoItem.Where(d => d.UserID == App.ViewInfo.UserID).FirstOrDefault(); |
446 | if (myComment != null) |
||
447 | { |
||
448 | ChangeCommentReact(); |
||
449 | b5ac6d6e | ljiyeon | |
450 | 6b5d33c6 | djkim | Common.ViewerDataModel.Instance.MarkupControls_USER.ToList().ForEach(delegate (MarkupToPDF.Common.CommentUserInfo markupitem) |
451 | { |
||
452 | e7dd7ae8 | humkyung | markupitem.Visibility = Visibility.Hidden; |
453 | 6b5d33c6 | djkim | }); |
454 | b5ac6d6e | ljiyeon | |
455 | |||
456 | 6b5d33c6 | djkim | } |
457 | } |
||
458 | #endregion |
||
459 | 787a4489 | KangIngu | } |
460 | } |
||
461 | |||
462 | private static ObservableCollection<MarkupInfoItem> SetDisplayColor(List<MarkupInfoItem> MarkupInfoList, string userID) |
||
463 | { |
||
464 | //var random = new Random(); |
||
465 | ObservableCollection<MarkupInfoItem> _result = new ObservableCollection<MarkupInfoItem>(); |
||
466 | |||
467 | MarkupInfoList.ForEach(delegate (MarkupInfoItem infoitem) |
||
468 | { |
||
469 | if (userID == infoitem.UserID) |
||
470 | { |
||
471 | infoitem.userDelete = true; |
||
472 | infoitem.DisplayColor = "#FFFF0000"; |
||
473 | } |
||
474 | else |
||
475 | { |
||
476 | infoitem.userDelete = false; |
||
477 | |||
478 | #region sample code |
||
479 | |||
480 | //string _ColorStr = "#FF"; |
||
481 | |||
482 | //for (int i = 0; i < infoitem.Depatment.Count(); i++) |
||
483 | //{ |
||
484 | // _ColorStr += Convert.ToByte(infoitem.Depatment[i]); |
||
485 | //} |
||
486 | |||
487 | //if (_ColorStr.Length < 9) |
||
488 | //{ |
||
489 | // for (int i = 0; i < 9 - _ColorStr.Length; i++) |
||
490 | // { |
||
491 | // _ColorStr += "F"; |
||
492 | // } |
||
493 | //} |
||
494 | //else |
||
495 | //{ |
||
496 | // _ColorStr = _ColorStr.Substring(0,9); |
||
497 | //} |
||
498 | //System.Diagnostics.Debug.WriteLine(_ColorStr); |
||
499 | //infoitem.DisplayColor = _ColorStr;// String.Format("#FF{0:X6}", random.Next(0x1000000)); |
||
500 | #endregion |
||
501 | } |
||
502 | |||
503 | _result.Add(infoitem); |
||
504 | }); |
||
505 | |||
506 | return _result; |
||
507 | } |
||
508 | |||
509 | private void BaseClient_GetDocumentItemInfoCompleted(object sender, GetDocumentItemInfoCompletedEventArgs e) |
||
510 | { |
||
511 | 0f065e57 | ljiyeon | Logger.sendResLog("GetDocumentItemInfoCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
512 | |||
513 | 787a4489 | KangIngu | if (e.Result != null) |
514 | { |
||
515 | _DocItem = e.Result; |
||
516 | |||
517 | if (e.Result.DOCUMENT_NO == "" && e.Result.DOCUMENT_NAME == "" && e.Result.GROUP_NO == "0") |
||
518 | { |
||
519 | //장원 |
||
520 | _ViewInfo.UserID = _ViewInfo.UserID.Replace(@"DAELIM\", ""); |
||
521 | } |
||
522 | 29010418 | ljiyeon | Logger.sendReqLog("GetDocInfoAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID, 1); |
523 | 787a4489 | KangIngu | BaseClient.GetDocInfoAsync(new KCOM_BasicParam { projectNo = _ViewInfo.ProjectNO, documentID = _ViewInfo.DocumentItemID }); |
524 | } |
||
525 | else |
||
526 | { |
||
527 | BaseClient.GetCheckSystemAdminCompleted += (sen, ea) => |
||
528 | { |
||
529 | 0f065e57 | ljiyeon | Logger.sendResLog("GetCheckSystemAdminCompleted", "UserState : " + ea.UserState + "\r Result :" + ea.Result + "\r Cancelled :" + ea.Cancelled + "\r Error :" + ea.Error, 1); |
530 | |||
531 | 787a4489 | KangIngu | if (ea.Error == null) |
532 | { |
||
533 | if (ea.Result) |
||
534 | { |
||
535 | this._ViewInfo.isAdmin = true; |
||
536 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetDocInfoAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID, 1); |
537 | 787a4489 | KangIngu | BaseClient.GetDocInfoAsync(new KCOM_BasicParam { projectNo = _ViewInfo.ProjectNO, documentID = _ViewInfo.DocumentItemID }); |
538 | } |
||
539 | else |
||
540 | { |
||
541 | //System.Windows.Forms.MessageBox.Show("해당 프로젝트에 가입되지 않은 유저입니다. 관리자에게 등록신청을 해주세요", "안내"); |
||
542 | DialogMessage_Alert("해당 프로젝트에 가입되지 않은 유저입니다. 관리자에게 등록신청을 해주세요", "안내"); |
||
543 | //this.ParentOfType<MainPage>().DialogMessage_Alert("해당 프로젝트에 가입되지 않은 유저입니다. 관리자에게 등록신청을 해주세요", "안내"); |
||
544 | } |
||
545 | |||
546 | } |
||
547 | else |
||
548 | { |
||
549 | //System.Windows.Browser.HtmlPage.Window.Invoke("close"); |
||
550 | } |
||
551 | }; |
||
552 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetCheckSystemAdminAsync", _ViewInfo.UserID, 1); |
553 | 787a4489 | KangIngu | BaseClient.GetCheckSystemAdminAsync(this._ViewInfo.UserID); |
554 | } |
||
555 | } |
||
556 | |||
557 | private void BaseClient_GetSystemDataCompleted(object sender, GetSystemDataCompletedEventArgs e) |
||
558 | { |
||
559 | 0f065e57 | ljiyeon | Logger.sendResLog("GetSystemDataCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
560 | |||
561 | 787a4489 | KangIngu | if (e.Error == null && e.Result != null) |
562 | { |
||
563 | App.SystemInfo = e.Result; |
||
564 | |||
565 | //App.urlPort_DB = App.SystemInfo.HostPort; |
||
566 | //App.urlHost_DB = App.SystemInfo.HostName; |
||
567 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetConversionStateAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID, 1); |
568 | 787a4489 | KangIngu | BaseClient.GetConversionStateAsync(new KCOM_BasicParam { projectNo = _ViewInfo.ProjectNO, documentID = _ViewInfo.DocumentItemID }); |
569 | |||
570 | //if (App.urlHost.Contains("localhost")) |
||
571 | //{ |
||
572 | // App.urlHost = App.urlHost_DB; |
||
573 | //} |
||
574 | } |
||
575 | } |
||
576 | |||
577 | private void BaseClient_GetConversionStateCompleted(object sender, GetConversionStateCompletedEventArgs e) |
||
578 | { |
||
579 | 0f065e57 | ljiyeon | Logger.sendResLog("GetConversionStateCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
580 | |||
581 | 53880c83 | ljiyeon | if (e.Error == null && e.Result == true) |
582 | 787a4489 | KangIngu | { |
583 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetDocumentItemInfoAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID + "," + _ViewInfo.UserID, 1); |
584 | |||
585 | 787a4489 | KangIngu | BaseClient.GetDocumentItemInfoAsync(new KCOM_BasicParam { projectNo = _ViewInfo.ProjectNO, documentID = _ViewInfo.DocumentItemID, userID = _ViewInfo.UserID }); |
586 | |||
587 | 992a98b4 | KangIngu | if (App.ViewInfo != null && App.ViewInfo.ProjectNO != "") |
588 | 787a4489 | KangIngu | { |
589 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetMember", _ViewInfo.ProjectNO + "," + _ViewInfo.UserID, 1); |
590 | 6c781c0c | djkim | userData = BaseClient.GetMember(App.ViewInfo.ProjectNO, App.ViewInfo.UserID); |
591 | if (userData != null) |
||
592 | 787a4489 | KangIngu | { |
593 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetDeptDataAsync", userData.DEPARTMENT, 1); |
594 | 6c781c0c | djkim | BaseClient.GetDeptDataAsync(userData.DEPARTMENT); |
595 | 787a4489 | KangIngu | } |
596 | 6c781c0c | djkim | else |
597 | { |
||
598 | userData = new MEMBER(); |
||
599 | userData.DEPARTMENT = "ALL"; |
||
600 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetDeptDataAsync", userData.DEPARTMENT, 1); |
601 | 6c781c0c | djkim | BaseClient.GetDeptDataAsync(userData.DEPARTMENT); |
602 | 29010418 | ljiyeon | } |
603 | 787a4489 | KangIngu | } |
604 | } |
||
605 | else |
||
606 | { |
||
607 | DialogMessage_Alert("Too Many V/P Files are uploading instantaneously, This V/P file can not be open now. Please feel free to re-open wait a moment again!" |
||
608 | + "\n\n" + "현재 일시적으로 많은 양의 V/P가 등록되고 있어 이 문서를 열람할 수 없습니다." + "\n" + "잠시만 기다려 주신 후 다시 열람하여 주시기 바랍니다", "Warning"); |
||
609 | //System.Windows.Forms.MessageBox.Show("Too Many V/P Files are uploading instantaneously, This V/P file can not be open now. Please feel free to re-open wait a moment again!" |
||
610 | // + "\n\n" + "현재 일시적으로 많은 양의 V/P가 등록되고 있어 이 문서를 열람할 수 없습니다." + "\n" + "잠시만 기다려 주신 후 다시 열람하여 주시기 바랍니다", "Warning"); |
||
611 | //this.ParentOfType<MainPage>().DialogMessage_Alert("Too Many V/P Files are uploading instantaneously, This V/P file can not be open now. Please feel free to re-open wait a moment again!" |
||
612 | // + "\n\n" + "현재 일시적으로 많은 양의 V/P가 등록되고 있어 이 문서를 열람할 수 없습니다." + "\n" + "잠시만 기다려 주신 후 다시 열람하여 주시기 바랍니다", "Warning"); |
||
613 | //System.Windows.Browser.HtmlPage.Window.Invoke("close"); |
||
614 | } |
||
615 | } |
||
616 | 29010418 | ljiyeon | |
617 | e7dd7ae8 | humkyung | /// <summary> |
618 | /// 문서 정보를 가져온다 |
||
619 | /// </summary> |
||
620 | /// <param name="sender"></param> |
||
621 | /// <param name="e"></param> |
||
622 | 787a4489 | KangIngu | private void BaseClient_GetDocInfoCompleted(object sender, GetDocInfoCompletedEventArgs e) |
623 | { |
||
624 | 0f065e57 | ljiyeon | Logger.sendResLog("GetDocInfoCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
625 | |||
626 | 787a4489 | KangIngu | if (e.Error != null) |
627 | { |
||
628 | DialogMessage_Alert("페이지정보를 가져올 수 없습니다.", "Alert"); |
||
629 | return; |
||
630 | } |
||
631 | 29010418 | ljiyeon | |
632 | 787a4489 | KangIngu | var MainUrl = DeepZoomUrl.Replace("{baseUrl}", App.SystemInfo.HostName); |
633 | MainUrl = MainUrl.Replace("{TileSourcePath}", _ViewInfo.ProjectNO + "_Tile"); |
||
634 | MainUrl = MainUrl.Replace("{ItemsPath}", (Convert.ToInt64(_ViewInfo.DocumentItemID) / 100).ToString()); |
||
635 | MainUrl = MainUrl.Replace("{SharepointItemID}", _ViewInfo.DocumentItemID); |
||
636 | MainUrl = MainUrl.Replace(@"http://http://", @"http://"); |
||
637 | |||
638 | _DocInfo = e.Result; |
||
639 | f38fed51 | KangIngu | foreach (var item in _DocInfo.DOCPAGE.OrderBy(order => order.PAGE_NUMBER)) |
640 | 787a4489 | KangIngu | { |
641 | ViewerDataModel.Instance.Document_Info.Add(item); |
||
642 | } |
||
643 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetMarkupInfoItemsAsync", _ViewInfo.ProjectNO + "," + _DocInfo.ID, 1); |
644 | 787a4489 | KangIngu | BaseClient.GetMarkupInfoItemsAsync(_ViewInfo.ProjectNO, _DocInfo.ID); |
645 | CurrentDoc = new Common.DocumentSet |
||
646 | { |
||
647 | docInfo = _DocInfo, |
||
648 | Document_Id = _DocInfo.DOCUMENT_ID, |
||
649 | Document_NO = _DocItem.DOCUMENT_NO, |
||
650 | File_Original = _DocInfo.ORIGINAL_FILE, |
||
651 | File_Result = _DocItem.RESULT_FILE, |
||
652 | Group_No = _DocItem.GROUP_NO, |
||
653 | ProjectNo = _DocItem.PROJECT_NO, |
||
654 | Revision = _DocItem.REVISION, |
||
655 | }; |
||
656 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
657 | instanceMain.dzTopMenu.tlcurrentPage.Text = _DocInfo.PAGE_COUNT.ToString(); |
||
658 | 992a98b4 | KangIngu | instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = _DocInfo.PAGE_COUNT.ToString(); |
659 | 4590804a | djkim | string apptitle = string.Format("MARKUS(ver.{2}) - {0}(Rev.{1})", _DocItem.DOCUMENT_NO, _DocItem.REVISION, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); |
660 | d2cd1e16 | djkim | instanceMain.TitleText.Text = apptitle; |
661 | instanceMain.Title = apptitle; |
||
662 | 787a4489 | KangIngu | this.pageNavigator.SetPageNavi(CurrentDoc.docInfo.DOCPAGE.ToList(), MainUrl); |
663 | |||
664 | ViewerDataModel.Instance.MarkupControls_USER.Clear(); |
||
665 | 6707a5c7 | ljiyeon | |
666 | //ViewerDataModel.Instance.SystemMain.dzMainMenu.TempLoad(); |
||
667 | |||
668 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetVPRevisionHistoryAsync", CurrentDoc.ProjectNo + "," + CurrentDoc.Document_NO + "," + CurrentDoc.Document_Id, 1); |
669 | 29010418 | ljiyeon | BaseClient.GetVPRevisionHistoryAsync(CurrentDoc.ProjectNo, CurrentDoc.Document_NO, CurrentDoc.Document_Id); |
670 | 787a4489 | KangIngu | } |
671 | |||
672 | |||
673 | public void SetView(ViewInfo info) |
||
674 | { |
||
675 | this._ViewInfo = info; |
||
676 | if (!(App.ViewInfo.ProjectNO == "000000" || App.ViewInfo.ProjectNO == "000001")) |
||
677 | { |
||
678 | ViewerDataModel.Instance.SystemMain.dzTopMenu.btnTopStamp.Visibility = Visibility.Collapsed; |
||
679 | } |
||
680 | 0f065e57 | ljiyeon | Logger.sendReqLog("GetSystemDataAsync", "", 1); |
681 | 29010418 | ljiyeon | BaseClient.GetSystemDataAsync(); |
682 | 787a4489 | KangIngu | } |
683 | |||
684 | 992a98b4 | KangIngu | public void HubSet() |
685 | { |
||
686 | |||
687 | // 허브 연결 구성 |
||
688 | 9a1ce1db | KangIngu | var hubConnection = new HubConnection(global::KCOM.Properties.Settings.Default.HubAddress); |
689 | 992a98b4 | KangIngu | IHubProxy MarkusLicenseProxy = hubConnection.CreateHubProxy("MarkusLicenseHub"); |
690 | |||
691 | |||
692 | // 허브 연결 |
||
693 | hubConnection.Start().ContinueWith(task => |
||
694 | { |
||
695 | if (task.IsFaulted) |
||
696 | { |
||
697 | Console.WriteLine("There was an error opening the connection:{0}", |
||
698 | task.Exception.GetBaseException()); |
||
699 | } |
||
700 | else |
||
701 | { |
||
702 | Console.WriteLine("Connected :: " + task.Id); |
||
703 | } |
||
704 | |||
705 | }).Wait(); |
||
706 | |||
707 | |||
708 | // [ 프로그램 시작 ] |
||
709 | // 클라이언트에서 서버를 호출 ( 접속 시 ) : 라이센스 체크 |
||
710 | //( "method name", arg1, arg2 ) |
||
711 | //MarkusLicenseProxy.Invoke<string>("ConnectionMarkus", "H2009115", "고동균").ContinueWith(task => |
||
712 | //{ |
||
713 | // if (task.IsFaulted) |
||
714 | // { |
||
715 | // Console.WriteLine("ConnectionMarkus :: There was an error calling send: {0}", task.Exception.GetBaseException()); |
||
716 | // } |
||
717 | // else |
||
718 | // { |
||
719 | // Console.WriteLine(task.Result); |
||
720 | // } |
||
721 | //}); |
||
722 | MarkusLicenseProxy.Invoke<string>("ConnectionMarkus", App.ViewInfo.UserID).ContinueWith(task => |
||
723 | { |
||
724 | if (task.IsFaulted) |
||
725 | { |
||
726 | Console.WriteLine("ConnectionMarkus :: There was an error calling send: {0}", task.Exception.GetBaseException()); |
||
727 | } |
||
728 | else |
||
729 | { |
||
730 | 29010418 | ljiyeon | switch (task.Result) |
731 | 992a98b4 | KangIngu | { |
732 | 53393bae | KangIngu | case "2": |
733 | { |
||
734 | MessageBox.Show("권한이 없습니다."); |
||
735 | System.Diagnostics.Process.GetCurrentProcess().Kill(); |
||
736 | } |
||
737 | break; |
||
738 | case "404": |
||
739 | { |
||
740 | MessageBox.Show("등록된 사용자가 아닙니다."); |
||
741 | System.Diagnostics.Process.GetCurrentProcess().Kill(); |
||
742 | } |
||
743 | break; |
||
744 | 992a98b4 | KangIngu | } |
745 | } |
||
746 | }); |
||
747 | |||
748 | // 서버에서 클라이언트 호출 ( 프로그램 구동여부 ) : 라이센스 체크 후 응답 ( 반환값 : true, false ) |
||
749 | //MarkusLicenseProxy.On<bool>("IsConnection", status => |
||
750 | //{ |
||
751 | |||
752 | // if (status) |
||
753 | // { |
||
754 | // // 프로그램 시작 |
||
755 | // Console.WriteLine("connection status : " + status); |
||
756 | // } |
||
757 | // else |
||
758 | // { |
||
759 | // // 프로그램 종료 ( signalr 접속 끊기 ) |
||
760 | // hubConnection.Stop(); |
||
761 | // } |
||
762 | //}); |
||
763 | |||
764 | // 공지 메세지 ( 서버에서 클라이언트 호출 ) |
||
765 | MarkusLicenseProxy.On<string>("MarkusNotification", msg => |
||
766 | Console.WriteLine("Noficiation Message : " + msg) |
||
767 | ); |
||
768 | |||
769 | |||
770 | // 서버 메서드 호출 |
||
771 | //MarkusLicenseProxy.Invoke<string>("DoSomething", "I'm doing something!!!").Wait(); |
||
772 | |||
773 | //Console.ReadKey(); |
||
774 | |||
775 | //hubConnection.Stop(); |
||
776 | } |
||
777 | 787a4489 | KangIngu | |
778 | 1f1c566e | djkim | public void MarkupUserListDisplay() |
779 | { |
||
780 | List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
||
781 | List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
||
782 | List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
||
783 | 29010418 | ljiyeon | //MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl(); |
784 | 1f1c566e | djkim | Common.ViewerDataModel.Instance.MarkupControls_USER.Clear(); //전체 제거 |
785 | 29010418 | ljiyeon | Common.ViewerDataModel.Instance.MarkupControls.Clear(); //전체 제거 |
786 | f714bef8 | djkim | //foreach (var item in gridSelectionItem) |
787 | //{ |
||
788 | // if (item.UserID == App.ViewInfo.UserID) |
||
789 | // { |
||
790 | // ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
||
791 | // { |
||
792 | // layerControl.markupParseEx(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markupitem.ID); |
||
793 | // }); |
||
794 | // } |
||
795 | // else |
||
796 | // { |
||
797 | // ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
||
798 | // { |
||
799 | // layerControl.markupParse(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID); |
||
800 | // }); |
||
801 | // } |
||
802 | //} |
||
803 | 29010418 | ljiyeon | (from A in gridSelectionItem |
804 | from B in Common.ViewerDataModel.Instance.MarkupControls_USER |
||
805 | where A.MarkupInfoID == B.MarkupInfoID |
||
806 | select B).ToList().ForEach(data => |
||
807 | { |
||
808 | Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(data); |
||
809 | }); |
||
810 | 1f1c566e | djkim | (from A in gridSelectionItem |
811 | from B in Common.ViewerDataModel.Instance.MarkupControls |
||
812 | where A.MarkupInfoID == B.MarkupInfoID |
||
813 | select B).ToList().ForEach(data => |
||
814 | { |
||
815 | Common.ViewerDataModel.Instance.MarkupControls.Remove(data); |
||
816 | }); |
||
817 | |||
818 | foreach (var item in gridSelectionItem) |
||
819 | { |
||
820 | if (item.UserID == App.ViewInfo.UserID) |
||
821 | { |
||
822 | ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
||
823 | { |
||
824 | 661b7416 | humkyung | MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", |
825 | item.MarkupInfoID, markupitem.ID); |
||
826 | 1f1c566e | djkim | }); |
827 | } |
||
828 | else |
||
829 | { |
||
830 | ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
||
831 | { |
||
832 | 661b7416 | humkyung | MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID); |
833 | 1f1c566e | djkim | }); |
834 | } |
||
835 | } |
||
836 | } |
||
837 | 787a4489 | KangIngu | } |
838 | } |