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