프로젝트

일반

사용자정보

개정판 3b7f9db8

ID3b7f9db8496756a70cb1033e01fe71becf6ab104
상위 3295dabe
하위 6ad9d92b

유성호이(가) 일년 이상 전에 추가함

issue #0000
삼성 유저 - 삼성 관련 필드는 삼성 사용자만 편집 가능하도록
도프텍 유저 - 삼성 관련 필드 제외 편집 가능하도록 수정

Change-Id: I90909874fc786d60d24c7623ef77b73189d12f28

차이점 보기:

ID2.Manager/ID2.Manager/Controls/BriefAndImages.cs
12 12
using Telerik.WinControls;
13 13
using Telerik.WinControls.UI;
14 14

  
15
using ID2.Manager.Common;
16

  
15 17
namespace ID2.Manager.Controls
16 18
{
17 19

  
18 20
    public partial class BriefAndImages : UserControl
19 21
    {
22
        readonly Informations informations = Informations.Instance;
20 23
        const int TextMinHeight = 30;
21 24
        public event EventHandler<AttImageInfo> RemoveImage;
25
        bool IsClient = false;
22 26

  
23 27
        public BriefAndImages()
24 28
        {
......
39 43
            selectImage.MouseWheel += SelectImage_MouseWheel;
40 44

  
41 45
            lstToImages.SelectedItemChanged += LstImages_SelectedItemChanged;
46
            lstToImages.ItemRemoving += LstToImages_ItemRemoving;
42 47
            lstToImages.ItemRemoved += LstToImages_ItemRemoved;
43 48
            lstToImages.VisualItemFormatting += LstImages_VisualItemFormatting;
44 49
            lstToImages.EditorInitialized += LstToImages_EditorInitialized;
45 50
            lstFrImages.SelectedItemChanged += LstImages_SelectedItemChanged;
51
            lstFrImages.ItemRemoving += LstFrImages_ItemRemoving;
46 52
            lstFrImages.ItemRemoved += LstFrImages_ItemRemoved;
47 53
            lstFrImages.VisualItemFormatting += LstImages_VisualItemFormatting;
48 54
            lstFrImages.EditorInitialized += LstFrImages_EditorInitialized;
55

  
56
            this.IsClient = !string.IsNullOrEmpty(informations.ActiveUser.RefProjectID);
57
            txtBriefDoftech.ReadOnly = this.IsClient;
58
            txtBriefSec.ReadOnly = !this.IsClient;
49 59
        }
50 60

  
51 61
        private void LstToImages_EditorInitialized(object sender, ListViewItemEditorInitializedEventArgs e)
......
56 66
        {
57 67
        }
58 68

  
69
        private void LstToImages_ItemRemoving(object sender, ListViewItemCancelEventArgs e)
70
        {
71
            if (RemoveImage != null)
72
            {
73
                e.Cancel = this.IsClient;
74
            }
75
        }
76

  
59 77
        private void LstToImages_ItemRemoved(object sender, ListViewItemEventArgs e)
60 78
        {
61 79
            if (RemoveImage != null)
......
63 81
                RemoveImage(this, e.Item.DataBoundItem as AttImageInfo);
64 82
            }
65 83
        }
84

  
85
        private void LstFrImages_ItemRemoving(object sender, ListViewItemCancelEventArgs e)
86
        {
87
            if (RemoveImage != null)
88
            {
89
                e.Cancel = !this.IsClient;
90
            }
91
        }
92

  
66 93
        private void LstFrImages_ItemRemoved(object sender, ListViewItemEventArgs e)
67 94
        {
68 95
            if (RemoveImage != null)
......
271 298
public class AttImageInfo
272 299
{
273 300
    public string ID { get; set; }
301
    public string Category { get; set; }
274 302
    public byte[] Data { get; set; }
275 303
}
ID2.Manager/ID2.Manager/Main.cs
144 144
        {
145 145
            try
146 146
            {
147

  
148
                if (this.radGridViewDocuments.SelectedRows.Count() > 0 && this.radGridViewDocuments.SelectedRows.First().DataBoundItem is Documents doc)
147
                if (e is AttImageInfo)
149 148
                {
150
                    var reslut = doc.AttFiles.RemoveAll(x => x.FileID == e.ID);
151

  
152
                    if (reslut > 0)
149
                    if (this.radGridViewDocuments.SelectedRows.Count() > 0 && this.radGridViewDocuments.SelectedRows.First().DataBoundItem is Documents doc)
153 150
                    {
151
                        var reslut = doc.AttFiles.RemoveAll(x => x.FileID == e.ID);
154 152

  
155
                    }
156
                    else
157
                    {
158
                        MessageBox.Show("삭제오류");
153
                        if (reslut > 0)
154
                        {
155

  
156
                        }
157
                        else
158
                        {
159
                            MessageBox.Show("삭제오류");
160
                        }
159 161
                    }
160 162
                }
161 163
            }
......
422 424
            {
423 425
                if (doc.AttFiles.Any(x => x.Category == "toreview"))
424 426
                {
425
                    var images = doc.AttFiles.Where(x => x.Category == "toreview").Select(x => new AttImageInfo { ID = x.FileID, Data = x.FileData });
427
                    var images = doc.AttFiles.Where(x => x.Category == "toreview").Select(x => new AttImageInfo { ID = x.FileID, Category = x.Category, Data = x.FileData });
426 428
                    briefAndImagesReview.SetToImages(images.ToList());
427 429
                }
428 430

  
429 431
                if (doc.AttFiles.Any(x => x.Category == "frreview"))
430 432
                {
431
                    var images = doc.AttFiles.Where(x => x.Category == "frreview").Select(x => new AttImageInfo { ID = x.FileID, Data = x.FileData });
433
                    var images = doc.AttFiles.Where(x => x.Category == "frreview").Select(x => new AttImageInfo { ID = x.FileID, Category = x.Category, Data = x.FileData });
432 434
                    briefAndImagesReview.SetFrImages(images.ToList());
433 435
                }
434 436

  
435 437
                if (doc.AttFiles.Any(x => x.Category == "prodvalidation"))
436 438
                {
437
                    var images = doc.AttFiles.Where(x => x.Category == "prodvalidation").Select(x => new AttImageInfo { ID = x.FileID, Data = x.FileData });
439
                    var images = doc.AttFiles.Where(x => x.Category == "prodvalidation").Select(x => new AttImageInfo { ID = x.FileID, Category = x.Category, Data = x.FileData });
438 440
                    briefAndImagesValidation.SetToImages(images.ToList());
439 441
                }
440 442

  
441 443
                if (doc.AttFiles.Any(x => x.Category == "clientvalidation"))
442 444
                {
443
                    var images = doc.AttFiles.Where(x => x.Category == "clientvalidation").Select(x => new AttImageInfo { ID = x.FileID, Data = x.FileData });
445
                    var images = doc.AttFiles.Where(x => x.Category == "clientvalidation").Select(x => new AttImageInfo { ID = x.FileID, Category = x.Category, Data = x.FileData });
444 446
                    briefAndImagesValidation.SetFrImages(images.ToList());
445 447
                }
446 448
            }
......
484 486
                LoadDockingLayout();
485 487
                InitializeGrid();
486 488

  
487
                bool isID2 = this.IsID2Connection();
488
                this.SetMenus(isID2);
489
                bool isID2DB = this.IsID2Connection();
490
                this.SetMenus(isID2DB);
489 491

  
490
                if (isID2)
492
                if (isID2DB)
491 493
                {
492 494
                    if (informations.ActiveUser != null && !string.IsNullOrEmpty(informations.ActiveUser.RefProjectID))
493 495
                    {
......
532 534
        {
533 535
            bool isSuccess = false;
534 536

  
535
            isSuccess = Globals.IsProjectDBConnstr();
536 537
            try
537 538
            {
538
                var id2Project = new ID2Controller().GetID2ProjectList();
539
                isSuccess = Globals.IsProjectDBConnstr();
540

  
541
                if (isSuccess)
542
                {
543
                    var id2Project = new ID2Controller().GetID2ProjectList();
544
                }
539 545
            }
540
            catch
546
            catch (Exception ex)
541 547
            {
548
                Program.logger.Error($"An exception occurred from {MethodBase.GetCurrentMethod().Name}", ex);
542 549
                isSuccess = false;
543 550
            }
544 551

  
......
603 610

  
604 611
        private void InitializeGrid()
605 612
        {
613
            InitializeColumns();
606 614
            InitializeSearch();
607 615
            InitializeGridViewDetail();
608 616
    
609 617
            //this.radGridViewDocuments.DataSource = new BindingList<Documents>(this.documents);
610 618
        }
611 619

  
620
        private void InitializeColumns()
621
        {
622
            bool isClient = !string.IsNullOrEmpty(informations.ActiveUser.RefProjectID);
623
            GridViewColumnCollection cols = this.radGridViewDocuments.Columns;
624

  
625
            cols.ForAll(x =>
626
            {
627
                switch (x.Name)
628
                {
629
                    case "FrReviewStatus":
630
                    case "FrRemarks":
631
                    case "FrCreator":
632
                    case "ClientReviewer":
633
                    case "ClientIsResult":
634
                    case "ClientRemarks":
635
                        x.ReadOnly = !isClient;
636
                        break;
637
                    default:
638
                        x.ReadOnly = isClient;
639
                        break;
640
                }
641
            });
642
        }
643

  
612 644
        private void InitializeSearch()
613 645
        {
614 646
            var font1 = ThemeResolutionService.GetCustomFont("TelerikWebUI");

내보내기 Unified diff

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