프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Services / BaseServices.cs @ 6b5d33c6

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