프로젝트

일반

사용자정보

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

markus / KCOM / Services / BaseServices.cs @ f4ec4218

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