개정판 1f1c566e
issue #672 comment display modify
KCOM/Services/BaseServices.cs | ||
---|---|---|
469 | 469 |
} |
470 | 470 |
else //파라미터로 넘어온 사용자가 걸리지 않은 경우 |
471 | 471 |
{ |
472 |
List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
|
473 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
|
474 |
List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
|
475 |
MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl(); |
|
476 |
layerControl.ProjectNo = App.ViewInfo.ProjectNO; |
|
477 |
#region 코멘트 보기 |
|
478 |
if (e.AddedItems.Count() > 0) |
|
479 |
{ |
|
480 |
foreach (var item in gridSelectionItem) |
|
481 |
{ |
|
482 |
if ((item.UserID == App.ViewInfo.UserID) && (this.pageNavigator.CurrentPage != null)) |
|
483 |
{ |
|
484 |
|
|
485 |
var instance = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
|
486 |
var my_item = Common.ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault(); |
|
487 |
Common.ViewerDataModel.Instance.current_page_commentcnt = Common.ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().Count; |
|
488 |
if (my_item == null) |
|
489 |
{ |
|
490 |
foreach (var markup in instance) |
|
491 |
{ |
|
492 |
layerControl.markupParseEx(markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markup.ID); |
|
493 |
} |
|
494 |
} |
|
495 |
else |
|
496 |
{ |
|
497 |
var test = instance.Where(data => data.MarkupInfoID == my_item.MarkupInfoID).FirstOrDefault(); |
|
498 |
|
|
499 |
if (test == null) |
|
500 |
{ |
|
501 |
foreach (var markup in instance) |
|
502 |
{ |
|
503 |
layerControl.markupParseEx(markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markup.ID); |
|
504 |
} |
|
505 |
} |
|
506 |
} |
|
507 |
} |
|
508 |
else if(this.pageNavigator.CurrentPage != null) |
|
509 |
{ |
|
510 |
var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList(); |
|
511 |
foreach (var markup in instance) |
|
512 |
{ |
|
513 |
layerControl.markupParse(markup.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID); |
|
514 |
} |
|
515 |
} |
|
516 |
} |
|
517 |
//} |
|
518 |
} |
|
519 |
#endregion |
|
520 |
#region 코멘트 숨기기 |
|
521 |
else if (e.RemovedItems.Count > 0) |
|
522 |
{ |
|
523 |
var _infoItem = e.RemovedItems.Cast<MarkupInfoItem>().ToList(); |
|
524 |
|
|
525 |
(from A in _infoItem |
|
526 |
from B in Common.ViewerDataModel.Instance.MarkupControls |
|
527 |
where A.MarkupInfoID == B.MarkupInfoID |
|
528 |
select B).ToList().ForEach(data => |
|
529 |
{ |
|
530 |
Common.ViewerDataModel.Instance.MarkupControls.Remove(data); |
|
531 |
}); |
|
532 |
|
|
533 |
//var myComment = _infoItem.Where(d => d.MarkupInfoID == App.Custom_ViewInfoId).FirstOrDefault(); |
|
534 |
var myComment = _infoItem.Where(d => d.UserID == App.ViewInfo.UserID).FirstOrDefault(); |
|
535 |
if (myComment != null) |
|
536 |
{ |
|
537 |
ChangeCommentReact(); |
|
538 |
Common.ViewerDataModel.Instance.MarkupControls_USER.ToList().ForEach(delegate (MarkupToPDF.Common.CommentUserInfo markupitem) |
|
539 |
{ |
|
540 |
if (markupitem.IsNew) |
|
541 |
{ |
|
542 |
var root = layerControl.MarkupToString(markupitem, App.ViewInfo.UserID); |
|
543 |
ViewerDataModel.Instance.MarkupList_USER.Add(new MarkupItemEx |
|
544 |
{ |
|
545 |
ID = markupitem.CommentID, |
|
546 |
Data = root.ConvertData, |
|
547 |
Data_Type = root.DATA_TYPE, |
|
548 |
MarkupInfoID = markupitem.MarkupInfoID, |
|
549 |
PageNumber = this.pageNavigator.CurrentPage.PageNumber, |
|
550 |
}); |
|
551 |
} |
|
552 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(markupitem); |
|
553 |
}); |
|
554 |
} |
|
555 |
} |
|
556 |
#endregion |
|
472 |
MarkupUserListDisplay(); |
|
557 | 473 |
} |
558 | 474 |
} |
559 | 475 |
|
... | ... | |
869 | 785 |
//hubConnection.Stop(); |
870 | 786 |
} |
871 | 787 |
|
788 |
public void MarkupUserListDisplay() |
|
789 |
{ |
|
790 |
List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업 |
|
791 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
|
792 |
List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업 |
|
793 |
//MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl(); |
|
794 |
layerControl.ProjectNo = App.ViewInfo.ProjectNO; |
|
795 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Clear(); //전체 제거 |
|
796 |
Common.ViewerDataModel.Instance.MarkupControls.Clear(); //전체 제거 |
|
797 |
foreach (var item in gridSelectionItem) |
|
798 |
{ |
|
799 |
if (item.UserID == App.ViewInfo.UserID) |
|
800 |
{ |
|
801 |
ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
|
802 |
{ |
|
803 |
layerControl.markupParseEx(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markupitem.ID); |
|
804 |
}); |
|
805 |
} |
|
806 |
else |
|
807 |
{ |
|
808 |
ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
|
809 |
{ |
|
810 |
layerControl.markupParse(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID); |
|
811 |
}); |
|
812 |
} |
|
813 |
} |
|
814 |
(from A in gridSelectionItem |
|
815 |
from B in Common.ViewerDataModel.Instance.MarkupControls_USER |
|
816 |
where A.MarkupInfoID == B.MarkupInfoID |
|
817 |
select B).ToList().ForEach(data => |
|
818 |
{ |
|
819 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(data); |
|
820 |
}); |
|
821 |
(from A in gridSelectionItem |
|
822 |
from B in Common.ViewerDataModel.Instance.MarkupControls |
|
823 |
where A.MarkupInfoID == B.MarkupInfoID |
|
824 |
select B).ToList().ForEach(data => |
|
825 |
{ |
|
826 |
Common.ViewerDataModel.Instance.MarkupControls.Remove(data); |
|
827 |
}); |
|
828 |
|
|
829 |
foreach (var item in gridSelectionItem) |
|
830 |
{ |
|
831 |
if (item.UserID == App.ViewInfo.UserID) |
|
832 |
{ |
|
833 |
ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
|
834 |
{ |
|
835 |
layerControl.markupParseEx(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markupitem.ID); |
|
836 |
}); |
|
837 |
} |
|
838 |
else |
|
839 |
{ |
|
840 |
ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem) |
|
841 |
{ |
|
842 |
layerControl.markupParse(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID); |
|
843 |
}); |
|
844 |
} |
|
845 |
} |
|
846 |
} |
|
872 | 847 |
} |
873 | 848 |
} |
내보내기 Unified diff