프로젝트

일반

사용자정보

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

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

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