개정판 6c12fd2e
issue #976 코멘트 후 user list 에서 체크박스 선택 시 코멘트가 사라지는 현상
KCOM/Services/BaseServices.cs | ||
---|---|---|
472 | 472 |
} |
473 | 473 |
else //파라미터로 넘어온 사용자가 걸리지 않은 경우 |
474 | 474 |
{ |
475 |
MarkupUserListDisplay(); |
|
475 |
EmptyControlCheck(); |
|
476 |
List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
|
477 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
|
478 |
List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
|
479 |
MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl(); |
|
480 |
layerControl.ProjectNo = App.ViewInfo.ProjectNO; |
|
481 |
#region 코멘트 보기 |
|
482 |
if (e.AddedItems.Count() > 0) |
|
483 |
{ |
|
484 |
foreach (var item in gridSelectionItem) |
|
485 |
{ |
|
486 |
if ((item.UserID == App.ViewInfo.UserID) && (this.pageNavigator.CurrentPage != null)) |
|
487 |
{ |
|
488 |
|
|
489 |
var instance = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
|
490 |
var my_item = Common.ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault(); |
|
491 |
Common.ViewerDataModel.Instance.current_page_commentcnt = Common.ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().Count; |
|
492 |
if (my_item == null) |
|
493 |
{ |
|
494 |
foreach (var markup in instance) |
|
495 |
{ |
|
496 |
layerControl.markupParseEx(markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markup.ID); |
|
497 |
} |
|
498 |
} |
|
499 |
else |
|
500 |
{ |
|
501 |
var test = instance.Where(data => data.MarkupInfoID == my_item.MarkupInfoID).FirstOrDefault(); |
|
502 |
|
|
503 |
if (test == null) |
|
504 |
{ |
|
505 |
foreach (var markup in instance) |
|
506 |
{ |
|
507 |
layerControl.markupParseEx(markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markup.ID); |
|
508 |
} |
|
509 |
} |
|
510 |
} |
|
511 |
} |
|
512 |
else if (this.pageNavigator.CurrentPage != null) |
|
513 |
{ |
|
514 |
var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
|
515 |
foreach (var markup in instance) |
|
516 |
{ |
|
517 |
layerControl.markupParse(markup.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID); |
|
518 |
} |
|
519 |
} |
|
520 |
} |
|
521 |
//} |
|
522 |
} |
|
523 |
#endregion |
|
524 |
#region 코멘트 숨기기 |
|
525 |
else if (e.RemovedItems.Count > 0) |
|
526 |
{ |
|
527 |
var _infoItem = e.RemovedItems.Cast<MarkupInfoItem>().ToList(); |
|
528 |
|
|
529 |
(from A in _infoItem |
|
530 |
from B in Common.ViewerDataModel.Instance.MarkupControls |
|
531 |
where A.MarkupInfoID == B.MarkupInfoID |
|
532 |
select B).ToList().ForEach(data => |
|
533 |
{ |
|
534 |
Common.ViewerDataModel.Instance.MarkupControls.Remove(data); |
|
535 |
}); |
|
536 |
|
|
537 |
//var myComment = _infoItem.Where(d => d.MarkupInfoID == App.Custom_ViewInfoId).FirstOrDefault(); |
|
538 |
var myComment = _infoItem.Where(d => d.UserID == App.ViewInfo.UserID).FirstOrDefault(); |
|
539 |
if (myComment != null) |
|
540 |
{ |
|
541 |
ChangeCommentReact(); |
|
542 |
Common.ViewerDataModel.Instance.MarkupControls_USER.ToList().ForEach(delegate (MarkupToPDF.Common.CommentUserInfo markupitem) |
|
543 |
{ |
|
544 |
if (markupitem.IsNew) |
|
545 |
{ |
|
546 |
var root = layerControl.MarkupToString(markupitem, App.ViewInfo.UserID); |
|
547 |
ViewerDataModel.Instance.MarkupList_USER.Add(new MarkupItemEx |
|
548 |
{ |
|
549 |
ID = markupitem.CommentID, |
|
550 |
Data = root.ConvertData, |
|
551 |
Data_Type = root.DATA_TYPE, |
|
552 |
MarkupInfoID = markupitem.MarkupInfoID, |
|
553 |
PageNumber = this.pageNavigator.CurrentPage.PageNumber, |
|
554 |
}); |
|
555 |
} |
|
556 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(markupitem); |
|
557 |
}); |
|
558 |
} |
|
559 |
} |
|
560 |
#endregion |
|
476 | 561 |
} |
477 | 562 |
} |
563 |
//MarkupUserListDisplay(); |
|
564 |
//} |
|
565 |
//} |
|
478 | 566 |
|
479 | 567 |
private static ObservableCollection<MarkupInfoItem> SetDisplayColor(List<MarkupInfoItem> MarkupInfoList, string userID) |
480 | 568 |
{ |
... | ... | |
793 | 881 |
List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
794 | 882 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
795 | 883 |
List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
796 |
//MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl();
|
|
884 |
//MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl(); |
|
797 | 885 |
layerControl.ProjectNo = App.ViewInfo.ProjectNO; |
798 | 886 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Clear(); //전체 제거 |
799 |
Common.ViewerDataModel.Instance.MarkupControls.Clear(); //전체 제거 |
|
887 |
Common.ViewerDataModel.Instance.MarkupControls.Clear(); //전체 제거
|
|
800 | 888 |
foreach (var item in gridSelectionItem) |
801 | 889 |
{ |
802 | 890 |
if (item.UserID == App.ViewInfo.UserID) |
... | ... | |
814 | 902 |
}); |
815 | 903 |
} |
816 | 904 |
} |
817 |
(from A in gridSelectionItem
|
|
818 |
from B in Common.ViewerDataModel.Instance.MarkupControls_USER
|
|
819 |
where A.MarkupInfoID == B.MarkupInfoID
|
|
820 |
select B).ToList().ForEach(data =>
|
|
821 |
{
|
|
822 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(data);
|
|
823 |
});
|
|
905 |
(from A in gridSelectionItem |
|
906 |
from B in Common.ViewerDataModel.Instance.MarkupControls_USER |
|
907 |
where A.MarkupInfoID == B.MarkupInfoID |
|
908 |
select B).ToList().ForEach(data => |
|
909 |
{ |
|
910 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(data); |
|
911 |
}); |
|
824 | 912 |
(from A in gridSelectionItem |
825 | 913 |
from B in Common.ViewerDataModel.Instance.MarkupControls |
826 | 914 |
where A.MarkupInfoID == B.MarkupInfoID |
내보내기 Unified diff