개정판 472d507b
RadMenuItem 수정(클릭된 row만 들어감), convert수정, 양 많은 페이지수 kill ~ing
Change-Id: I9601ee62b16c57e4a967c2593dbd6697c96ec180
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs | ||
---|---|---|
1148 | 1148 |
|
1149 | 1149 |
private async void DataConvert(object obj) |
1150 | 1150 |
{ |
1151 |
if (SelectFilterConvertList == null) |
|
1151 |
if (obj is ConvertPDF) |
|
1152 |
{ |
|
1153 |
|
|
1154 |
if (obj != null) |
|
1155 |
{ |
|
1156 |
var convertitem = obj as ConvertPDF; |
|
1157 |
|
|
1158 |
SelectRealConvert = convertitem; |
|
1159 |
SetCleanUpItem(SelectRealConvert); |
|
1160 |
|
|
1161 |
|
|
1162 |
var items = from x in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(SelectRealConvert.ConvertID, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null) |
|
1163 |
let MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech") |
|
1164 |
select new ConvertPDF(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE, x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME |
|
1165 |
, x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER); |
|
1166 |
|
|
1167 |
foreach (var item in items) |
|
1168 |
{ |
|
1169 |
if (RealConvertSource.Count(x => x.ConvertID == item.ConvertID) < 1) |
|
1170 |
{ |
|
1171 |
RealConvertSource.Add(item); |
|
1172 |
} |
|
1173 |
if (RealConvertSource.Count() == 1) |
|
1174 |
{ |
|
1175 |
ConvertShow = true; |
|
1176 |
} |
|
1177 |
} |
|
1178 |
} |
|
1179 |
} |
|
1180 |
else if (SelectFilterConvertList == null) |
|
1152 | 1181 |
{ |
1153 | 1182 |
MessageBox.Show("왼쪽 버튼 클릭 후 Converter 해주세요!"); |
1154 | 1183 |
} |
1155 | 1184 |
else |
1156 | 1185 |
{ |
1157 |
if (SelectRealConvert != null) |
|
1158 |
{ |
|
1159 |
SetCleanUpItem(SelectRealConvert); |
|
1160 |
} |
|
1161 | 1186 |
if (SelectFilterConvertList != null) |
1162 | 1187 |
{ |
1163 | 1188 |
foreach (var SelectFilterConvert in SelectFilterConvertList) |
... | ... | |
1237 | 1262 |
|
1238 | 1263 |
private void DataValidate(object obj) |
1239 | 1264 |
{ |
1240 |
if (SelectFilterConvertList.Count() > 1) |
|
1265 |
if (obj is ConvertPDF) |
|
1266 |
{ |
|
1267 |
|
|
1268 |
if (obj != null) |
|
1269 |
{ |
|
1270 |
var convertitem = obj as ConvertPDF; |
|
1271 |
|
|
1272 |
SelectRealConvert = convertitem; |
|
1273 |
|
|
1274 |
bool result = false; |
|
1275 |
WebRequest webRequest = WebRequest.Create(SelectRealConvert.OriginfilePath); |
|
1276 |
webRequest.Timeout = 1200; // miliseconds |
|
1277 |
webRequest.Method = "HEAD"; |
|
1278 |
|
|
1279 |
HttpWebResponse response = null; |
|
1280 |
|
|
1281 |
try |
|
1282 |
{ |
|
1283 |
response = (HttpWebResponse)webRequest.GetResponse(); |
|
1284 |
result = true; |
|
1285 |
} |
|
1286 |
catch (WebException webException) |
|
1287 |
{ |
|
1288 |
MessageBox.Show(SelectRealConvert.FileName + " doesn't exist: " + webException.Message); |
|
1289 |
result = true; |
|
1290 |
} |
|
1291 |
finally |
|
1292 |
{ |
|
1293 |
if (response != null) |
|
1294 |
{ |
|
1295 |
response.Close(); |
|
1296 |
} |
|
1297 |
} |
|
1298 |
if (result == true) |
|
1299 |
{ |
|
1300 |
MessageBox.Show("File exists"); |
|
1301 |
} |
|
1302 |
} |
|
1303 |
} |
|
1304 |
else if (SelectFilterConvertList.Count() > 1) |
|
1241 | 1305 |
{ |
1242 | 1306 |
MessageBox.Show("하나만 클릭해 주세요"); |
1243 | 1307 |
} |
1308 |
else if (SelectFilterConvertList.Count() == 0) |
|
1309 |
{ |
|
1310 |
MessageBox.Show("왼쪽 버튼 클릭 후 Validate 해주세요!"); |
|
1311 |
} |
|
1244 | 1312 |
else |
1245 | 1313 |
{ |
1246 | 1314 |
bool result = false; |
... | ... | |
1290 | 1358 |
var result = e.DialogResult; |
1291 | 1359 |
if (result == true) |
1292 | 1360 |
{ |
1293 |
if (SelectFilterConvertList.Count() > 1) |
|
1361 |
if (sender is ConvertPDF) |
|
1362 |
{ |
|
1363 |
if (sender != null) |
|
1364 |
{ |
|
1365 |
var convertitem = sender as ConvertPDF; |
|
1366 |
|
|
1367 |
SelectRealConvert = convertitem; |
|
1368 |
await WcfClient.GET_SELECT_CONVERT_DELETEAsync(SelectRealConvert.ConvertID); |
|
1369 |
|
|
1370 |
} |
|
1371 |
} |
|
1372 |
else if (SelectFilterConvertList.Count() > 1) |
|
1294 | 1373 |
{ |
1295 | 1374 |
MessageBox.Show("하나만 클릭해 주세요!"); |
1296 | 1375 |
} |
1376 |
else if (SelectFilterConvertList.Count() == 0) |
|
1377 |
{ |
|
1378 |
MessageBox.Show("왼쪽 버튼 클릭 후 Delete 해주세요!"); |
|
1379 |
} |
|
1297 | 1380 |
else |
1298 | 1381 |
{ |
1299 |
if (SelectRealConvert != null) |
|
1300 |
{ |
|
1301 |
await WcfClient.GET_SELECT_CONVERT_DELETEAsync(SelectRealConvert.ConvertID); |
|
1302 |
} |
|
1303 | 1382 |
if (SelectFilterConvertList != null) |
1304 | 1383 |
{ |
1305 | 1384 |
await WcfClient.GET_SELECT_CONVERT_DELETEAsync(SelectFilterConvertList[0].ConvertID); |
... | ... | |
1317 | 1396 |
|
1318 | 1397 |
string convertid = ""; |
1319 | 1398 |
|
1320 |
//#if DEBUG |
|
1321 |
// convertid = "TEST"; |
|
1322 |
//#else |
|
1323 |
if (SelectRealConvert != null) |
|
1324 |
{ |
|
1325 |
if (AliveItems.Count(x => x.ConvertID == SelectRealConvert.ConvertID) == 0) |
|
1326 |
{ |
|
1327 |
convertid = SelectRealConvert.ConvertID; |
|
1328 |
} |
|
1329 |
} |
|
1330 |
if (SelectAliveConvert != null) |
|
1399 |
if (obj is ConvertPDF) |
|
1331 | 1400 |
{ |
1332 |
if (RealConvertSource.Count(x => x.ConvertID == SelectAliveConvert.ConvertID) == 0) |
|
1401 |
|
|
1402 |
if (obj != null) |
|
1333 | 1403 |
{ |
1334 |
convertid = SelectAliveConvert.ConvertID; |
|
1404 |
var convertitem = obj as ConvertPDF; |
|
1405 |
|
|
1406 |
SelectRealConvert = convertitem; |
|
1407 |
|
|
1408 |
SelectAliveConvert = convertitem; |
|
1409 |
|
|
1410 |
convertid = convertitem.ConvertID; |
|
1335 | 1411 |
} |
1336 | 1412 |
} |
1337 |
//#endif |
|
1413 |
|
|
1414 |
|
|
1415 |
#if DEBUG |
|
1416 |
convertid = "TEST"; |
|
1417 |
#endif |
|
1338 | 1418 |
|
1339 | 1419 |
EventHandler<WindowClosedEventArgs> handler = (snd, evt) => |
1340 | 1420 |
{ |
... | ... | |
1360 | 1440 |
try |
1361 | 1441 |
{ |
1362 | 1442 |
var commandLines = process[i].Arguments().CommandLine; |
1363 |
|
|
1364 | 1443 |
if (commandLines.Count() > 0) |
1365 | 1444 |
{ |
1445 |
System.Threading.Thread.Sleep(new TimeSpan(0, 0, 0, 5)); |
|
1366 | 1446 |
if (commandLines[0] == convertId) |
1367 | 1447 |
{ |
1448 |
|
|
1449 |
MessageBox.Show("commandLines[0]: " + commandLines[0] + "convertId: " + convertId); |
|
1450 |
|
|
1368 | 1451 |
var _CREATE_DATETIME = DateTime.Now; |
1369 | 1452 |
|
1370 | 1453 |
await WcfClient.GET_SELECT_RERECONVERT_ITEMAsync(convertId, 2, _CREATE_DATETIME, 3, null); |
1371 |
process[i].WaitForExit(3000); |
|
1372 |
await WcfClient.GET_SELECT_RERECONVERT_ITEMAsync(convertId, 2, _CREATE_DATETIME, 99, null);//작업 관리자에 값이 들어가 있을때는 stop process 누르면 잘됨 / 작업 관리자에 값이 안들어 갔을 땐 안됨 |
|
1454 |
process[i].WaitForExit(5000); |
|
1455 |
await WcfClient.GET_SELECT_RERECONVERT_ITEMAsync(convertId, 2, _CREATE_DATETIME, 99, null); |
|
1456 |
process[i].Kill(); |
|
1373 | 1457 |
//페이지 수가 많을땐 안됨 |
1374 |
// Stop Process 누른 후에 상위 그리드 convert버튼 누르면 가끔 중위 그리드에서 2개가 convert가 됨 |
|
1375 | 1458 |
} |
1376 | 1459 |
} |
1377 | 1460 |
} |
... | ... | |
1381 | 1464 |
} |
1382 | 1465 |
} |
1383 | 1466 |
} |
1384 |
#endregion
|
|
1467 |
#endregion |
|
1385 | 1468 |
|
1386 |
#region DataFilter
|
|
1469 |
#region DataFilter |
|
1387 | 1470 |
|
1388 | 1471 |
public void DataFilter(object obj) |
1389 | 1472 |
{ |
ConvertService/ServiceBase/Markus.Service.StationController/Views/DataBaseView.xaml | ||
---|---|---|
129 | 129 |
</i:Interaction.Behaviors> |
130 | 130 |
<telerik:RadContextMenu.ContextMenu> |
131 | 131 |
<telerik:RadContextMenu x:Name= "GridContextMenu"> |
132 |
<telerik:RadMenuItem Header="Convert" Command="{Binding ConvertCommand}"/> |
|
132 |
<telerik:RadMenuItem Header="Convert" Command="{Binding ConvertCommand}" />
|
|
133 | 133 |
<telerik:RadMenuItem Header="Validation" Command="{Binding ValidateCommand}"/> |
134 | 134 |
<telerik:RadMenuItem Header="Delete" Command="{Binding DeleteCommand}"/> |
135 | 135 |
</telerik:RadContextMenu> |
... | ... | |
197 | 197 |
<telerik:GridViewDataColumn Header="TotalTime" IsReadOnly="True" Background="Transparent" |
198 | 198 |
DataMemberBinding="{Binding TotalTime, Mode=TwoWay, StringFormat=\{0:yyyy.MM.dd HH:mm:ss\}}" Width="*" /> |
199 | 199 |
</telerik:RadGridView.Columns> |
200 |
|
|
200 | 201 |
</telerik:RadGridView> |
201 | 202 |
</telerik:RadExpander> |
202 | 203 |
<telerik:RadExpander Grid.Row="3" ExpandDirection="Down" BorderThickness="0" |
... | ... | |
222 | 223 |
Grid.Row="1" ScrollViewer.CanContentScroll="False" IsFilteringAllowed="True"> |
223 | 224 |
<telerik:RadContextMenu.ContextMenu> |
224 | 225 |
<telerik:RadContextMenu> |
225 |
<telerik:RadMenuItem Header="Convert" Command="{Binding ConvertCommand}"/> |
|
226 |
<telerik:RadMenuItem Header="Validation" Command="{Binding ValidateCommand}"/> |
|
227 |
<telerik:RadMenuItem Header="Delete" Command="{Binding DeleteCommand}"/> |
|
228 |
<telerik:RadMenuItem Header="Stop Process" Command="{Binding Stop_ProcessCommand}" /> |
|
226 |
<telerik:RadMenuItem Header="Convert" Command="{Binding ConvertCommand}" CommandParameter="{Binding SelectRealConvert}"/>
|
|
227 |
<telerik:RadMenuItem Header="Validation" Command="{Binding ValidateCommand}" CommandParameter="{Binding SelectRealConvert}"/>
|
|
228 |
<telerik:RadMenuItem Header="Delete" Command="{Binding DeleteCommand}" CommandParameter="{Binding SelectRealConvert}"/>
|
|
229 |
<telerik:RadMenuItem Header="Stop Process" Command="{Binding Stop_ProcessCommand}" CommandParameter="{Binding SelectRealConvert}" />
|
|
229 | 230 |
</telerik:RadContextMenu> |
230 | 231 |
</telerik:RadContextMenu.ContextMenu> |
231 | 232 |
<telerik:RadGridView.Columns> |
... | ... | |
318 | 319 |
ColumnWidth="*" ScrollViewer.CanContentScroll="False" IsFilteringAllowed="True" Grid.Row="1" > |
319 | 320 |
<telerik:RadContextMenu.ContextMenu> |
320 | 321 |
<telerik:RadContextMenu> |
321 |
<telerik:RadMenuItem Header="Convert" Command="{Binding ConvertCommand}"/> |
|
322 |
<telerik:RadMenuItem Header="Validation" Command="{Binding ValidateCommand}"/> |
|
323 |
<telerik:RadMenuItem Header="Delete" Command="{Binding DeleteCommand}"/> |
|
324 |
<telerik:RadMenuItem Header="Stop Process" Command="{Binding Stop_ProcessCommand}"/> |
|
322 |
<telerik:RadMenuItem Header="Stop Process" Command="{Binding Stop_ProcessCommand}" CommandParameter="{Binding SelectAliveConvert}"/> |
|
325 | 323 |
</telerik:RadContextMenu> |
326 | 324 |
</telerik:RadContextMenu.ContextMenu> |
327 | 325 |
<telerik:RadGridView.Columns> |
내보내기 Unified diff