markus / KCOM / Services / BaseServices.cs @ 8118ba81
이력 | 보기 | 이력해설 | 다운로드 (68.7 KB)
1 |
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 System; |
8 |
using System.Collections.Generic; |
9 |
using System.Collections.ObjectModel; |
10 |
using System.ComponentModel; |
11 |
using System.Linq; |
12 |
using System.Runtime.CompilerServices; |
13 |
using System.Text; |
14 |
using System.Windows; |
15 |
using System.Windows.Controls; |
16 |
using Telerik.Windows.Controls; |
17 |
using MarkupToPDF.Controls.Parsing; |
18 |
using Telerik.Windows.Data; |
19 |
using System.Web; |
20 |
using System.ServiceModel.Security; |
21 |
|
22 |
namespace KCOM.Views |
23 |
{ |
24 |
public partial class MainMenu : UserControl, INotifyPropertyChanged |
25 |
{ |
26 |
//const string DeepZoomUrl = @"http://{baseUrl}/TileSource/{TileSourcePath}/{ItemsPath}/{SharepointItemID}/{PageNo}.jpg"; |
27 |
public ServiceDeepViewClient BaseClient; |
28 |
public KcomService.ServiceDeepViewClient BaseTaskClient |
29 |
{ |
30 |
get { |
31 |
var service = new KcomService.ServiceDeepViewClient(App._binding, App._EndPoint); |
32 |
return service; |
33 |
} |
34 |
} |
35 |
|
36 |
public ViewInfo _ViewInfo; |
37 |
public DOCINFO _DocInfo; |
38 |
public DOCUMENT_ITEM _DocItem; |
39 |
public MEMBER userData { get; set; } |
40 |
|
41 |
public event PropertyChangedEventHandler PropertyChanged; |
42 |
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "") |
43 |
{ |
44 |
if (PropertyChanged != null) |
45 |
{ |
46 |
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
47 |
} |
48 |
} |
49 |
|
50 |
private Common.DocumentSet _CurrentDoc { get; set; } |
51 |
public Common.DocumentSet CurrentDoc |
52 |
{ |
53 |
get |
54 |
{ |
55 |
return _CurrentDoc; |
56 |
} |
57 |
set |
58 |
{ |
59 |
if (value != CurrentDoc) |
60 |
{ |
61 |
_CurrentDoc = value; |
62 |
NotifyPropertyChanged(); |
63 |
} |
64 |
} |
65 |
} |
66 |
public void ServiceOn() |
67 |
{ |
68 |
//BaseTaskClient = new KcomService.ServiceDeepViewClient(App._binding, App._EndPoint); |
69 |
BaseClient = new ServiceDeepViewClient(App._binding, App._EndPoint); |
70 |
|
71 |
#region 이벤트 핸들러 등록 |
72 |
BaseClient.GetDocInfoCompleted += BaseClient_GetDocInfoCompleted; //문서 섬네일, 페이지크기, 마크업 정보 [3] |
73 |
BaseClient.GetConversionStateCompleted += BaseClient_GetConversionStateCompleted; //컨버팅의 여부 [2] |
74 |
BaseClient.GetSystemDataCompleted += BaseClient_GetSystemDataCompleted; //시스템 정보 [1] |
75 |
BaseClient.GetDocumentItemInfoCompleted += BaseClient_GetDocumentItemInfoCompleted; // 문서 자체의 정보 [4] |
76 |
BaseClient.GetMarkupInfoItemsCompleted += BaseClient_GetMarkupInfoItemsCompleted; |
77 |
BaseClient.GetDeptDataCompleted += BaseClient_GetDeptDataCompleted; |
78 |
BaseClient.DeleteMarkupCompleted += BaseClient_DeleteMarkupCompleted; |
79 |
BaseClient.GetVPRevisionHistoryCompleted += BaseClient_GetVPRevisionHistoryCompleted; |
80 |
BaseClient.SetFinalPDFCompleted += BaseClient_SetFinalPDFCompleted; |
81 |
BaseClient.GetCompareRectCompleted += BaseClient_GetCompareRectCompleted; |
82 |
BaseClient.DeleteMarkupCompleted += BaseClient_DeleteMarkupCompleted; |
83 |
BaseClient.DelFavoriteVPCompleted += BaseClient_DelFavoriteVPCompleted; |
84 |
BaseClient.EditFavoriteVPCompleted += BaseClient_EditFavoriteVPCompleted; |
85 |
|
86 |
BaseClient.SaveSymbolCompleted += BaseClient_SaveSymbolCompleted; |
87 |
BaseClient.AddPublicSymbolCompleted += BaseClient_AddPublicSymbolCompleted; |
88 |
#endregion |
89 |
} |
90 |
|
91 |
private void BaseClient_EditFavoriteVPCompleted(object sender, EditFavoriteVPCompletedEventArgs e) |
92 |
{ |
93 |
//Logger.sendResLog("EditFavoriteVPCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
94 |
|
95 |
if (e.Error == null && e.Result != false) |
96 |
{ |
97 |
//Logger.sendReqLog("GetFavoriteVPAsync", App.ViewInfo.ProjectNO + "," + App.ViewInfo.UserID + "," + App.ViewInfo.DocumentItemID, 1); |
98 |
BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
99 |
} |
100 |
else |
101 |
{ |
102 |
DialogMessage_Alert("Unable to delete the file due to a system failure", "Warning"); |
103 |
} |
104 |
} |
105 |
|
106 |
private void BaseClient_DelFavoriteVPCompleted(object sender, DelFavoriteVPCompletedEventArgs e) |
107 |
{ |
108 |
//Logger.sendResLog("DelFavoriteVPCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
109 |
|
110 |
if (e.Error == null && e.Result != false) |
111 |
{ |
112 |
//Logger.sendReqLog("GetFavoriteVPAsync", App.ViewInfo.ProjectNO + "," + App.ViewInfo.UserID + "," + App.ViewInfo.DocumentItemID, 1); |
113 |
BaseClient.GetFavoriteVPAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID, App.ViewInfo.DocumentItemID); |
114 |
} |
115 |
else |
116 |
{ |
117 |
DialogMessage_Alert("Unable to delete the file due to a system failure", "Warning"); |
118 |
} |
119 |
} |
120 |
|
121 |
/// <summary> |
122 |
/// Compare 결과를 받아 화면에 표시한다 |
123 |
/// </summary> |
124 |
/// <param name="sender"></param> |
125 |
/// <param name="e"></param> |
126 |
private void BaseClient_GetCompareRectCompleted(object sender, GetCompareRectCompletedEventArgs e) |
127 |
{ |
128 |
if (e.Error != null || e.Result == null) |
129 |
{ |
130 |
if (e.Error != null) |
131 |
{ |
132 |
DialogMessage_Alert(e.Error.ToString(), "Error"); |
133 |
} |
134 |
else |
135 |
{ |
136 |
DialogMessage_Alert("Compare 기능을 원활히 실행하기 위한 데이터가 부족합니다", "안내"); |
137 |
} |
138 |
} |
139 |
else |
140 |
{ |
141 |
e.Result.ForEach(d => |
142 |
{ |
143 |
d.Width = d.Width; |
144 |
d.Height = d.Height; |
145 |
var point = MarkupToPDF.Controls.Common.MathSet.getRectMiddlePoint(d); |
146 |
System.Windows.Shapes.Rectangle myEllipse = new System.Windows.Shapes.Rectangle(); |
147 |
myEllipse.Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(150, 33, 215, 119)); |
148 |
myEllipse.Opacity = 1; |
149 |
myEllipse.Width = d.Width; |
150 |
myEllipse.Height = d.Height; |
151 |
Canvas.SetLeft(myEllipse, d.X - ((point.X - d.X) / 2.0)); |
152 |
Canvas.SetTop(myEllipse, d.Y - ((point.Y - d.Y) / 2.0)); |
153 |
myEllipse.RenderTransformOrigin = point; |
154 |
canvas_compareBorder.Children.Add(myEllipse); |
155 |
}); |
156 |
canvas_compareBorder.Visibility = Visibility.Visible; |
157 |
da.From = 1; |
158 |
da.To = 0.5; |
159 |
da.Duration = new Duration(TimeSpan.FromSeconds(1)); |
160 |
da.AutoReverse = true; |
161 |
canvas_compareBorder.BeginAnimation(OpacityProperty, da); |
162 |
} |
163 |
} |
164 |
|
165 |
/// <summary> |
166 |
/// FinalPDF를 수행 후 관련 메시지를 표시한다. |
167 |
/// </summary> |
168 |
/// <param name="sender"></param> |
169 |
/// <param name="e"></param> |
170 |
private void BaseClient_SetFinalPDFCompleted(object sender, SetFinalPDFCompletedEventArgs e) |
171 |
{ |
172 |
if (e.Error != null || e.Result.Status == FinalStatus.Error) |
173 |
{ |
174 |
string errormsg = CommonLib.Common.GetAlertMessageString("SetFinalPDFError", "MSG", $"최종 파일을 만드는데 문제가 발생하였습니다{System.Environment.NewLine}{e.Result.Exception}"); |
175 |
DialogMessage_Alert(errormsg, "안내"); |
176 |
} |
177 |
else |
178 |
{ |
179 |
string successmsg = CommonLib.Common.GetAlertMessageString("SetFinalPDFSuccess", "MSG", "최종 파일 생성 중입니다. 문서관리시스템을 확인해주세요"); |
180 |
DialogMessage_Alert(successmsg, "안내"); |
181 |
} |
182 |
} |
183 |
|
184 |
private void BaseClient_GetVPRevisionHistoryCompleted(object sender, GetVPRevisionHistoryCompletedEventArgs e) |
185 |
{ |
186 |
//Logger.sendResLog("GetVPRevisionHistoryCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result?.Count + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
187 |
|
188 |
if (e.Result != null && e.Error == null) |
189 |
{ |
190 |
List<VPRevision> list = e.Result; |
191 |
foreach (var item in list) |
192 |
{ |
193 |
|
194 |
if (App.isExternal) |
195 |
{ |
196 |
var sBaseServiceURL = CommonLib.Common.GetConfigString("ExternalOriginalFileUrl", "URL", "", App.isExternal); |
197 |
|
198 |
if (!string.IsNullOrWhiteSpace(item.TO_VENDOR)) |
199 |
{ |
200 |
var toUri = new Uri(HttpUtility.UrlDecode(item.TO_VENDOR)); |
201 |
item.TO_VENDOR = $"{sBaseServiceURL}{toUri.LocalPath}"; |
202 |
} |
203 |
|
204 |
if (!string.IsNullOrWhiteSpace(item.FROM_VENDOR)) |
205 |
{ |
206 |
var fromUri = new Uri(HttpUtility.UrlDecode(item.FROM_VENDOR)); |
207 |
item.FROM_VENDOR = $"{sBaseServiceURL}{fromUri.LocalPath}"; |
208 |
} |
209 |
} |
210 |
else |
211 |
{ |
212 |
item.TO_VENDOR = HttpUtility.UrlDecode(item.TO_VENDOR); |
213 |
item.FROM_VENDOR = HttpUtility.UrlDecode(item.FROM_VENDOR); |
214 |
item.EnsembleLink = HttpUtility.UrlDecode(item.EnsembleLink); |
215 |
} |
216 |
} |
217 |
//int result; |
218 |
//bool iCheck = true; |
219 |
//foreach (var li in list) |
220 |
//{ |
221 |
// iCheck = int.TryParse(li.GroupNo, out result); |
222 |
// if (!iCheck) |
223 |
// break; |
224 |
//} |
225 |
//if(iCheck) |
226 |
gridViewHistory.ItemsSource = list.OrderByDescending(x => x.GroupNo); //20240611 LJY string 인거 전달드림 slip no 내림차순으로 그냥 해달라고 요청 |
227 |
//else |
228 |
// gridViewHistory.ItemsSource = list.OrderByDescending(x => x.RevNo); |
229 |
|
230 |
} |
231 |
//TempFile.TempLoad(); |
232 |
} |
233 |
|
234 |
private void BaseClient_DeleteMarkupCompleted(object sender, DeleteMarkupCompletedEventArgs e) |
235 |
{ |
236 |
//Logger.sendResLog("DeleteMarkupCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
237 |
|
238 |
foreach(var info in ViewerDataModel.Instance._markupInfoList) |
239 |
{ |
240 |
if(info.UserID == App.ViewInfo.UserID) |
241 |
{ |
242 |
info.userDelete = true; |
243 |
info.DisplayColor = "#FFFF0000"; |
244 |
} |
245 |
else |
246 |
{ |
247 |
info.userDelete = false; |
248 |
} |
249 |
} |
250 |
} |
251 |
|
252 |
private void BaseClient_GetDeptDataCompleted(object sender, GetDeptDataCompletedEventArgs e) |
253 |
{ |
254 |
if (e.Error == null) |
255 |
{ |
256 |
//Logger.sendResLog("GetDeptDataCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result?.Count + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
257 |
} |
258 |
else |
259 |
{ |
260 |
//Logger.sendResLog("GetDeptDataCompleted", "\r Error :" + e.Error, 1); |
261 |
} |
262 |
|
263 |
if (e.Result != null) |
264 |
{ |
265 |
e.Result.Sort(); |
266 |
//cbSymbolPublic.ItemsSource = e.Result.ToList(); |
267 |
} |
268 |
} |
269 |
|
270 |
/// <summary> |
271 |
/// ??? |
272 |
/// </summary> |
273 |
public MarkupInfoItem PreviewUserMarkupInfoItem { get; set; } |
274 |
|
275 |
/// <summary> |
276 |
/// 문서 정보를 가져온다 |
277 |
/// </summary> |
278 |
/// <param name="sender"></param> |
279 |
/// <param name="e"></param> |
280 |
private async void BaseClient_GetDocInfoCompleted(object sender, GetDocInfoCompletedEventArgs e) |
281 |
{ |
282 |
////Logger.sendResLog("GetDocInfoCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
283 |
|
284 |
if (e.Error != null) |
285 |
{ |
286 |
DialogMessage_Alert("The page cannot be displayed.", "Alert"); |
287 |
} |
288 |
else if (e.Result == null) |
289 |
{ |
290 |
DialogMessage_Alert("Document information is missing.", "Alert"); |
291 |
} |
292 |
else |
293 |
{ |
294 |
string sFolder = _ViewInfo.DocumentItemID.All(char.IsDigit) ? (Convert.ToUInt64(_ViewInfo.DocumentItemID) / 100).ToString() : (_ViewInfo.DocumentItemID.Length >= 5 ? _ViewInfo.DocumentItemID.Substring(0, 5) : _ViewInfo.DocumentItemID); |
295 |
|
296 |
/// 화면의 좌측 Thumbnail의 주소 |
297 |
var MainUrl = string.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal).Replace("png", "jpg"), _ViewInfo.ProjectNO, sFolder, _ViewInfo.DocumentItemID, "{PageNo}"); |
298 |
_DocInfo = e.Result; |
299 |
_DocInfo.ORIGINAL_FILE = HttpUtility.UrlDecode(_DocInfo.ORIGINAL_FILE); |
300 |
foreach (var item in _DocInfo.DOCPAGE.OrderBy(order => order.PAGE_NUMBER)) |
301 |
{ |
302 |
ViewerDataModel.Instance.Document_Info.Add(item); |
303 |
} |
304 |
//Logger.sendReqLog("GetMarkupInfoItemsAsync", _ViewInfo.ProjectNO + "," + _DocInfo.ID, 1); |
305 |
CurrentDoc = new Common.DocumentSet |
306 |
{ |
307 |
docInfo = _DocInfo, |
308 |
Document_Id = _DocInfo.DOCUMENT_ID, |
309 |
File_Original = _DocInfo.ORIGINAL_FILE, |
310 |
|
311 |
Document_NO = _DocItem?.DOCUMENT_NO, |
312 |
File_Result = _DocItem?.RESULT_FILE, |
313 |
Group_No = _DocItem?.GROUP_NO, |
314 |
ProjectNo = _DocItem?.PROJECT_NO, |
315 |
Revision = _DocItem?.REVISION, |
316 |
}; |
317 |
|
318 |
var instanceMain = this.ParentOfType<MainWindow>(); |
319 |
string firstpage = "1"; |
320 |
string lastpage = _DocInfo.PAGE_COUNT.ToString(); |
321 |
instanceMain.dzTopMenu.tlcurrentPage.Text = firstpage; |
322 |
instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = lastpage; |
323 |
App.MarkusVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
324 |
|
325 |
string apptitle = string.Format("MARKUS(ver.{2}) - {0}(Rev.{1})", _DocItem?.DOCUMENT_NO, _DocItem?.REVISION, App.MarkusVersion); |
326 |
|
327 |
instanceMain.Title = apptitle; |
328 |
|
329 |
#region 페이지 이미지를 로컬에 저장 |
330 |
string tempStoragePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MARKUS", System.IO.Path.GetRandomFileName()); |
331 |
|
332 |
//.Replace("jpg", "png")을 붙이는 이유는 MainUrl에 확장명이 jpg로 설정한 경우가 있기 때문 |
333 |
|
334 |
#endregion |
335 |
|
336 |
App.PageStorage = new PageManager.PageStorage(MainUrl.Replace("jpg", "png"), tempStoragePath, "png", _DocInfo.PAGE_COUNT, 1); |
337 |
|
338 |
//App.SamplePageStorage = new PageManager.PageStorage(MainUrl.Replace("png", "jpg"), tempStoragePath, "jpg", _DocInfo.PAGE_COUNT); |
339 |
await this.pageNavigator.SetPageNaviAsync(CurrentDoc.docInfo.DOCPAGE.ToList(), MainUrl); |
340 |
} |
341 |
} |
342 |
|
343 |
private void pageNavigator_ThumbInitialized(object sender,EventArgs e) |
344 |
{ |
345 |
BaseClient.GetMarkupInfoItemsAsync(_ViewInfo.ProjectNO, _DocInfo.ID); |
346 |
|
347 |
ViewerDataModel.Instance.MarkupControls_USER.Clear(); |
348 |
//ViewerDataModel.Instance.SystemMain.dzMainMenu.TempLoad(); |
349 |
|
350 |
/// 기존 임시파일 정리 |
351 |
#region 단어 검색용 파일 다운로드 |
352 |
|
353 |
DownloadOriginalFile(); |
354 |
|
355 |
#endregion |
356 |
|
357 |
//Logger.sendReqLog("GetVPRevisionHistoryAsync", CurrentDoc.ProjectNo + "," + CurrentDoc.Document_NO + "," + CurrentDoc.Document_Id, 1); |
358 |
BaseClient.GetVPRevisionHistoryAsync(CurrentDoc.ProjectNo, CurrentDoc.Document_NO, CurrentDoc.Document_Id); |
359 |
|
360 |
} |
361 |
|
362 |
|
363 |
/// <summary> |
364 |
/// get markupinfo and markupitem from database |
365 |
/// - 1. called when document is loaded |
366 |
/// - 2. called when user do consolidation |
367 |
/// </summary> |
368 |
/// <param name="sender"></param> |
369 |
/// <param name="e"></param> |
370 |
private void BaseClient_GetMarkupInfoItemsCompleted(object sender, GetMarkupInfoItemsCompletedEventArgs e) |
371 |
{ |
372 |
//Logger.sendResLog("GetMarkupInfoItemsCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result?.Count + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
373 |
|
374 |
ViewerDataModel.Instance.MarkupControls_USER.Clear(); |
375 |
ViewerDataModel.Instance.MarkupControls.Clear(); |
376 |
|
377 |
try |
378 |
{ |
379 |
|
380 |
if (e.Result != null) |
381 |
{ |
382 |
ViewerDataModel.Instance._markupInfoList.Clear(); |
383 |
if (e.Result.Any()) ViewerDataModel.Instance.MyMarkupList.Clear(); |
384 |
|
385 |
foreach (var info in e.Result) |
386 |
{ |
387 |
if (info.Depatment == null) info.Depatment = "Unknown"; |
388 |
|
389 |
else if (info.UserID == App.ViewInfo.UserID) |
390 |
{ |
391 |
if (!App.ViewInfo.CreateFinalPDFPermission && !App.ViewInfo.NewCommentPermission) //조회모드는 delete 버튼 모두 비활성화 |
392 |
{ |
393 |
info.userDelete = false; |
394 |
} |
395 |
else if (!App.ViewInfo.CreateFinalPDFPermission && App.ViewInfo.NewCommentPermission && e.Result.Where(x => x.UserID == App.ViewInfo.UserID && x.PartConsolidate == 1).Count() > 0) //Team Consolidation Mode이고 Team Consolidation Layer가 있을 경우 |
396 |
{ |
397 |
if(App.ViewInfo.NewCommentPermission && e.Result.Where(x => x.UserID == App.ViewInfo.UserID && x.PartConsolidate == 1 && x.MarkupInfoID == info.MarkupInfoID).Count() > 0) |
398 |
info.userDelete = true; |
399 |
} |
400 |
else if(App.ViewInfo.CreateFinalPDFPermission && App.ViewInfo.NewCommentPermission) //Consolidation Mode 일 때는 해당 Comment Layer의 Status가 Avoid or Consolidation인 것만 Delete 버튼 활성화 |
401 |
{ |
402 |
if(info.AvoidConsolidate == 1 || info.Consolidate == 1) |
403 |
info.userDelete = true; |
404 |
} |
405 |
else |
406 |
{ |
407 |
info.userDelete = true; |
408 |
} |
409 |
info.DisplayColor = "#FFFF0000"; |
410 |
} |
411 |
else |
412 |
{ |
413 |
info.userDelete = false; |
414 |
} |
415 |
|
416 |
ViewerDataModel.Instance._markupInfoList.Add(info); |
417 |
} |
418 |
|
419 |
var userInfoList = ViewerDataModel.Instance._markupInfoList.GroupBy(f => f.UserID).Select(f => new MarkupUserInfo { UserId = f.Key, UserName = f.First().UserName }); |
420 |
|
421 |
userInfoList.ToList().ForEach(x => |
422 |
{ |
423 |
ViewerDataModel.Instance._markupUserList.Add(x); |
424 |
|
425 |
if (MarkupToPDF.MarkupContext.GetUserSignItem(x.UserId) == null) |
426 |
{ |
427 |
string signData = BaseClient.GetSignData(App.ViewInfo.ProjectNO, x.UserId); |
428 |
string signStrokes = BaseClient.GetSignStrokes(App.ViewInfo.ProjectNO, x.UserId); |
429 |
|
430 |
if (signData != null && signStrokes != null) |
431 |
{ |
432 |
MarkupToPDF.MarkupContext.SetUserSignItem(x.UserId, signData, signStrokes); |
433 |
} |
434 |
} |
435 |
}); |
436 |
|
437 |
e.Result.ToList().ForEach(d => |
438 |
{ |
439 |
if (d.MarkupList != null) |
440 |
{ |
441 |
d.MarkupList.ForEach(p => |
442 |
{ |
443 |
if (d.UserID == App.ViewInfo.UserID) |
444 |
{ |
445 |
if (!App.ViewInfo.CreateFinalPDFPermission && !App.ViewInfo.NewCommentPermission) //조회모드는 delete 버튼 모두 비활성화 |
446 |
{ |
447 |
d.userDelete = false; |
448 |
} |
449 |
else if (!App.ViewInfo.CreateFinalPDFPermission && App.ViewInfo.NewCommentPermission && e.Result.Where(x => x.UserID == App.ViewInfo.UserID && x.PartConsolidate == 1).Count() > 0)//Team Consolidation Mode이고 Team Consolidation Layer가 있을 경우 |
450 |
{ |
451 |
if (App.ViewInfo.NewCommentPermission && e.Result.Exists(x => x.UserID == App.ViewInfo.UserID && x.PartConsolidate == 1 && x.MarkupInfoID == d.MarkupInfoID)) |
452 |
d.userDelete = true; |
453 |
} |
454 |
else if (App.ViewInfo.CreateFinalPDFPermission && App.ViewInfo.NewCommentPermission) //Consolidation Mode 일 때는 해당 Comment Layer의 Status가 Avoid or Consolidation인 것만 Delete 버튼 활성화 |
455 |
{ |
456 |
if (d.AvoidConsolidate == 1 || d.Consolidate == 1) |
457 |
d.userDelete = true; |
458 |
} |
459 |
else |
460 |
{ |
461 |
d.userDelete = true; |
462 |
} |
463 |
d.DisplayColor = "#FFFF0000"; |
464 |
MarkupItemEx markup = new MarkupItemEx |
465 |
{ |
466 |
Data = p.Data, |
467 |
Data_Type = p.Data_Type, |
468 |
ID = p.ID, |
469 |
IsUpdate = false, |
470 |
MarkupInfoID = d.MarkupInfoID, |
471 |
PageNumber = p.PageNumber, |
472 |
Symbol_ID = p.Symbol_ID, |
473 |
//Group_ID = p.Group_ID |
474 |
}; |
475 |
ViewerDataModel.Instance.MyMarkupList.Add(markup); |
476 |
} |
477 |
else |
478 |
{ |
479 |
MarkupItemEx markup = new MarkupItemEx |
480 |
{ |
481 |
Data = p.Data, |
482 |
Data_Type = p.Data_Type, |
483 |
ID = p.ID, |
484 |
IsUpdate = false, |
485 |
MarkupInfoID = d.MarkupInfoID, |
486 |
PageNumber = p.PageNumber, |
487 |
Symbol_ID = p.Symbol_ID, |
488 |
//Group_ID = p.Group_ID |
489 |
}; |
490 |
ViewerDataModel.Instance.MarkupList_Pre.Add(markup); |
491 |
} |
492 |
}); |
493 |
} |
494 |
}); |
495 |
|
496 |
var currentUser = e.Result.Find(data => data.UserID == App.ViewInfo.UserID && data.AvoidConsolidate == 0); |
497 |
if (currentUser == null) |
498 |
{ |
499 |
/// create a new markupinfo to do comments |
500 |
if (App.ViewInfo.NewCommentPermission) |
501 |
{ |
502 |
var infoId = Commons.ShortGuid(); |
503 |
PreviewUserMarkupInfoItem = new MarkupInfoItem |
504 |
{ |
505 |
CreateTime = DateTime.Now, |
506 |
UpdateTime = DateTime.Now, |
507 |
Depatment = userData.DEPARTMENT, |
508 |
DisplayColor = "#FFFF0000", |
509 |
UserID = userData.ID, |
510 |
UserName = userData.NAME, |
511 |
PageCount = 1, |
512 |
Description = "", |
513 |
MarkupInfoID = infoId, |
514 |
MarkupList = null, |
515 |
MarkupVersionID = Commons.ShortGuid(), |
516 |
Consolidate = 0, |
517 |
PartConsolidate = 0, |
518 |
userDelete = true, |
519 |
AvoidConsolidate = 0, |
520 |
IsPreviewUser = false |
521 |
}; |
522 |
|
523 |
App.Custom_ViewInfoId = infoId; |
524 |
|
525 |
ViewerDataModel.Instance._markupInfoList.Insert(0, PreviewUserMarkupInfoItem); |
526 |
} |
527 |
} |
528 |
else |
529 |
{ |
530 |
App.Custom_ViewInfoId = currentUser.MarkupInfoID; |
531 |
} |
532 |
|
533 |
ViewerDataModel.Instance.SyncPageNumber = 1; |
534 |
|
535 |
/// Consolidation 된 데이터가 최상단에 올 수 있도록 변경 |
536 |
//var markupItem = ViewerDataModel.Instance._markupInfoList.OrderByDescending(p => p.Consolidate == Convert.ToInt32(true)).ToList(); |
537 |
|
538 |
gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList; |
539 |
|
540 |
SetCommentPages(null); |
541 |
|
542 |
// GRIDVIEW에서 팀별 GROUPING |
543 |
// 효성은 안함 |
544 |
#if (Hyosung) |
545 |
#else |
546 |
/// create a group descriptor |
547 |
gridViewMarkup.GroupDescriptors.Clear(); |
548 |
GroupDescriptor descriptor = new GroupDescriptor(); |
549 |
descriptor.Member = "Depatment"; |
550 |
descriptor.DisplayContent = "DEPT"; |
551 |
//descriptor.SortDirection = ListSortDirection.Ascending; |
552 |
gridViewMarkup.GroupDescriptors.Add(descriptor); |
553 |
#endif |
554 |
|
555 |
GridViewMarkup_Sorting(gridViewMarkup, new GridViewSortingEventArgs(gridViewMarkup.Columns[0], SortingState.None, SortingState.None)); |
556 |
|
557 |
SelectInitialMarkupInfo(); |
558 |
} |
559 |
} |
560 |
catch (Exception ex) |
561 |
{ |
562 |
App.FileLogger.Fatal(ex); |
563 |
} |
564 |
finally |
565 |
{ |
566 |
if(!ViewerDataModel.Instance.SystemMain.dzMainMenu.btnFinalPDF.IsEnabled) |
567 |
{ |
568 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.btnFinalPDF.IsEnabled = true; |
569 |
} |
570 |
|
571 |
if (!ViewerDataModel.Instance.SystemMain.dzMainMenu.btnConsolidate.IsEnabled) |
572 |
{ |
573 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.btnConsolidate.IsEnabled = true; |
574 |
} |
575 |
} |
576 |
} |
577 |
|
578 |
/// <summary> |
579 |
/// 프로그램이 로딩되고 난 후 맨처음으로 MarkupInfo를 선택한다. |
580 |
/// </summary> |
581 |
private void SelectInitialMarkupInfo() |
582 |
{ |
583 |
if (!App.ViewInfo.CreateFinalPDFPermission && !App.ViewInfo.NewCommentPermission) |
584 |
{ |
585 |
#region Consolidate 항목이 있으면 Consolidate 항목만 추가 |
586 |
if (ViewerDataModel.Instance._markupInfoList.Any(x => x.Consolidate == 1 && x.AvoidConsolidate == 0)) |
587 |
{ |
588 |
var Consolidates = ViewerDataModel.Instance._markupInfoList.Where(x => x.Consolidate == 1 && x.AvoidConsolidate == 0).ToList(); |
589 |
Consolidates.ForEach(x => gridViewMarkup.SelectedItems.Add(x)); |
590 |
} |
591 |
#endregion |
592 |
#region Consolidate 항목이 없을 경우에는 사용자 별로 AvoidConsolidate를 제외한 우선 순위가 높은(Team,Comment)항목들을 선택 |
593 |
else |
594 |
{ |
595 |
var MarkupInfoColl = ViewerDataModel.Instance._markupInfoList.Where(x => x.AvoidConsolidate == 0).ToList(); |
596 |
|
597 |
#region Team consolidate 항목 선택 |
598 |
var Candidates = MarkupInfoColl.Where(x => x.PartConsolidate == 1 && x.AvoidConsolidate == 0).ToList(); |
599 |
MarkupInfoColl.RemoveAll(x => Candidates.Exists(y => y.UserID == x.UserID)); |
600 |
#endregion |
601 |
|
602 |
#region 추가되지 않은 사용자들을 추가 |
603 |
foreach (var item in MarkupInfoColl.Where(x => !Candidates.Exists(y => y.UserID == x.UserID))) |
604 |
{ |
605 |
Candidates.Add(item); |
606 |
} |
607 |
#endregion |
608 |
|
609 |
Candidates.ForEach(x => gridViewMarkup.SelectedItems.Add(x)); |
610 |
} |
611 |
#endregion |
612 |
} |
613 |
else if (!App.ViewInfo.CreateFinalPDFPermission && App.ViewInfo.NewCommentPermission) /// Eng'r Comment Mode |
614 |
{ |
615 |
var MarkupInfoColl = ViewerDataModel.Instance._markupInfoList.Where(x => x.AvoidConsolidate == 0).ToList(); |
616 |
|
617 |
#region Team consolidate 항목 선택 |
618 |
var Candidates = MarkupInfoColl.Where(x => x.PartConsolidate == 1 && x.AvoidConsolidate == 0).ToList(); |
619 |
MarkupInfoColl.RemoveAll(x => Candidates.Exists(y => y.UserID == x.UserID)); |
620 |
#endregion |
621 |
|
622 |
#region 추가되지 않은 사용자들을 추가 |
623 |
foreach (var item in MarkupInfoColl.Where(x => !Candidates.Exists(y => y.UserID == x.UserID))) |
624 |
{ |
625 |
Candidates.Add(item); |
626 |
} |
627 |
#endregion |
628 |
|
629 |
Candidates.ForEach(x => gridViewMarkup.SelectedItems.Add(x)); |
630 |
} |
631 |
else if (App.ViewInfo.CreateFinalPDFPermission) /// Orig Comment Model |
632 |
{ |
633 |
if (ViewerDataModel.Instance._markupInfoList.Any(x => x.Consolidate == 1 && x.AvoidConsolidate == 0)) |
634 |
{ |
635 |
var Consolidates = ViewerDataModel.Instance._markupInfoList.Where(x => x.Consolidate == 1 && x.AvoidConsolidate == 0).ToList(); |
636 |
Consolidates.ForEach(x => gridViewMarkup.SelectedItems.Add(x)); |
637 |
} |
638 |
else if (ViewerDataModel.Instance._markupInfoList.Any(x => x.PartConsolidate == 1 && x.AvoidConsolidate == 0)) |
639 |
{ |
640 |
var MarkupInfoColl = ViewerDataModel.Instance._markupInfoList.Where(x => x.AvoidConsolidate == 0).ToList(); |
641 |
|
642 |
#region Team consolidate 항목 선택 |
643 |
var Candidates = MarkupInfoColl.Where(x => x.PartConsolidate == 1 && x.AvoidConsolidate == 0).ToList(); |
644 |
MarkupInfoColl.RemoveAll(x => Candidates.Exists(y => y.UserID == x.UserID)); |
645 |
#endregion |
646 |
|
647 |
#region 추가되지 않은 사용자들을 추가 |
648 |
foreach (var item in MarkupInfoColl.Where(x => !Candidates.Exists(y => y.UserID == x.UserID))) |
649 |
{ |
650 |
Candidates.Add(item); |
651 |
} |
652 |
#endregion |
653 |
|
654 |
Candidates.ForEach(x => gridViewMarkup.SelectedItems.Add(x)); |
655 |
} |
656 |
else |
657 |
{ |
658 |
var Comments = ViewerDataModel.Instance._markupInfoList.Where(x => x.Consolidate == 0 && x.AvoidConsolidate == 0).ToList(); |
659 |
Comments.ForEach(x => gridViewMarkup.SelectedItems.Add(x)); |
660 |
} |
661 |
} |
662 |
|
663 |
if (!gridViewMarkup.SelectedItems.Any()) |
664 |
{ |
665 |
var SelectedItem = ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == App.ViewInfo.UserID).OrderByDescending(order => order.UpdateTime).FirstOrDefault(); |
666 |
|
667 |
if (PreviewUserMarkupInfoItem != null) |
668 |
{ |
669 |
this.gridViewMarkup.SelectedItem = PreviewUserMarkupInfoItem; |
670 |
} |
671 |
else if (SelectedItem != null) |
672 |
{ |
673 |
this.gridViewMarkup.SelectedItem = SelectedItem; |
674 |
} |
675 |
else if (ViewerDataModel.Instance._markupInfoList.Any()) |
676 |
{ |
677 |
this.gridViewMarkup.SelectedItem = ViewerDataModel.Instance._markupInfoList[0]; |
678 |
} |
679 |
} |
680 |
} |
681 |
|
682 |
private void GridViewMarkup_Sorting(object sender, GridViewSortingEventArgs e) |
683 |
{ |
684 |
IEnumerable<IKCOM.MarkupInfoItem> markuplist = e.DataControl.ItemsSource as IEnumerable<IKCOM.MarkupInfoItem>; |
685 |
|
686 |
if(markuplist == null) |
687 |
{ |
688 |
e.Cancel = true; |
689 |
return; |
690 |
} |
691 |
|
692 |
if(e.NewSortingState == SortingState.None) |
693 |
{ |
694 |
markuplist = markuplist.OrderByDescending(x => SortIndex(x)) |
695 |
.ThenBy(x => x.Depatment) |
696 |
.ThenBy(x => x.UserID); |
697 |
|
698 |
e.DataControl.ItemsSource = markuplist.ToList(); |
699 |
} |
700 |
} |
701 |
|
702 |
|
703 |
// 마크업 리스트 정렬 |
704 |
private int SortIndex(IKCOM.MarkupInfoItem markupInfoItem) |
705 |
{ |
706 |
int result = 0; |
707 |
|
708 |
// Consolidate은 최상단 |
709 |
if (markupInfoItem.Consolidate == 1) |
710 |
{ |
711 |
result += 2; |
712 |
} |
713 |
|
714 |
/// Consolidate 다음으로 우선순위 |
715 |
if (markupInfoItem.UserID == App.ViewInfo.UserID) |
716 |
{ |
717 |
result += 1; |
718 |
} |
719 |
|
720 |
return result; |
721 |
} |
722 |
|
723 |
|
724 |
private void GridViewMarkup_Sorted(object sender, GridViewSortedEventArgs e) |
725 |
{ |
726 |
|
727 |
} |
728 |
|
729 |
private async void gridViewRevMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) |
730 |
{ |
731 |
List<MarkupInfoItem> gridSelectionItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
732 |
//if (ViewerDataModel.Instance.PageBalanceNumber == 0) |
733 |
//{ |
734 |
// ViewerDataModel.Instance.PageBalanceNumber = 1; |
735 |
//} |
736 |
|
737 |
if (ViewerDataModel.Instance.SyncPageNumber == 0) |
738 |
{ |
739 |
ViewerDataModel.Instance.SyncPageNumber = 1; |
740 |
} |
741 |
if (e.AddedItems.Any()) |
742 |
{ |
743 |
foreach (var item in gridSelectionItem) |
744 |
{ |
745 |
//item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageBalanceNumber).ToList().ForEach(delegate (MarkupItem markupitem) |
746 |
//{ |
747 |
// layerControl.markupParse(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
748 |
//}); |
749 |
|
750 |
var pageItems = item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.SyncPageNumber).ToList(); |
751 |
|
752 |
foreach (var markupitem in pageItems) |
753 |
{ |
754 |
await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, ViewerDataModel.Instance.PageAngle, item.DisplayColor, "", item.MarkupInfoID, |
755 |
STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
756 |
} |
757 |
} |
758 |
} |
759 |
else if (e.RemovedItems.Any()) |
760 |
{ |
761 |
var _infoItem = e.RemovedItems.Cast<MarkupInfoItem>().ToList(); |
762 |
|
763 |
(from A in _infoItem |
764 |
from B in Common.ViewerDataModel.Instance.MarkupControls_Sync |
765 |
where A.MarkupInfoID == B.MarkupInfoID |
766 |
select B).ToList().ForEach(data => |
767 |
{ |
768 |
Common.ViewerDataModel.Instance.MarkupControls_Sync.Remove(data); |
769 |
}); |
770 |
} |
771 |
} |
772 |
|
773 |
/// <summary> |
774 |
/// 선택한 항목은 Visibility = Visible, 해제한 항목은 Visibility = Hidden 처리한다. |
775 |
/// </summary> |
776 |
/// <param name="sender"></param> |
777 |
/// <param name="e"></param> |
778 |
private async void gridViewMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) |
779 |
{ |
780 |
|
781 |
foreach (var item in e.AddedItems) |
782 |
{ |
783 |
var cellToSelect = new GridViewCellInfo(item, this.gridViewMarkup.Columns["color"], this.gridViewMarkup); |
784 |
|
785 |
if(cellToSelect != null) |
786 |
{ |
787 |
|
788 |
} |
789 |
} |
790 |
|
791 |
SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu); |
792 |
|
793 |
var dataSet = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().Where(data => data.UserID == _ViewInfo.UserID); |
794 |
var dataSet_User = gridViewMarkup.Items.Cast<MarkupInfoItem>().Where(data => data.UserID == _ViewInfo.UserID); |
795 |
var resultA = (from item_Select in dataSet |
796 |
from item_Non in dataSet_User |
797 |
where item_Select == item_Non |
798 |
select item_Non).ToList(); |
799 |
|
800 |
if (resultA.Count() >= 2) |
801 |
{ |
802 |
// 동일한 사용자 데이터가 두개 이상 선택됩니다. Consolidation을 선택할까요? |
803 |
RadWindow.Confirm(new DialogParameters |
804 |
{ |
805 |
Owner = Application.Current.MainWindow, |
806 |
Header = "Info", |
807 |
Content = "Selected more than two identical user data. Do you want to select consolidation?", |
808 |
Closed = new EventHandler<WindowClosedEventArgs>((sen, ea) => |
809 |
{ |
810 |
if(ea.DialogResult == null) |
811 |
{ |
812 |
return; |
813 |
} |
814 |
if (e.AddedItems.Count() == 1) |
815 |
{ |
816 |
MarkupInfoItem instanceItem = e.AddedItems.FirstOrDefault() as MarkupInfoItem; |
817 |
gridViewMarkup.SelectedItem = null; |
818 |
|
819 |
|
820 |
if (ea.DialogResult.Value) |
821 |
{ |
822 |
if (instanceItem.Consolidate == 1 || instanceItem.PartConsolidate == 1) |
823 |
{ |
824 |
gridViewMarkup.SelectedItem = instanceItem; |
825 |
} |
826 |
else |
827 |
{ |
828 |
//1. Consolidations이 있다면 하나 선택 |
829 |
var Consolidations = resultA.Where(item => (item.Consolidate == 1 || item.PartConsolidate == 1)); |
830 |
|
831 |
if (Consolidations.Count() > 0) |
832 |
{ |
833 |
gridViewMarkup.SelectedItem = Consolidations.First(); |
834 |
} |
835 |
} |
836 |
|
837 |
} |
838 |
else { |
839 |
//1. Consolidations 아닌게 있다면 Change |
840 |
var notConsolidations = resultA.Where(item => !(item.Consolidate == 1 || item.PartConsolidate == 1)); |
841 |
|
842 |
if(notConsolidations.Count() > 0) { |
843 |
gridViewMarkup.SelectedItem = notConsolidations.First(); |
844 |
} |
845 |
else {//1. Consolidations 아닌게 없다면 그대로 |
846 |
gridViewMarkup.SelectedItem = instanceItem; |
847 |
} |
848 |
|
849 |
} |
850 |
} |
851 |
}), |
852 |
Theme = new Windows8Theme(), |
853 |
ModalBackground = new System.Windows.Media.SolidColorBrush { Color = System.Windows.Media.Colors.Black, Opacity = 0.6 }, |
854 |
}); |
855 |
} |
856 |
else //파라미터로 넘어온 사용자가 걸리지 않은 경우 |
857 |
{ |
858 |
List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
859 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
860 |
List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
861 |
#region 코멘트 보기 |
862 |
if (e.AddedItems.Count() > 0 && this.pageNavigator.CurrentPage != null) |
863 |
{ |
864 |
foreach (var item in gridSelectionItem) |
865 |
{ |
866 |
if (item.UserID == App.ViewInfo.UserID) |
867 |
{ |
868 |
var controls = Common.ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
869 |
if (controls.Count == 0) |
870 |
{ |
871 |
var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == this.pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
872 |
|
873 |
foreach (var markup in instance) |
874 |
{ |
875 |
await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, ViewerDataModel.Instance.PageAngle, item.DisplayColor, "", |
876 |
item.MarkupInfoID, markup.ID, STAMP_Contents:App.SystemInfo.STAMP_CONTENTS); |
877 |
} |
878 |
} |
879 |
|
880 |
controls = Common.ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
881 |
foreach (var control in controls) |
882 |
{ |
883 |
Logger.sendCheckLog(String.Format("=={0}", control), 1); |
884 |
control.Visibility = Visibility.Visible; |
885 |
} |
886 |
} |
887 |
else |
888 |
{ |
889 |
var controls = Common.ViewerDataModel.Instance.MarkupControls.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
890 |
if (controls.Count == 0) |
891 |
{ |
892 |
var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == this.pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
893 |
foreach (var markup in instance) |
894 |
{ |
895 |
await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, ViewerDataModel.Instance.PageAngle, item.DisplayColor, "", |
896 |
item.MarkupInfoID, markup.ID, STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
897 |
} |
898 |
} |
899 |
|
900 |
controls = Common.ViewerDataModel.Instance.MarkupControls.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
901 |
foreach (var control in controls) |
902 |
{ |
903 |
control.Visibility = Visibility.Visible; |
904 |
} |
905 |
} |
906 |
} |
907 |
} |
908 |
#endregion |
909 |
#region 코멘트 숨기기 |
910 |
else if (e.RemovedItems.Count > 0) |
911 |
{ |
912 |
var _infoItem = e.RemovedItems.Cast<MarkupInfoItem>().ToList(); |
913 |
|
914 |
(from A in _infoItem |
915 |
from B in Common.ViewerDataModel.Instance.MarkupControls |
916 |
where A.MarkupInfoID == B.MarkupInfoID |
917 |
select B).ToList().ForEach(data => |
918 |
{ |
919 |
data.Visibility = Visibility.Hidden; |
920 |
}); |
921 |
|
922 |
|
923 |
var myComment = _infoItem.Where(d => d.UserID == App.ViewInfo.UserID).FirstOrDefault(); |
924 |
if (myComment != null) |
925 |
{ |
926 |
Common.ViewerDataModel.Instance.MarkupControls_USER.ToList().ForEach(delegate (MarkupToPDF.Common.CommentUserInfo markupitem) |
927 |
{ |
928 |
markupitem.Visibility = Visibility.Hidden; |
929 |
}); |
930 |
} |
931 |
} |
932 |
#endregion |
933 |
} |
934 |
} |
935 |
|
936 |
private async void gridViewMarkup_SelectedCellsChanged(object sender, Telerik.Windows.Controls.GridView.GridViewSelectedCellsChangedEventArgs e) |
937 |
{ |
938 |
if (e.AddedCells.Count() > 0) |
939 |
{ |
940 |
if(e.AddedCells[0].Column.Name == "color") |
941 |
{ |
942 |
|
943 |
} |
944 |
else |
945 |
{ |
946 |
List<MarkupInfoItem> removeItems = new List<MarkupInfoItem>(); |
947 |
|
948 |
if (!gridViewMarkup.SelectedItems.Contains(e.AddedCells[0].Item)) |
949 |
{ |
950 |
gridViewMarkup.SelectedItems.Add(e.AddedCells[0].Item); |
951 |
} |
952 |
else |
953 |
{ |
954 |
gridViewMarkup.Unselect(new[] { e.AddedCells[0].Item }); |
955 |
|
956 |
removeItems.Add(e.AddedCells[0].Item as MarkupInfoItem); |
957 |
} |
958 |
|
959 |
SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu); |
960 |
|
961 |
var dataSet = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().Where(data => data.UserID == _ViewInfo.UserID); |
962 |
var dataSet_User = gridViewMarkup.Items.Cast<MarkupInfoItem>().Where(data => data.UserID == _ViewInfo.UserID); |
963 |
var resultA = (from item_Select in dataSet |
964 |
from item_Non in dataSet_User |
965 |
where item_Select == item_Non |
966 |
select item_Non).ToList(); |
967 |
|
968 |
if (resultA.Count() >= 2) |
969 |
{ |
970 |
// 동일한 사용자 데이터가 두개 이상 선택됩니다. Consolidation을 선택할까요? |
971 |
RadWindow.Confirm(new DialogParameters |
972 |
{ |
973 |
Owner = Application.Current.MainWindow, |
974 |
Header = "Info", |
975 |
Content = "Selected more than two identical user data. Do you want to select consolidation?", |
976 |
Closed = new EventHandler<WindowClosedEventArgs>((sen, ea) => |
977 |
{ |
978 |
if (ea.DialogResult == null) |
979 |
{ |
980 |
return; |
981 |
} |
982 |
if (gridViewMarkup.SelectedItems.Count() == 1) |
983 |
{ |
984 |
MarkupInfoItem instanceItem = gridViewMarkup.SelectedItems.FirstOrDefault() as MarkupInfoItem; |
985 |
gridViewMarkup.SelectedItem = null; |
986 |
|
987 |
|
988 |
if (ea.DialogResult.Value) |
989 |
{ |
990 |
if (instanceItem.Consolidate == 1 || instanceItem.PartConsolidate == 1) |
991 |
{ |
992 |
gridViewMarkup.SelectedItem = instanceItem; |
993 |
} |
994 |
else |
995 |
{ |
996 |
//1. Consolidations이 있다면 하나 선택 |
997 |
var Consolidations = resultA.Where(item => (item.Consolidate == 1 || item.PartConsolidate == 1)); |
998 |
|
999 |
if (Consolidations.Count() > 0) |
1000 |
{ |
1001 |
gridViewMarkup.SelectedItem = Consolidations.First(); |
1002 |
} |
1003 |
} |
1004 |
|
1005 |
} |
1006 |
else |
1007 |
{ |
1008 |
//1. Consolidations 아닌게 있다면 Change |
1009 |
var notConsolidations = resultA.Where(item => !(item.Consolidate == 1 || item.PartConsolidate == 1)); |
1010 |
|
1011 |
if (notConsolidations.Count() > 0) |
1012 |
{ |
1013 |
gridViewMarkup.SelectedItem = notConsolidations.First(); |
1014 |
} |
1015 |
else |
1016 |
{//1. Consolidations 아닌게 없다면 그대로 |
1017 |
gridViewMarkup.SelectedItem = instanceItem; |
1018 |
} |
1019 |
|
1020 |
} |
1021 |
} |
1022 |
}), |
1023 |
Theme = new Windows8Theme(), |
1024 |
ModalBackground = new System.Windows.Media.SolidColorBrush { Color = System.Windows.Media.Colors.Black, Opacity = 0.6 }, |
1025 |
}); |
1026 |
} |
1027 |
else //파라미터로 넘어온 사용자가 걸리지 않은 경우 |
1028 |
{ |
1029 |
List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
1030 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
1031 |
List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
1032 |
#region 코멘트 보기 |
1033 |
if (gridViewMarkup.SelectedItems.Count() > 0 && this.pageNavigator.CurrentPage != null) |
1034 |
{ |
1035 |
foreach (var item in gridSelectionItem) |
1036 |
{ |
1037 |
if (item.UserID == App.ViewInfo.UserID) |
1038 |
{ |
1039 |
var controls = Common.ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
1040 |
if (controls.Count == 0) |
1041 |
{ |
1042 |
var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == this.pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
1043 |
|
1044 |
foreach (var markup in instance) |
1045 |
{ |
1046 |
await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, ViewerDataModel.Instance.PageAngle, item.DisplayColor, "", |
1047 |
item.MarkupInfoID, markup.ID, STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
1048 |
} |
1049 |
} |
1050 |
|
1051 |
controls = Common.ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
1052 |
foreach (var control in controls) |
1053 |
{ |
1054 |
Logger.sendCheckLog(String.Format("=={0}", control), 1); |
1055 |
control.Visibility = Visibility.Visible; |
1056 |
} |
1057 |
} |
1058 |
else |
1059 |
{ |
1060 |
var controls = Common.ViewerDataModel.Instance.MarkupControls.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
1061 |
if (controls.Count == 0) |
1062 |
{ |
1063 |
var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == this.pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
1064 |
foreach (var markup in instance) |
1065 |
{ |
1066 |
await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, ViewerDataModel.Instance.PageAngle, item.DisplayColor, "", |
1067 |
item.MarkupInfoID, markup.ID, STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
1068 |
} |
1069 |
} |
1070 |
|
1071 |
controls = Common.ViewerDataModel.Instance.MarkupControls.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList(); |
1072 |
foreach (var control in controls) |
1073 |
{ |
1074 |
control.Visibility = Visibility.Visible; |
1075 |
} |
1076 |
} |
1077 |
} |
1078 |
} |
1079 |
#endregion |
1080 |
#region 코멘트 숨기기 |
1081 |
else if (removeItems.Count > 0) |
1082 |
{ |
1083 |
(from A in removeItems |
1084 |
from B in Common.ViewerDataModel.Instance.MarkupControls |
1085 |
where A.MarkupInfoID == B.MarkupInfoID |
1086 |
select B).ToList().ForEach(data => |
1087 |
{ |
1088 |
data.Visibility = Visibility.Hidden; |
1089 |
}); |
1090 |
|
1091 |
|
1092 |
var myComment = removeItems.Where(d => d.UserID == App.ViewInfo.UserID).FirstOrDefault(); |
1093 |
if (myComment != null) |
1094 |
{ |
1095 |
Common.ViewerDataModel.Instance.MarkupControls_USER.ToList().ForEach(delegate (MarkupToPDF.Common.CommentUserInfo markupitem) |
1096 |
{ |
1097 |
markupitem.Visibility = Visibility.Hidden; |
1098 |
}); |
1099 |
} |
1100 |
} |
1101 |
#endregion |
1102 |
} |
1103 |
} |
1104 |
} |
1105 |
} |
1106 |
|
1107 |
private void BaseClient_GetDocumentItemInfoCompleted(object sender, GetDocumentItemInfoCompletedEventArgs e) |
1108 |
{ |
1109 |
//Logger.sendResLog("GetDocumentItemInfoCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result?.DOCUMENT_ID + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
1110 |
|
1111 |
if (e.Result != null) |
1112 |
{ |
1113 |
_DocItem = e.Result; |
1114 |
|
1115 |
if (e.Result.DOCUMENT_NO == "" && e.Result.DOCUMENT_NAME == "" && e.Result.GROUP_NO == "0") |
1116 |
{ |
1117 |
_ViewInfo.UserID = _ViewInfo.UserID.Replace(@"DAELIM\", ""); |
1118 |
} |
1119 |
////Logger.sendReqLog("GetDocInfoAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID, 1); |
1120 |
BaseClient.GetDocInfoAsync(new KCOM_BasicParam { projectNo = _ViewInfo.ProjectNO, documentID = _ViewInfo.DocumentItemID }); |
1121 |
} |
1122 |
else |
1123 |
{ |
1124 |
DialogMessage_Alert("Document Information Not Found.", "Error"); |
1125 |
|
1126 |
BaseClient.GetCheckSystemAdminCompleted += (sen, ea) => |
1127 |
{ |
1128 |
//Logger.sendResLog("GetCheckSystemAdminCompleted", "UserState : " + ea.UserState + "\r Result :" + ea.Result + "\r Cancelled :" + ea.Cancelled + "\r Error :" + ea.Error, 1); |
1129 |
|
1130 |
if (ea.Error == null) |
1131 |
{ |
1132 |
if (ea.Result) |
1133 |
{ |
1134 |
this._ViewInfo.isAdmin = true; |
1135 |
//Logger.sendReqLog("GetDocInfoAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID, 1); |
1136 |
BaseClient.GetDocInfoAsync(new KCOM_BasicParam { projectNo = _ViewInfo.ProjectNO, documentID = _ViewInfo.DocumentItemID }); |
1137 |
} |
1138 |
else |
1139 |
{ |
1140 |
//System.Windows.Forms.MessageBox.Show("해당 프로젝트에 가입되지 않은 유저입니다. 관리자에게 등록신청을 해주세요", "안내"); |
1141 |
DialogMessage_Alert("You are not belong to this project. Please ask admin for an authority.", "Info"); |
1142 |
//this.ParentOfType<MainPage>().DialogMessage_Alert("해당 프로젝트에 가입되지 않은 유저입니다. 관리자에게 등록신청을 해주세요", "안내"); |
1143 |
} |
1144 |
|
1145 |
} |
1146 |
else |
1147 |
{ |
1148 |
//System.Windows.Browser.HtmlPage.Window.Invoke("close"); |
1149 |
} |
1150 |
}; |
1151 |
//Logger.sendReqLog("GetCheckSystemAdminAsync", _ViewInfo.UserID, 1); |
1152 |
BaseClient.GetCheckSystemAdminAsync(this._ViewInfo.UserID); |
1153 |
} |
1154 |
} |
1155 |
|
1156 |
private void BaseClient_GetSystemDataCompleted(object sender, GetSystemDataCompletedEventArgs e) |
1157 |
{ |
1158 |
//Logger.sendResLog("GetSystemDataCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1); |
1159 |
|
1160 |
if (e.Error == null && e.Result != null) |
1161 |
{ |
1162 |
App.SystemInfo = e.Result; |
1163 |
|
1164 |
//App.urlPort_DB = App.SystemInfo.HostPort; |
1165 |
//App.urlHost_DB = App.SystemInfo.HostName; |
1166 |
//Logger.sendReqLog("GetConversionStateAsync", _ViewInfo.ProjectNO + "," + _ViewInfo.DocumentItemID, 1); |
1167 |
BaseClient.GetConversionStateAsync(new KCOM_BasicParam { projectNo = _ViewInfo.ProjectNO, documentID = _ViewInfo.DocumentItemID }); |
1168 |
|
1169 |
//if (App.urlHost.Contains("localhost")) |
1170 |
//{ |
1171 |
// App.urlHost = App.urlHost_DB; |
1172 |
//} |
1173 |
} |
1174 |
} |
1175 |
|
1176 |
private void BaseClient_GetConversionStateCompleted(object sender, GetConversionStateCompletedEventArgs e) |
1177 |
{ |
1178 |
if (e.Error == null && e.Result) |
1179 |
{ |
1180 |
BaseClient.GetDocumentItemInfoAsync(new KCOM_BasicParam { projectNo = _ViewInfo.ProjectNO, documentID = _ViewInfo.DocumentItemID, userID = _ViewInfo.UserID }); |
1181 |
|
1182 |
if (App.ViewInfo != null && App.ViewInfo.ProjectNO != "") |
1183 |
{ |
1184 |
userData = BaseClient.GetMember(App.ViewInfo.ProjectNO, App.ViewInfo.UserID); |
1185 |
if (userData != null) |
1186 |
{ |
1187 |
BaseClient.GetDeptDataAsync(userData.DEPARTMENT); |
1188 |
} |
1189 |
else |
1190 |
{ |
1191 |
userData = new MEMBER(); |
1192 |
userData.DEPARTMENT = "ALL"; |
1193 |
BaseClient.GetDeptDataAsync(userData.DEPARTMENT); |
1194 |
} |
1195 |
} |
1196 |
} |
1197 |
else |
1198 |
{ |
1199 |
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잠시만 기다려 주신 후 다시 열람하여 주시기 바랍니다"); |
1200 |
DialogMessage_Alert(failedmsg, "Warning"); |
1201 |
} |
1202 |
} |
1203 |
|
1204 |
public void SetView(ViewInfo info) |
1205 |
{ |
1206 |
this._ViewInfo = info; |
1207 |
try |
1208 |
{ |
1209 |
/// 대림의 경우 EnsembleID를 가지고 DocumentItemID를 구함 |
1210 |
/// 다른 Site를 대비하여 에러 처리함 |
1211 |
string docid = BaseClient.GetDocItemID(info.EnsembleID); |
1212 |
if (!string.IsNullOrEmpty(docid)) |
1213 |
{ |
1214 |
this._ViewInfo.DocumentItemID = docid; |
1215 |
} |
1216 |
} |
1217 |
catch (Exception ex) |
1218 |
{ |
1219 |
|
1220 |
//App.FileLogger.Fatal(ex); |
1221 |
} |
1222 |
|
1223 |
//Logger.sendReqLog("GetSystemDataAsync", "", 1); |
1224 |
|
1225 |
BaseClient.GetSystemDataAsync(); |
1226 |
} |
1227 |
|
1228 |
public void HubSet() |
1229 |
{ |
1230 |
// 허브 연결 구성 |
1231 |
var hubConnection = new HubConnection(CommonLib.Common.GetConfigString("HubAddress", "URL", "", App.isExternal)); |
1232 |
IHubProxy MarkusLicenseProxy = hubConnection.CreateHubProxy("MarkusLicenseHub"); |
1233 |
|
1234 |
|
1235 |
// 허브 연결 |
1236 |
hubConnection.Start().ContinueWith(task => |
1237 |
{ |
1238 |
if (task.IsFaulted) |
1239 |
{ |
1240 |
Console.WriteLine("There was an error opening the connection:{0}", |
1241 |
task.Exception.GetBaseException()); |
1242 |
//throw task.Exception.GetBaseException(); |
1243 |
} |
1244 |
else |
1245 |
{ |
1246 |
Console.WriteLine("Connected :: " + task.Id); |
1247 |
} |
1248 |
|
1249 |
}).Wait(); |
1250 |
|
1251 |
|
1252 |
// [ 프로그램 시작 ] |
1253 |
// 클라이언트에서 서버를 호출 ( 접속 시 ) : 라이센스 체크 |
1254 |
//( "method name", arg1, arg2 ) |
1255 |
//MarkusLicenseProxy.Invoke<string>("ConnectionMarkus", "H2009115", "고동균").ContinueWith(task => |
1256 |
//{ |
1257 |
// if (task.IsFaulted) |
1258 |
// { |
1259 |
// Console.WriteLine("ConnectionMarkus :: There was an error calling send: {0}", task.Exception.GetBaseException()); |
1260 |
// } |
1261 |
// else |
1262 |
// { |
1263 |
// Console.WriteLine(task.Result); |
1264 |
// } |
1265 |
//}); |
1266 |
MarkusLicenseProxy.Invoke<string>("ConnectionMarkus", App.ViewInfo.UserID,App.ViewInfo.ProjectNO).ContinueWith(task => |
1267 |
{ |
1268 |
if (task.IsFaulted) |
1269 |
{ |
1270 |
Console.WriteLine("ConnectionMarkus :: There was an error calling send: {0}", task.Exception.GetBaseException()); |
1271 |
//throw task.Exception.GetBaseException(); |
1272 |
} |
1273 |
else |
1274 |
{ |
1275 |
switch (task.Result) |
1276 |
{ |
1277 |
case "2": |
1278 |
{ |
1279 |
var result = MessageBox.Show("권한이 없습니다."); |
1280 |
if (result == MessageBoxResult.OK) |
1281 |
System.Diagnostics.Process.GetCurrentProcess().Kill(); |
1282 |
} |
1283 |
break; |
1284 |
case "404": |
1285 |
{ |
1286 |
var result = MessageBox.Show("등록된 사용자가 아닙니다."); |
1287 |
if(result == MessageBoxResult.OK) |
1288 |
System.Diagnostics.Process.GetCurrentProcess().Kill(); |
1289 |
} |
1290 |
break; |
1291 |
} |
1292 |
} |
1293 |
}); |
1294 |
|
1295 |
// 서버에서 클라이언트 호출 ( 프로그램 구동여부 ) : 라이센스 체크 후 응답 ( 반환값 : true, false ) |
1296 |
//MarkusLicenseProxy.On<bool>("IsConnection", status => |
1297 |
//{ |
1298 |
|
1299 |
// if (status) |
1300 |
// { |
1301 |
// // 프로그램 시작 |
1302 |
// Console.WriteLine("connection status : " + status); |
1303 |
// } |
1304 |
// else |
1305 |
// { |
1306 |
// // 프로그램 종료 ( signalr 접속 끊기 ) |
1307 |
// hubConnection.Stop(); |
1308 |
// } |
1309 |
//}); |
1310 |
|
1311 |
// 공지 메세지 ( 서버에서 클라이언트 호출 ) |
1312 |
MarkusLicenseProxy.On<string>("MarkusNotification", msg => |
1313 |
Console.WriteLine("Noficiation Message : " + msg) |
1314 |
); |
1315 |
|
1316 |
|
1317 |
// 서버 메서드 호출 |
1318 |
//MarkusLicenseProxy.Invoke<string>("DoSomething", "I'm doing something!!!").Wait(); |
1319 |
|
1320 |
//Console.ReadKey(); |
1321 |
|
1322 |
//hubConnection.Stop(); |
1323 |
} |
1324 |
|
1325 |
public async void MarkupUserListDisplay() |
1326 |
{ |
1327 |
List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
1328 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
1329 |
List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
1330 |
//MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl(); |
1331 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Clear(); //전체 제거 |
1332 |
Common.ViewerDataModel.Instance.MarkupControls.Clear(); //전체 제거 |
1333 |
//foreach (var item in gridSelectionItem) |
1334 |
//{ |
1335 |
// if (item.UserID == App.ViewInfo.UserID) |
1336 |
// { |
1337 |
// ViewerDataModel.Instance.MyMarkupList.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
1338 |
// { |
1339 |
// layerControl.markupParseEx(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markupitem.ID); |
1340 |
// }); |
1341 |
// } |
1342 |
// else |
1343 |
// { |
1344 |
// ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
1345 |
// { |
1346 |
// layerControl.markupParse(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID); |
1347 |
// }); |
1348 |
// } |
1349 |
//} |
1350 |
(from A in gridSelectionItem |
1351 |
from B in Common.ViewerDataModel.Instance.MarkupControls_USER |
1352 |
where A.MarkupInfoID == B.MarkupInfoID |
1353 |
select B).ToList().ForEach(data => |
1354 |
{ |
1355 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(data); |
1356 |
}); |
1357 |
(from A in gridSelectionItem |
1358 |
from B in Common.ViewerDataModel.Instance.MarkupControls |
1359 |
where A.MarkupInfoID == B.MarkupInfoID |
1360 |
select B).ToList().ForEach(data => |
1361 |
{ |
1362 |
Common.ViewerDataModel.Instance.MarkupControls.Remove(data); |
1363 |
}); |
1364 |
|
1365 |
foreach (var item in gridSelectionItem) |
1366 |
{ |
1367 |
|
1368 |
if (item.UserID == App.ViewInfo.UserID) |
1369 |
{ |
1370 |
var markupItems = ViewerDataModel.Instance.MyMarkupList.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList(); |
1371 |
|
1372 |
foreach (var markupitem in markupItems) |
1373 |
{ |
1374 |
await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, ViewerDataModel.Instance.PageAngle, item.DisplayColor, "", |
1375 |
item.MarkupInfoID, markupitem.ID, STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
1376 |
} |
1377 |
} |
1378 |
else |
1379 |
{ |
1380 |
var markupItems = ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList(); |
1381 |
|
1382 |
foreach (var markupitem in markupItems) |
1383 |
{ |
1384 |
await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls, ViewerDataModel.Instance.PageAngle, item.DisplayColor, "", item.MarkupInfoID, |
1385 |
STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
1386 |
} |
1387 |
} |
1388 |
} |
1389 |
} |
1390 |
} |
1391 |
} |