프로젝트

일반

사용자정보

개정판 f9d986d9

IDf9d986d90c1b5f3c2acd180f043c5b872677ce24
상위 6472f348
하위 92aa67fb

이지연이(가) 약 6년 전에 추가함

issue #885 부서/사용자 색상 설정

차이점 보기:

KCOM_API/ServiceDeepView.svc.cs
518 518
                using (CIEntities entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(ProjectNo).ToString()))
519 519
                {
520 520
                    var markupListData = entity.MARKUP_INFO.Where(data => data.DOCINFO_ID == DocInfoId).ToList();
521

  
522
                    var markupList = from markup in markupListData
523
                                     orderby markup.CREATE_TIME descending
524
                                     select new MarkupInfoItem
525
                                     {
526
                                         MarkupInfoID = markup.ID,
527
                                         UserID = markup.USER_ID,
528
                                         MarkupVersionID = markup.MARKUP_INFO_VERSION.Count() == 0 ? null : markup.MARKUP_INFO_VERSION.OrderByDescending(data => data.CREATE_DATE).FirstOrDefault().ID,
529
                                         CreateTime = markup.CREATE_TIME,
530
                                         Consolidate = markup.CONSOLIDATE,
531
                                         Description = markup.DESCRIPTION,
532
                                         AvoidConsolidate = markup.AVOID_CONSOLIDATE,
533
                                         PartConsolidate = markup.PART_CONSOLIDATE,
534
                                         UpdateTime = DateTime.Parse(markup.UPDATE_TIME.ToString()),
535
                                     };
536

  
537
                    if (markupList.Count() > 0)
538
                    {
539
                        _result = markupList.ToList();
540
                    }
541

  
542
                    _result.ForEach(r =>
543
                    {
544

  
545
                        r.MarkupList = (from markupData in entity.MARKUP_DATA
546
                                        where markupData.MARKUPINFO_VERSION_ID == r.MarkupVersionID
547
                                        orderby markupData.PAGENUMBER
548
                                        select new MarkupItem { ID = markupData.ID, PageNumber = markupData.PAGENUMBER, Data = markupData.DATA, Data_Type = markupData.DATA_TYPE, Symbol_ID = markupData.SYMBOL_ID }).ToList();
549
                    });
550

  
551
                    Random random = new Random();
552

  
553
                    _MemberDeptColors memberDeptColors = new _MemberDeptColors();
554
                    _MemberDeptColorsInfo memberDeptColorsInfo = new _MemberDeptColorsInfo();
555

  
556

  
557
                    memberDeptColors._memberDeptColors = (from memberdeptcolor in entity.MEMBER_DEPT_COLOR
558
                                                              //where memberdeptcolor.DEPARTMENT == "DisplayColor"
559
                                                          select memberdeptcolor).ToList();
560
                    memberDeptColorsInfo._memberDeptColorsInfo = (from memberdeptcolorinfo in entity.MEMBER_DEPT_COLORINFO
561
                                                                      //where memberdeptcolor.DEPARTMENT == "DisplayColor"
562
                                                                  select memberdeptcolorinfo).ToList();
563

  
564

  
565
                    foreach (var item in _result)
566
                    {
567
                        var _member = entity.MEMBER.Where(member => member.ID == item.UserID);
568

  
569
                        if (_member.Count() > 0)
570
                        {
571
                            item.UserName = _member.First().NAME;
572
                            item.Depatment = _member.First().DEPARTMENT;
573
                        }
574

  
575
                        foreach (var dept in memberDeptColors._memberDeptColors)
576
                        {//dept 지정  색상 
577
                            if (dept.DEPARTMENT == item.Depatment)
578
                            {
579
                                var colorlist = memberDeptColorsInfo._memberDeptColorsInfo.Where(d => d.COLORID == dept.COLORID).ToList();
580

  
581
                                int colorIdx = random.Next(1, colorlist.Count());
582
                                if (colorlist.Count > 0)
583
                                {
584
                                    item.DisplayColor = "#FF" + colorlist[colorIdx].DISPLAYCOLOR;
585
                                    memberDeptColorsInfo._memberDeptColorsInfo.Remove(colorlist[colorIdx]);
586
                                    break;
587
                                }
588
                                else
589
                                {
590
                                    item.DisplayColor = String.Format("#FF{0:X6}", random.Next(0x1000000));
591
                                    break;
592
                                }
593
                            }
594
                        }
595

  
596

  
597
                        if (item.DisplayColor == null)
598
                        {
599
                            foreach (var dept in memberDeptColors._memberDeptColors)
600
                            {
601
                                if (dept.DEPARTMENT == null)
602
                                {
603
                                    dept.DEPARTMENT = item.Depatment;
604
                                    var colorlist = memberDeptColorsInfo._memberDeptColorsInfo.Where(d => d.COLORID == dept.COLORID).ToList();
605
                                    int colorIdx = random.Next(1, colorlist.Count());
606
                                    if (colorlist.Count > 0)
607
                                    {
608
                                        item.DisplayColor = "#FF" + colorlist[colorIdx].DISPLAYCOLOR;
609
                                        memberDeptColorsInfo._memberDeptColorsInfo.Remove(colorlist[colorIdx]);
610
                                        break;
611
                                    }
612
                                    else
613
                                    {
614
                                        item.DisplayColor = String.Format("#FF{0:X6}", random.Next(0x1000000));
615
                                        break;
616
                                    }
617
                                }
618
                            }
619
                        }
620

  
621
                        if (item.DisplayColor == null)
622
                        {
623
                            item.DisplayColor = String.Format("#FF{0:X6}", random.Next(0x1000000));
624
                        }
625
                    }
626
                }
627
            }
628
            catch (Exception EX)
629
            {
630
                System.Diagnostics.Debug.WriteLine(this.GetType().ToString() + " " + EX);
631
                return _result;
632
            }
633
            finally
634
            {
635
                GC.Collect(2);
636
            }
637

  
638
            return _result;
639
        }
640

  
641
        /*
642
        [OperationContract]
643
        public List<MarkupInfoItem> GetMarkupInfoItems(string ProjectNo, string DocInfoId)
644
        {
645
            List<MarkupInfoItem> _result = new List<MarkupInfoItem>();
646
            try
647
            {
648
                using (CIEntities entity = new CIEntities(ConnectStringBuilder.ProjectCIConnectString(ProjectNo).ToString()))
649
                {
650
                    var markupListData = entity.MARKUP_INFO.Where(data => data.DOCINFO_ID == DocInfoId).ToList();
521 651
                    //foreach (var item in markupListData)
522 652
                    //{
523 653
                    //    if (!item.AVOID_CONSOLIDATE.HasValue)
......
609 739

  
610 740
            return _result;
611 741
        }
612

  
742
        */
613 743
        [OperationContract]
614 744
        public List<MarkupInfoItem> GetSyncMarkupInfoItems(string ProjectNo, string DocInfoId, string currentUser)
615 745
        {

내보내기 Unified diff

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