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