개정판 218e5002
FilterSearch 완료
Change-Id: Ia9322a69ff6ba79bdb708b71db17099788ea66a6
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs | ||
---|---|---|
44 | 44 |
RemoveCreateTimeFilterCommand = new DelegateCommand(RemoveCreateTimeFilter); |
45 | 45 |
FilterConvertSourceView.Filter = new Predicate<object>(o => DetailFilter(o as ConvertItem)); |
46 | 46 |
ResetCommand = new DelegateCommand(Reset); |
47 |
ConverAddCommand = new DelegateCommand(ConverAdd); |
|
47 | 48 |
} |
48 | 49 |
|
49 | 50 |
#endregion |
... | ... | |
283 | 284 |
_ProjectNumberFilter = value; |
284 | 285 |
OnPropertyChanged(() => ProjectNumberFilter); |
285 | 286 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
286 |
FilterConvertSourceView.Refresh(); |
|
287 |
//FilterConvertSourceView.Refresh();
|
|
287 | 288 |
} |
288 | 289 |
} |
289 | 290 |
} |
... | ... | |
306 | 307 |
_UniqueKeyFilter = value; |
307 | 308 |
OnPropertyChanged(() => UniqueKeyFilter); |
308 | 309 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
309 |
FilterConvertSourceView.Refresh(); |
|
310 |
//FilterConvertSourceView.Refresh();
|
|
310 | 311 |
} |
311 | 312 |
} |
312 | 313 |
} |
... | ... | |
322 | 323 |
_ConvertStateFilter = value; |
323 | 324 |
OnPropertyChanged(() => ConvertStateFilter); |
324 | 325 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
325 |
FilterConvertSourceView.Refresh(); |
|
326 |
//FilterConvertSourceView.Refresh();
|
|
326 | 327 |
} |
327 | 328 |
} |
328 | 329 |
} |
... | ... | |
342 | 343 |
_Docuemnt_NOFilter = value; |
343 | 344 |
OnPropertyChanged(() => Docuemnt_NOFilter); |
344 | 345 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
345 |
FilterConvertSourceView.Refresh(); |
|
346 |
//FilterConvertSourceView.Refresh();
|
|
346 | 347 |
} |
347 | 348 |
} |
348 | 349 |
} |
... | ... | |
362 | 363 |
_Docuemnt_NameFilter = value; |
363 | 364 |
OnPropertyChanged(() => Docuemnt_NameFilter); |
364 | 365 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
365 |
FilterConvertSourceView.Refresh(); |
|
366 |
//FilterConvertSourceView.Refresh();
|
|
366 | 367 |
} |
367 | 368 |
} |
368 | 369 |
} |
... | ... | |
382 | 383 |
_ReconverterFilter = value; |
383 | 384 |
OnPropertyChanged(() => ReconverterFilter); |
384 | 385 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
385 |
FilterConvertSourceView.Refresh(); |
|
386 |
//FilterConvertSourceView.Refresh();
|
|
386 | 387 |
|
387 | 388 |
} |
388 | 389 |
} |
... | ... | |
403 | 404 |
_Service_IDFilter = value; |
404 | 405 |
OnPropertyChanged(() => Service_IDFilter); |
405 | 406 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
406 |
FilterConvertSourceView.Refresh(); |
|
407 |
//FilterConvertSourceView.Refresh();
|
|
407 | 408 |
} |
408 | 409 |
} |
409 | 410 |
} |
... | ... | |
423 | 424 |
_RevisionFilter = value; |
424 | 425 |
OnPropertyChanged(() => RevisionFilter); |
425 | 426 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
426 |
FilterConvertSourceView.Refresh(); |
|
427 |
//FilterConvertSourceView.Refresh(); |
|
428 |
} |
|
429 |
} |
|
430 |
} |
|
431 |
|
|
432 |
public string _GroupNOFilter; |
|
433 |
public string GroupNOFilter |
|
434 |
{ |
|
435 |
get { return _GroupNOFilter; } |
|
436 |
set |
|
437 |
{ |
|
438 |
if (_GroupNOFilter == "") |
|
439 |
{ |
|
440 |
_GroupNOFilter = null; |
|
441 |
} |
|
442 |
else if (_GroupNOFilter != value) |
|
443 |
{ |
|
444 |
_GroupNOFilter = value; |
|
445 |
OnPropertyChanged(() => GroupNOFilter); |
|
446 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
|
447 |
//FilterConvertSourceView.Refresh(); |
|
427 | 448 |
} |
428 | 449 |
} |
429 | 450 |
} |
... | ... | |
441 | 462 |
_SelectedCreateTimeBegin = value; |
442 | 463 |
OnPropertyChanged(() => SelectedCreateTimeBegin); |
443 | 464 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
444 |
FilterConvertSourceView.Refresh(); |
|
465 |
//FilterConvertSourceView.Refresh();
|
|
445 | 466 |
//AddGeneratorBeginFilter(); |
446 | 467 |
|
447 | 468 |
} |
... | ... | |
459 | 480 |
_SelectedCreateTimeEnd = value; |
460 | 481 |
OnPropertyChanged(() => SelectedCreateTimeEnd); |
461 | 482 |
//CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh(); |
462 |
FilterConvertSourceView.Refresh(); |
|
483 |
//FilterConvertSourceView.Refresh();
|
|
463 | 484 |
//AddGeneratorBeginFilter(); |
464 | 485 |
|
465 | 486 |
} |
466 | 487 |
} |
467 | 488 |
|
489 |
public int _DocpanelHeigh = 800; |
|
490 |
public int DocpanelHeight //나중에 다시 해야함 |
|
491 |
{ |
|
492 |
get { return _DocpanelHeigh; } |
|
493 |
set |
|
494 |
{ |
|
495 |
_DocpanelHeigh = value; |
|
496 |
OnPropertyChanged(() => DocpanelHeight); |
|
497 |
} |
|
498 |
} |
|
499 |
|
|
468 | 500 |
private string _Click = "Click"; |
469 | 501 |
public string Click |
470 | 502 |
{ |
... | ... | |
484 | 516 |
|
485 | 517 |
public DelegateCommand DataFilterCommand { get; private set; } |
486 | 518 |
public DelegateCommand ResetCommand { get; private set; } |
519 |
public DelegateCommand ConverAddCommand { get; private set; } |
|
487 | 520 |
|
488 | 521 |
#endregion |
489 | 522 |
|
... | ... | |
607 | 640 |
_status = (int)SelectedStatus.Value; |
608 | 641 |
} |
609 | 642 |
|
643 |
|
|
610 | 644 |
var items = database.GetConvertProjects(_status, ProjectNumberFilter, UniqueKeyFilter, Docuemnt_NameFilter, Service_IDFilter, Docuemnt_NOFilter |
611 | 645 |
, ReconverterFilter, RevisionFilter)//x:database객체 y:statusCodeTypeList의값 Count()안에 predicator 조건 만족하면 count개수안에 넣음 |
612 | 646 |
.Take(SelectedCount.ValueMember).ToList(); |
... | ... | |
687 | 721 |
{ |
688 | 722 |
try |
689 | 723 |
{ |
690 |
using (markusEntities entities = new markusEntities())
|
|
724 |
using (Markus.Service.DataBase.ConvertDatabase database = new Markus.Service.DataBase.ConvertDatabase(App.MarkusDataBaseConnecitonString))
|
|
691 | 725 |
{ |
726 |
using (markusEntities entities = new markusEntities()) |
|
727 |
{ |
|
692 | 728 |
|
693 | 729 |
|
694 |
int _status = 0; |
|
695 |
if (SelectedStatus != null) |
|
696 |
{ |
|
697 |
_status = (int)SelectedStatus.Value; |
|
698 |
} |
|
730 |
int _status = 0;
|
|
731 |
if (SelectedStatus != null)
|
|
732 |
{
|
|
733 |
_status = (int)SelectedStatus.Value;
|
|
734 |
}
|
|
699 | 735 |
|
700 |
//DocumentID = unikey |
|
736 |
//DocumentID = unikey
|
|
701 | 737 |
|
702 |
//null 왼쪽에서 부터 p_BEGIN_START_DATETIE, p_Finish_START_DATETIE, BEGIN_END_DATETIME, Finish_END_DATETIME, Group_No = 11로 해놈 없음 (전에 없애라고 하셔서..)
|
|
703 |
//오류떠서 [Model].Context.tt File에서 288줄 Function.Name to edmFunction.FullName바꿨더니 오류 안남 |
|
704 |
var items = entities.SELECT_CONVERT_ITEM(ProjectNumberFilter, UniqueKeyFilter, _status, SelectedCount.ValueMember, SelectedCreateTimeBegin, SelectedCreateTimeEnd, null, null, null, null, 11.ToString(),
|
|
705 |
Docuemnt_NameFilter, Docuemnt_NOFilter, RevisionFilter);//이대로 그냥 쓰면 쿼리 -> 쿼리 결과는 두 번 이상 열거할 수 없습니다 뜸
|
|
738 |
//null 왼쪽에서 부터 p_BEGIN_START_DATETIE, p_Finish_START_DATETIE, BEGIN_END_DATETIME, Finish_END_DATETIME (전에 없애라고 하셔서..)
|
|
739 |
//오류떠서 [Model].Context.tt File에서 288줄 Function.Name to edmFunction.FullName바꿨더니 오류 안남
|
|
740 |
var items = entities.SELECT_CONVERT_ITEM(ProjectNumberFilter, UniqueKeyFilter, _status, SelectedCount.ValueMember, SelectedCreateTimeBegin, SelectedCreateTimeEnd, null, null, null, null, GroupNOFilter,
|
|
741 |
Docuemnt_NameFilter, Docuemnt_NOFilter, RevisionFilter).ToList();//이대로 그냥 쓰면 쿼리 -> 쿼리 결과는 두 번 이상 열거할 수 없습니다 뜸
|
|
706 | 742 |
|
707 |
//SEARCH 할때 최소한 프로젝트 넘버랑 유니크키(다큐먼트 넘버) 크레이트타임 시작 끝 줘야함
|
|
743 |
//SEARCH 할때 최소한 프로젝트 넘버랑 유니크키(다큐먼트 넘버) 크레이트타임 시작 줘야함
|
|
708 | 744 |
|
709 |
List<ConvertItem> Listitems = new List<ConvertItem>(); |
|
745 |
List<ConvertItem> Listitems = new List<ConvertItem>();
|
|
710 | 746 |
|
711 |
foreach (var x in items) |
|
712 |
{ |
|
713 |
ConvertItem AddItem = new ConvertItem(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); |
|
714 |
Listitems.Add(AddItem); |
|
715 |
} |
|
747 |
foreach (var x in items) |
|
748 |
{ |
|
749 |
var convertpath = database.GetSearchConvertPathAndMarkus(x.PROJECT_NO, x.DOCUMENT_ID); |
|
716 | 750 |
|
717 |
if (collection.Count() == 0) |
|
718 |
{ |
|
719 |
if (statusCodeTypeList.Count() == 1) |
|
751 |
ConvertItem AddItem = new ConvertItem(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 |
|
752 |
, x.DOCUMENT_URL, convertpath[0], convertpath[1]); |
|
753 |
Listitems.Add(AddItem); |
|
754 |
//이거 없으면 collection.Insert(i, item); 할때 문제 생김 |
|
755 |
} |
|
756 |
|
|
757 |
if (collection.Count() == 0) |
|
720 | 758 |
{ |
721 |
foreach (var x in Listitems)
|
|
759 |
if (statusCodeTypeList.Count() == 1)
|
|
722 | 760 |
{ |
723 |
collection.Add(x); |
|
761 |
foreach (var x in Listitems) |
|
762 |
{ |
|
763 |
collection.Add(x); |
|
764 |
} |
|
724 | 765 |
} |
725 | 766 |
} |
726 |
} |
|
727 |
else |
|
728 |
{ |
|
729 |
|
|
730 |
////세미 업데이트 |
|
731 |
foreach (var newitem in Listitems) |
|
767 |
else |
|
732 | 768 |
{ |
733 |
collection.UpdateWhere(changeitem => |
|
734 |
ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID); |
|
735 |
} |
|
736 | 769 |
|
770 |
////세미 업데이트 |
|
771 |
foreach (var newitem in Listitems) |
|
772 |
{ |
|
773 |
collection.UpdateWhere(changeitem => |
|
774 |
ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID); |
|
775 |
} |
|
737 | 776 |
|
738 |
if (statusCodeTypeList.Count() == 1) |
|
739 |
{ |
|
740 | 777 |
|
741 |
//삭제 |
|
742 |
for (int i = collection.Count() - 1; i >= 0; --i) |
|
778 |
if (statusCodeTypeList.Count() == 1) |
|
743 | 779 |
{ |
744 |
var item = collection[i]; |
|
745 | 780 |
|
746 |
if (Listitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0) |
|
781 |
//삭제 |
|
782 |
for (int i = collection.Count() - 1; i >= 0; --i) |
|
747 | 783 |
{ |
748 |
collection.RemoveAt(i); |
|
784 |
var item = collection[i]; |
|
785 |
|
|
786 |
if (Listitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0) |
|
787 |
{ |
|
788 |
collection.RemoveAt(i); |
|
789 |
} |
|
749 | 790 |
} |
750 | 791 |
} |
751 |
} |
|
752 | 792 |
|
753 |
if (statusCodeTypeList.Count() == 1) |
|
754 |
{ |
|
755 |
//추가 convert 후 추가됨 |
|
756 |
foreach (var item in Listitems) |
|
793 |
if (statusCodeTypeList.Count() == 1) |
|
757 | 794 |
{ |
758 |
if (collection.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0) |
|
795 |
//추가 convert 후 추가됨 |
|
796 |
foreach (var item in Listitems) |
|
759 | 797 |
{ |
760 |
for (int i = 0; i < 200; i++)
|
|
798 |
if (collection.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
|
|
761 | 799 |
{ |
762 |
if (i < collection.Count() - 1)
|
|
800 |
for (int i = 0; i < 200; i++)
|
|
763 | 801 |
{ |
764 |
if (DateTime.Compare(collection[i].CreateTime, item.CreateTime) < 0)
|
|
802 |
if (i < collection.Count() - 1)
|
|
765 | 803 |
{ |
766 |
collection.Insert(i, item); |
|
804 |
if (DateTime.Compare(collection[i].CreateTime, item.CreateTime) < 0) |
|
805 |
{ |
|
806 |
collection.Insert(i, item); |
|
807 |
break; |
|
808 |
} |
|
809 |
} |
|
810 |
else |
|
811 |
{ |
|
812 |
collection.Add(item); |
|
767 | 813 |
break; |
768 | 814 |
} |
769 | 815 |
} |
770 |
else |
|
771 |
{ |
|
772 |
collection.Add(item); |
|
773 |
break; |
|
774 |
} |
|
816 |
|
|
775 | 817 |
} |
776 | 818 |
|
777 | 819 |
} |
778 |
|
|
779 | 820 |
} |
780 |
} |
|
781 | 821 |
|
822 |
} |
|
782 | 823 |
} |
783 | 824 |
} |
784 | 825 |
|
... | ... | |
1212 | 1253 |
|
1213 | 1254 |
#endregion |
1214 | 1255 |
|
1256 |
|
|
1257 |
#region |
|
1258 |
|
|
1259 |
/// <summary> |
|
1260 |
/// 그리드 상단 Conver 추가 버튼 |
|
1261 |
/// ProjectNo, DocumentURL, DocumentID, 입력해서 저장 프로시저에서 추가 |
|
1262 |
/// </summary> |
|
1263 |
|
|
1264 |
public void ConverAdd(object obj) |
|
1265 |
{ |
|
1266 |
|
|
1267 |
} |
|
1268 |
|
|
1269 |
#endregion |
|
1270 |
|
|
1215 | 1271 |
#endregion |
1216 | 1272 |
} |
1217 | 1273 |
} |
내보내기 Unified diff