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