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