프로젝트

일반

사용자정보

개정판 be72bfd6

IDbe72bfd68a4e5490e665565ee25852d6be7e1b7c
상위 504c5aa1
하위 d4552deb, 889b2b2b

김태성이(가) 약 5년 전에 추가함

마크업 리스트 정렬 수정

Change-Id: I4e625b9f03f5a2f5a8d7f3929a2dafa27527faef

차이점 보기:

KCOM/Services/BaseServices.cs
30 30
        public DOCINFO _DocInfo;
31 31
        public DOCUMENT_ITEM _DocItem;
32 32
        public MEMBER userData;
33
        public List<int> MarkupSortList = new List<int>();
33 34

  
34 35
        public event PropertyChangedEventHandler PropertyChanged;
35 36
        private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
......
332 333

  
333 334
            ViewerDataModel.Instance.MarkupControls_USER.Clear();
334 335
            ViewerDataModel.Instance.MarkupControls.Clear();
336

  
335 337
            if (e.Result != null)
336 338
            {
337 339
                ViewerDataModel.Instance._markupInfoList.Clear();
......
339 341

  
340 342
                foreach (var info in e.Result)
341 343
                {
344
                    if (info.Depatment == null) info.Depatment = "Unknown";
345

  
342 346
                    if (info.UserID == App.ViewInfo.UserID)
343 347
                    {
344 348
                        info.userDelete = true;
......
348 352
                    {
349 353
                        info.userDelete = false;
350 354
                    }
355

  
351 356
                    ViewerDataModel.Instance._markupInfoList.Add(info);
352 357
                }
353 358

  
......
433 438
                    App.Custom_ViewInfoId = currentUser.MarkupInfoID;
434 439
                }
435 440

  
436
                foreach(var info in e.Result)
437
                {
438
                    if (info.UserID == App.ViewInfo.UserID) info.DisplayColor = "#FFFF0000";
439
                }
440

  
441 441
                ViewerDataModel.Instance.PageNumber = 1;
442 442

  
443 443
                /// Consolidation 된 데이터가 최상단에 올 수 있도록 변경
444
                var markupItem = ViewerDataModel.Instance._markupInfoList.OrderByDescending(p => p.Consolidate == Convert.ToInt32(true)).ToList();
445
                markupItem.ForEach(data =>
446
                {
447
                    if (data.Depatment == null) data.Depatment = "Unknown";
448
                });
444
                //var markupItem = ViewerDataModel.Instance._markupInfoList.OrderByDescending(p => p.Consolidate == Convert.ToInt32(true)).ToList();
445

  
449 446
                gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList;
450 447
                SetCommentPages();
451 448

  
452
                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
                
449

  
455 450
                /// create a group descriptor
456 451
                gridViewMarkup.GroupDescriptors.Clear();
457 452
                GroupDescriptor descriptor = new GroupDescriptor();
......
459 454
                descriptor.DisplayContent = "DEPT";
460 455
                //descriptor.SortDirection = ListSortDirection.Ascending;
461 456
                gridViewMarkup.GroupDescriptors.Add(descriptor);
462
                /// up to here
457

  
458
                GridViewMarkup_Sorting(gridViewMarkup,new GridViewSortingEventArgs(gridViewMarkup.Columns[0],SortingState.None,SortingState.None));
459

  
460
                var SelectedItem = ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == App.ViewInfo.UserID).OrderByDescending(order => order.UpdateTime).FirstOrDefault();
461
                this.gridViewMarkup.SelectedItem = (PreviewUserMarkupInfoItem != null) ? PreviewUserMarkupInfoItem : SelectedItem;
462
            }
463
        }
464

  
465
        private void GridViewMarkup_Sorting(object sender, GridViewSortingEventArgs e)
466
        {
467
            IEnumerable<IKCOM.MarkupInfoItem> markuplist = e.DataControl.ItemsSource as IEnumerable<IKCOM.MarkupInfoItem>;
468

  
469
            if(markuplist == null)
470
            {
471
                e.Cancel = true;
472
                return;
473
            }
474

  
475
            if(e.NewSortingState == SortingState.None)
476
            {
477
                markuplist = markuplist.OrderByDescending(x => SortIndex(x))
478
                                            .ThenBy(x => x.Depatment)
479
                                            .ThenBy(x => x.UserID);
480

  
481
                e.DataControl.ItemsSource = markuplist.ToList();
482
            }
483
        }
484

  
485

  
486
        // 마크업 리스트 정렬
487
        private int SortIndex(IKCOM.MarkupInfoItem markupInfoItem)
488
        {
489
            int result = 0;
490

  
491
            // Consolidate은 최상단
492
            if (markupInfoItem.Consolidate == 1)
493
            {
494
                result += 2;
495
            }
496

  
497
            /// Consolidate 다음으로 우선순위
498
            if (markupInfoItem.UserID == App.ViewInfo.UserID)
499
            {
500
                result += 1;
463 501
            }
502

  
503
            return result;
504
        }
505

  
506

  
507
        private void GridViewMarkup_Sorted(object sender, GridViewSortedEventArgs e)
508
        {
509

  
464 510
        }
465 511

  
466 512
        private async void gridViewRevMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
KCOM/Views/MainMenu.xaml
708 708
                        <telerik:RadGridView IsReadOnly="True" telerik:StyleManager.Theme="Office2013" ShowGroupPanel="True" ShowGroupFooters="False" AutoExpandGroups="True"  x:Name="gridViewMarkup"
709 709
                                             AutoGenerateColumns="False" HorizontalContentAlignment="Center" SelectionChanged="gridViewMarkup_SelectionChanged" SelectionMode="Multiple"
710 710
                                             CanUserDeleteRows="True" CanUserInsertRows="False" IsFilteringAllowed="False" RowIndicatorVisibility="Collapsed" 
711
                                             Sorting="GridViewMarkup_Sorting" Sorted="GridViewMarkup_Sorted"
711 712
                                             CanUserSortColumns ="True" >
712
                            <telerik:RadGridView.GroupDescriptors>
713
                            <!--<telerik:RadGridView.GroupDescriptors>
713 714
                                <telerik:GroupDescriptor Member="Depatment" SortDirection="Ascending" DisplayContent = "DEPT" x:Name="gDept">
714 715
                                    <telerik:GroupDescriptor.AggregateFunctions>
715 716
                                        <telerik:CountFunction Caption="Entries count : " />
716 717
                                    </telerik:GroupDescriptor.AggregateFunctions>
717 718
                                </telerik:GroupDescriptor>
718
                                
719
                            </telerik:RadGridView.GroupDescriptors>
719
                            </telerik:RadGridView.GroupDescriptors>-->
720 720
                            <telerik:RadGridView.RowStyle>
721 721
                                <Style TargetType="telerik:GridViewRow">
722 722
                                    <Setter Property="HorizontalContentAlignment" Value="Center"/>
KCOM/Views/MainMenu.xaml.cs
5521 5521
            CommonLib.Common.WriteConfigString("SetThumbnail", "WIDTH", thumbnailPanel.Width.ToString());
5522 5522
        }
5523 5523

  
5524

  
5525 5524
        /*
5526 5525
        private void zoomAndPanControl_Drop(object sender, DragEventArgs e)
5527 5526
        {

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)