프로젝트

일반

사용자정보

개정판 d65eb9b2

IDd65eb9b27a13b18ef44aca5e60c2e3b5e9ee1b6b
상위 f718c362
하위 3ca44acd, 7938d526

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

issue #0000
project group multi select 적용

Change-Id: I12084e96fe7e3ae9f73d68bcc80175a99229673b

차이점 보기:

ID2.Manager/ID2.Manager.Common/Helpers/ID2Excel.cs
36 36

  
37 37
        private ProjectInfo GetProject(string project)
38 38
        {
39
            List<ProjectInfo> projects = informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).ToList();
39
            //List<ProjectInfo> projects = informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).ToList();
40
            List<ProjectInfo> projects = (from allPrj in informations.ProjectList
41
                                          join actPrj in informations.ActiveProjects on allPrj.GroupID equals actPrj.ProjectID
42
                                          select allPrj).ToList();
40 43

  
41 44
            ProjectInfo prjInfo = projects.FirstOrDefault(x => x.Code.Equals(project));
42 45
            if (prjInfo != null) return prjInfo;
ID2.Manager/ID2.Manager.Common/Informations.cs
26 26
        }
27 27

  
28 28
        public UserInfo ActiveUser { get; set; }
29
        public ProjectInfo ActiveProject { get; set; }
29
        public List<ProjectInfo> ActiveProjects { get; set; } = new List<ProjectInfo>();
30 30

  
31 31
        public List<UserInfo> UserList { get; set; } = new List<UserInfo>();
32 32
        public List<ProjectInfo> ProjectList { get; set; } = new List<ProjectInfo>();
......
61 61
            return proj?.Team;
62 62
        }
63 63

  
64
        public List<ID2ProjectInfo> FindID2ProjectList(string ProjectGroupID)
64
        public List<ID2ProjectInfo> FindID2ProjectList(List<string> ProjectGroupIDs)
65 65
        {
66
            return this.ProjectList.Where(x =>
67
            {
68
                return x.GroupID.Equals(ProjectGroupID);
69
            }).Select(x => x.ID2Info).ToList();
66
            //return this.ProjectList.Where(x =>
67
            //{
68
            //    return x.GroupID.Equals(ProjectGroupID);
69
            //}).Select(x => x.ID2Info).ToList();
70
            return (from allPrj in this.ProjectList
71
                     join GrpPrj in ProjectGroupIDs on allPrj.GroupID equals GrpPrj
72
                     select allPrj).Select(x => x.ID2Info).ToList();
70 73
        }
71 74

  
72 75
        private readonly List<string> _JobLevel = new List<string>() { "1", "2", "3", "4", "5" };
ID2.Manager/ID2.Manager.Controller/Controllers/DocumentController.cs
16 16

  
17 17
        public DocumentController(ID2ProjectInfo id2Info) : base(id2Info) { }
18 18

  
19
        public IEnumerable<Documents> GetAllDocuments(string projectGroupID)
19
        public IEnumerable<Documents> GetAllDocuments(List<string> projectGroupIDs)
20 20
        {
21 21
            try
22 22
            {
23 23
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
24 24
                {
25
                    return rep.GetAllDocuments(projectGroupID);
25
                    return rep.GetAllDocuments(projectGroupIDs);
26 26
                }
27 27
            }
28 28
            catch (Exception ex)
......
31 31
            }
32 32
        }
33 33

  
34
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectGroupID, List<string> dateTypes, DateTime? frDate, DateTime? toDate, string team, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string id2Status, string id2Issues, string avevaStatus, string avevaIssues, string prodIsResult, string clientIsResult, string isGateWay, string isRegSystem)
34
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(List<string> projectGroupIDs, List<string> dateTypes, DateTime? frDate, DateTime? toDate, string team, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string id2Status, string id2Issues, string avevaStatus, string avevaIssues, string prodIsResult, string clientIsResult, string isGateWay, string isRegSystem)
35 35
        {
36 36
            try
37 37
            {
38 38
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
39 39
                {
40
                    return rep.GetDocuments(projectGroupID, dateTypes, frDate, toDate, team, projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, id2Status, id2Issues, avevaStatus, avevaIssues, prodIsResult, clientIsResult, isGateWay, isRegSystem);
40
                    return rep.GetDocuments(projectGroupIDs, dateTypes, frDate, toDate, team, projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, id2Status, id2Issues, avevaStatus, avevaIssues, prodIsResult, clientIsResult, isGateWay, isRegSystem);
41 41
                }
42 42
            }
43 43
            catch (Exception ex)
......
46 46
            }
47 47
        }
48 48

  
49
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(List<ID2ProjectInfo> id2Infos, string projectGroupID, List<string> dateTypes, DateTime? frDate, DateTime? toDate, string team, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string id2Issues, string id2Status, string avevaStatus, string avevaIssues, string prodIsResult, string clientIsResult, string isGateWay, string isRegSystem)
49
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(List<ID2ProjectInfo> id2Infos, List<string> projectGroupIDs, List<string> dateTypes, DateTime? frDate, DateTime? toDate, string team, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string id2Issues, string id2Status, string avevaStatus, string avevaIssues, string prodIsResult, string clientIsResult, string isGateWay, string isRegSystem)
50 50
        {
51 51
            try
52 52
            {
53
                var (dwgs, totalCnt) = this.GetDocuments(projectGroupID, dateTypes, frDate, toDate, team, projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, id2Status, id2Issues, avevaStatus, avevaIssues, prodIsResult, clientIsResult, isGateWay, isRegSystem);
53
                var (dwgs, totalCnt) = this.GetDocuments(projectGroupIDs, dateTypes, frDate, toDate, team, projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, id2Status, id2Issues, avevaStatus, avevaIssues, prodIsResult, clientIsResult, isGateWay, isRegSystem);
54 54

  
55 55
                IEnumerable<Documents> docs = dwgs;
56 56
                List<ID2Drawings> id2docs = null;
......
138 138
            }
139 139
        }
140 140

  
141
        public bool SetDocumentData(string projectGroupID, List<Documents> docList, List<string> delDocList, string userId)
141
        public bool SetDocumentData(List<string> projectGroupIDs, List<Documents> docList, List<string> delDocList, string userId)
142 142
        {
143 143
            try
144 144
            {
145 145
                using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
146 146
                {
147
                    return rep.SetDocumentData(projectGroupID, docList, delDocList, userId);
147
                    return rep.SetDocumentData(projectGroupIDs, docList, delDocList, userId);
148 148
                }
149 149
            }
150 150
            catch (Exception ex)
......
219 219
            return results;
220 220
        }
221 221

  
222
        public bool SetID2Sync(string projectGroupID, List<ID2ProjectInfo> id2Infos, string userId)
222
        public bool SetID2Sync(List<string> projectGroupIDs, List<ID2ProjectInfo> id2Infos, string userId)
223 223
        {
224 224
            bool isSuccess = false;
225 225

  
226 226
            try
227 227
            {
228
                IEnumerable<Documents> docs = this.GetAllDocuments(projectGroupID);
228
                IEnumerable<Documents> docs = this.GetAllDocuments(projectGroupIDs);
229 229
                List<ID2Drawings> id2docs = null;
230 230

  
231 231
                if (id2Infos.Any())
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs
20 20
    {
21 21
        public DocumentRepository(string connectionStr) : base(connectionStr) { }
22 22

  
23
        public IEnumerable<Documents> GetAllDocuments(string projectGroupID)
23
        public IEnumerable<Documents> GetAllDocuments(List<string> projectGroupIDs)
24 24
        {
25 25
            var dynamicParameters = new DynamicParameters();
26 26
            StringBuilder sbWhere = new StringBuilder();
27 27
            var parameters = new Dictionary<string, object>();
28
            if (!string.IsNullOrEmpty(projectGroupID))
28
            if (projectGroupIDs.Count > 0)
29 29
            {
30
                sbWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID=@RefGroupID) ");
31
                parameters.Add("RefGroupID", projectGroupID);
30
                sbWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID in @RefGroupIDs) ");
31
                parameters.Add("RefGroupIDs", projectGroupIDs);
32 32
            }
33 33

  
34 34
            try
......
60 60
        }
61 61

  
62 62

  
63
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectGroupID, List<string> dateTypes, DateTime? frDate, DateTime? toDate,  string team, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string id2Status, string id2Issues, string avevaStatus, string avevaIssues, string prodIsResult, string clientIsResult, string isGateWay, string isRegSystem)
63
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(List<string> projectGroupIDs, List<string> dateTypes, DateTime? frDate, DateTime? toDate,  string team, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string id2Status, string id2Issues, string avevaStatus, string avevaIssues, string prodIsResult, string clientIsResult, string isGateWay, string isRegSystem)
64 64
        {
65 65
            var map = new CustomPropertyTypeMap(typeof(AttFileInfo), (type, columnName)
66 66
     => type.GetProperties().FirstOrDefault(prop => GetDescriptionFromAttribute(prop) == columnName.ToLower()));
......
109 109
            if (projectCode == null)
110 110
            {
111 111
                sbWhere.Append(" and prj.Code is null ");
112
                sbTotalWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID=@RefGroupID) ");
113
                parameters.Add("RefGroupID", projectGroupID);
112
                sbTotalWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID in @RefGroupIDs) ");
113
                parameters.Add("RefGroupIDs", projectGroupIDs);
114 114
            }
115 115
            else if (projectCode.Equals(string.Empty))
116 116
            {
117
                sbWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID=@RefGroupID) ");
118
                sbTotalWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID=@RefGroupID) ");
119
                parameters.Add("RefGroupID", projectGroupID);
117
                sbWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID in @RefGroupIDs) ");
118
                sbTotalWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID in @RefGroupIDs) ");
119
                parameters.Add("RefGroupIDs", projectGroupIDs);
120 120
            }
121 121
            else
122 122
            {
123
                sbTotalWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID=@RefGroupID) ");
124
                parameters.Add("RefGroupID", projectGroupID);
123
                sbTotalWhere.Append(" and doc.RefProjectCode in (select Code from dbo.Projects where ParentID in @RefGroupIDs) ");
124
                parameters.Add("RefGroupIDs", projectGroupIDs);
125 125

  
126 126
                sbWhere.Append(" and doc.RefProjectCode=@RefProjectCode ");
127 127
                parameters.Add("RefProjectCode", projectCode);
......
347 347
//            }
348 348
//        }
349 349

  
350
        public bool SetDocumentData(string projectGroupID, List<Documents> docList, List<string> delDocList, string userId)
350
        public bool SetDocumentData(List<string> projectGroupIDs, List<Documents> docList, List<string> delDocList, string userId)
351 351
        {
352 352
            bool isSuccess = false;
353 353

  
......
825 825

  
826 826

  
827 827
        //Transactions
828
        public int GetTranKey(string userId, string projectID)
828
        public int GetTranKey(string userId, string projectIDs)
829 829
        {
830 830
            int result = -1;
831 831

  
......
836 836
                var parameters = new Dictionary<string, object>()
837 837
                {
838 838
                    { "UserId", userId },
839
                    { "ProjectID", projectID }
839
                    { "ProjectIDs", projectIDs }
840 840
                };
841 841

  
842 842
                dynamicParameters.AddDynamicParams(parameters);
......
846 846
                    string query = $@"
847 847
--log master 입력
848 848
insert into dbo.Transactions (UserId, ProjectID)
849
values (@UserId, @ProjectID);
849
values (@UserId, @ProjectIDs);
850 850
select scope_identity();";
851 851

  
852 852
                    result = base.ExecuteScalar<int>(query, dynamicParameters, transaction);
......
984 984
                string query = $@"
985 985
declare @CreatedDate datetime
986 986
declare @EndDate datetime
987
declare @ProjectGroupID varchar(36)
987
declare @ProjectGroupID varchar(4000)
988 988

  
989 989
select top 1 @CreatedDate=CreatedDate, @EndDate=EndDate, @ProjectGroupID=ProjectID
990 990
from   dbo.Transactions
ID2.Manager/ID2.Manager/Classes/DocumentsWorker.cs
65 65
        {
66 66
            try
67 67
            {
68
                var (dwgs, totalCnt) = new DocumentController().GetDocuments(informations.ActiveProject.ProjectID, this.DateTypes, this.FrDate, this.ToDate, this.Team, this.ProjectCode, this.PersonIncharge, this.JobLevel, this.DocumentNo, this.IsToIsDiscussion, this.IsFrReviewStatus, this.Id2Status, this.Id2Issues, this.AvevaStatus, this.AvevaIssues, this.ProdIsResult, this.ClientIsResult, this.DTIsGateWay, this.DTIsRegSystem);
68
                List<string> actPrjIDs = informations.ActiveProjects.Select(x => x.ProjectID).ToList();
69

  
70
                var (dwgs, totalCnt) = new DocumentController().GetDocuments(actPrjIDs, this.DateTypes, this.FrDate, this.ToDate, this.Team, this.ProjectCode, this.PersonIncharge, this.JobLevel, this.DocumentNo, this.IsToIsDiscussion, this.IsFrReviewStatus, this.Id2Status, this.Id2Issues, this.AvevaStatus, this.AvevaIssues, this.ProdIsResult, this.ClientIsResult, this.DTIsGateWay, this.DTIsRegSystem);
69 71
                e.Result = new DocumentsResult() { Dwgs = dwgs.ToList(), TotalCount = totalCnt };
70 72
            }
71 73
            catch (Exception ex)
......
99 101
        {
100 102
            try
101 103
            {
104
                List<string> actPrjIDs = informations.ActiveProjects.Select(x => x.ProjectID).ToList();
105

  
102 106
                //Get Transaction Key
103 107
                bool isTran = false;
104
                int trKey = new DocumentController().GetTranKey(informations.ActiveUser.ID, informations.ActiveProject.ProjectID);
108
                int trKey = new DocumentController().GetTranKey(informations.ActiveUser.ID, string.Join(",", actPrjIDs));
105 109

  
106 110
                //수정리스트
107 111
                var sets = this.DocList.Where(x => !this.OrgList.Any(y => y.Equals(x))).ToList();
......
143 147

  
144 148
                    if (isTran)
145 149
                    {
146
                        result = new DocumentController().SetDocumentData(informations.ActiveProject.ProjectID, sets, dels, informations.ActiveUser.ID);
150
                        result = new DocumentController().SetDocumentData(actPrjIDs, sets, dels, informations.ActiveUser.ID);
147 151

  
148 152
                        if (result)
149 153
                        {
......
205 209
        }
206 210
        protected override void DoWork(BackgroundWorker worker, DoWorkEventArgs e)
207 211
        {
208
            var id2Prjs = informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).Select(x => x.ID2Info).ToList();
212
            List<string> actPrjIDs = informations.ActiveProjects.Select(x => x.ProjectID).ToList();
213

  
214
            //var id2Prjs = informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).Select(x => x.ID2Info).ToList();
215
            var id2Prjs = (from allPrj in informations.ProjectList
216
                           join actPrj in informations.ActiveProjects on allPrj.GroupID equals actPrj.ProjectID
217
                           select allPrj.ID2Info).ToList();
209 218

  
210
            e.Result = new DocumentController().SetID2Sync(informations.ActiveProject.ProjectID, id2Prjs, informations.ActiveUser.ID);
219
            e.Result = new DocumentController().SetID2Sync(actPrjIDs, id2Prjs, informations.ActiveUser.ID);
211 220
        }
212 221

  
213 222
        protected override void WorkCompleted(RunWorkerCompletedEventArgs e)
ID2.Manager/ID2.Manager/Controls/OpenProjectView.cs
37 37
            this.radButtonDelete.Click += RadButtonDelete_Click;
38 38
            this.radButtonOpen.Click += RadButtonOpen_Click;
39 39
            this.radButtonClose.Click += RadButtonClose_Click;
40

  
41
            this.Initialize();
42
        }
43

  
44
        private void Initialize()
45
        {
46
            bool IsID2Manager = (new string[] { "Admin", "Manager" }).Contains(informations.ActiveUser.Role) && string.IsNullOrEmpty(informations.ActiveUser.RefProjectID);
47
            this.radGridViewGroup.MultiSelect = IsID2Manager;
40 48
        }
41 49

  
42 50
        private void OpenProjectView_Load(object sender, EventArgs e)
......
52 60
            }
53 61
            this.radGridViewGroup.DataSource = informations.ProjectList.Where(x => x.Level.Equals(1));
54 62

  
55
            if (informations.ActiveProject != null)
63
            if (informations.ActiveProjects.Count > 0)
56 64
            {
57
                var selectedRow = this.radGridViewGroup.Rows.FirstOrDefault(o => (o.DataBoundItem as ProjectInfo).ProjectID.Equals(informations.ActiveProject.ProjectID));
58
                if (selectedRow != null)
65
                //foreach (var actPrj in informations.ActiveProjects)
66
                //{
67
                //    var selectedRow = this.radGridViewGroup.Rows.FirstOrDefault(o => (o.DataBoundItem as ProjectInfo).ProjectID.Equals(actPrj.ProjectID));
68
                //    if (selectedRow != null)
69
                //    {
70
                //        this.radGridViewGroup.CurrentRow = selectedRow;
71
                //        this.radGridViewGroup.CurrentRow.IsSelected = true;
72
                //    }
73
                //}
74
                var selectedRows = (from selPrjRow in this.radGridViewGroup.Rows
75
                                   join actPrj in informations.ActiveProjects on (selPrjRow.DataBoundItem as ProjectInfo).ProjectID equals actPrj.ProjectID
76
                                   select selPrjRow).ToList();
77
                if (selectedRows.Count > 0)
59 78
                {
60
                    this.radGridViewGroup.CurrentRow = selectedRow;
61
                    this.radGridViewGroup.CurrentRow.IsSelected = true;
79
                    if (selectedRows.Count == 1)
80
                    {
81
                        var selectedRow = selectedRows[0];
82

  
83
                        this.radGridViewGroup.CurrentRow = selectedRow;
84
                        this.radGridViewGroup.CurrentRow.IsSelected = true;
85
                    }
86
                    else
87
                    {
88
                        foreach (var selectedRow in selectedRows)
89
                        {
90
                            selectedRow.IsSelected = true;
91
                        }
92
                    }
62 93
                }
63 94
            }
64 95
        }
......
72 103

  
73 104
            if (this.radGridViewGroup.SelectedRows.Count == 0) return;
74 105

  
75
            var projectGroup = this.radGridViewGroup.SelectedRows[0].DataBoundItem as ProjectInfo;
106
            var projectGroups = this.radGridViewGroup.SelectedRows.Select(x => x.DataBoundItem as ProjectInfo);
107

  
108
            //this.radGridViewProjects.DataSource = informations.ProjectList.Where(x => x.Level.Equals(2) && x.GroupID.Equals(projectGroup.ProjectID));
109
            this.radGridViewProjects.DataSource = (from allPrj in informations.ProjectList
110
                                                   join selPrj in projectGroups on allPrj.GroupID equals selPrj.ProjectID
111
                                                   select allPrj).ToList();
76 112

  
77
            this.radGridViewProjects.DataSource = informations.ProjectList.Where(x => x.Level.Equals(2) && x.GroupID.Equals(projectGroup.ProjectID));
78 113
        }
79 114

  
80 115
        private void RadGridViewGroup_CellDoubleClick(object sender, GridViewCellEventArgs e)
......
105 140

  
106 141
        private void RadButtonDelete_Click(object sender, EventArgs e)
107 142
        {
108
            if (this.radGridViewGroup.SelectedRows.Count == 0)
143
            if (this.radGridViewGroup.SelectedRows.Count == 0 || this.radGridViewGroup.SelectedRows.Count > 1)
109 144
            {
110 145
                RadMessageBox.Show("Please select a project.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
111 146
                return;
......
113 148

  
114 149
            var selectedProjectGroup = this.radGridViewGroup.SelectedRows[0].DataBoundItem as ProjectInfo;
115 150

  
116
            if (informations.ActiveProject != null)
151
            if (informations.ActiveProjects.Count > 0)
117 152
            {
118
                bool isActive = informations.ActiveProject.ProjectID == selectedProjectGroup.ProjectID;
153
                List<string> actPrjIDs = informations.ActiveProjects.Select(x => x.ProjectID).ToList();
154

  
155
                bool isActive = actPrjIDs.Contains(selectedProjectGroup.ProjectID);
119 156

  
120 157
                if (isActive)
121 158
                {
......
124 161
                }
125 162
            }
126 163

  
127
            if (this.radGridViewGroup.SelectedRows.Count == 0)
128
            {
129
                RadMessageBox.Show("Please select a project.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
130
                return;
131
            }
164
            //if (this.radGridViewGroup.SelectedRows.Count == 0)
165
            //{
166
            //    RadMessageBox.Show("Please select a project.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
167
            //    return;
168
            //}
132 169

  
133 170
            if (RadMessageBox.Show($"Are you sure you want to delete '{selectedProjectGroup.Name}'?", Globals.Name, MessageBoxButtons.YesNo, RadMessageIcon.Question) == DialogResult.Yes)
134 171
            {
......
164 201
                return;
165 202
            }
166 203

  
167
            var projectGroup = this.radGridViewGroup.SelectedRows[0].DataBoundItem as ProjectInfo;
204
            //var projectGroup = this.radGridViewGroup.SelectedRows[0].DataBoundItem as ProjectInfo;
205
            var projectGroups = this.radGridViewGroup.SelectedRows.Select(x => x.DataBoundItem as ProjectInfo);
168 206

  
169
            OpenProjectClick?.Invoke(this, new ProjectEventArgs(projectGroup));
207
            OpenProjectClick?.Invoke(this, new ProjectEventArgs(projectGroups.ToList()));
170 208
        }
171 209

  
172 210
        private void RadButtonClose_Click(object sender, EventArgs e)
......
177 215

  
178 216
    public class ProjectEventArgs : EventArgs
179 217
    {
180
        private ProjectInfo _ProjectInfo = null;
181
        public ProjectInfo ProjectInfo
218
        private List<ProjectInfo> _ProjectInfos = new List<ProjectInfo>();
219
        public List<ProjectInfo> ProjectInfos
182 220
        {
183
            get { return _ProjectInfo; }
221
            get { return _ProjectInfos; }
184 222
        }
185 223

  
186
        public ProjectEventArgs(ProjectInfo projectInfo)
224
        public ProjectEventArgs(List<ProjectInfo> projectInfos)
187 225
        {
188
            this._ProjectInfo = projectInfo;
226
            this._ProjectInfos = projectInfos;
189 227
        }
190 228
    }
191 229
}
ID2.Manager/ID2.Manager/Main.Designer.cs
1394 1394
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
1395 1395
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 85F));
1396 1396
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
1397
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 128F));
1397
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F));
1398 1398
            this.tableLayoutPanelCondition.Controls.Add(this.radDropDownListFrReviewStatus, 4, 2);
1399 1399
            this.tableLayoutPanelCondition.Controls.Add(this.radDropDownListToIsDiscussion, 2, 2);
1400 1400
            this.tableLayoutPanelCondition.Controls.Add(this.radLabelFrReviewStatus, 3, 2);
ID2.Manager/ID2.Manager/Main.cs
626 626
                {
627 627
                    if (informations.ActiveUser != null && !string.IsNullOrEmpty(informations.ActiveUser.RefProjectID))
628 628
                    {
629
                        informations.ActiveProject = new ProjectController().GetProjectInfo(informations.ActiveUser.RefProjectID);
629
                        informations.ActiveProjects = new List<ProjectInfo>() { new ProjectController().GetProjectInfo(informations.ActiveUser.RefProjectID) };
630 630
                        informations.ProjectList = new ProjectController().GetAllProjectList().ToList();
631 631

  
632 632
                        this.LoadProject(true);
......
675 675
        private void SearchSymbols(string SymbolName)
676 676
        {
677 677
            var AllSymbols = new List<ID2Symbol>();
678
            var id2prjs = informations.FindID2ProjectList(informations.ActiveProject.ProjectID).Where(x =>
678
            List<string> actPrjIDs = informations.ActiveProjects.Select(x => x.ProjectID).ToList();
679
            var id2prjs = informations.FindID2ProjectList(actPrjIDs).Where(x =>
679 680
            !string.IsNullOrEmpty(x.Host) && !string.IsNullOrEmpty(x.User) && !string.IsNullOrEmpty(x.Password)).ToList();
680 681
            foreach (var id2prj in id2prjs)
681 682
            {
......
1088 1089
                {
1089 1090
                    var prjArgs = this.radRibbonBarBackstageViewID2Manager.Tag as ProjectEventArgs;
1090 1091

  
1091
                    informations.ActiveProject = prjArgs.ProjectInfo;
1092
                    informations.ActiveProjects = prjArgs.ProjectInfos;
1092 1093

  
1093 1094
                    this.radRibbonBarBackstageViewID2Manager.Tag = null;
1094 1095

  
......
1109 1110
            try
1110 1111
            {
1111 1112
                //Project Group Name
1112
                this.radLabelProjectGroupNm.Text = informations.ActiveProject.Name;
1113
                //this.radLabelProjectGroupNm.Text = informations.ActiveProject.Name;
1114
                this.radLabelProjectGroupNm.Text = string.Join(", ", informations.ActiveProjects.Select(x => x.Name));
1113 1115

  
1114 1116
                #region Date
1115 1117
                //Date Type
......
1133 1135
                //Team List
1134 1136
                if (this.radDropDownListTeam.Items.Count > 0)
1135 1137
                    this.radDropDownListTeam.Items.Clear();
1136
                informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID) && !string.IsNullOrEmpty(x.Team))
1137
                                        .GroupBy(g => g.Team)
1138
                                        .OrderBy(o => o.Key)
1139
                                        .Select(x => x.Key)
1140
                                        .ForAll(x =>
1141
                                        {
1142
                                            this.radDropDownListTeam.Items.Add(new RadListDataItem(x, x));
1143
                                        });
1138
                //informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID) && !string.IsNullOrEmpty(x.Team))
1139
                //                        .GroupBy(g => g.Team)
1140
                //                        .OrderBy(o => o.Key)
1141
                //                        .Select(x => x.Key)
1142
                //                        .ForAll(x =>
1143
                //                        {
1144
                //                            this.radDropDownListTeam.Items.Add(new RadListDataItem(x, x));
1145
                //                        });
1146
                (from allPrj in informations.ProjectList
1147
                 join actPrj in informations.ActiveProjects on allPrj.GroupID equals actPrj.ProjectID
1148
                 where !string.IsNullOrEmpty(allPrj.Team)
1149
                 select allPrj).GroupBy(g => g.Team)
1150
                               .OrderBy(o => o.Key)
1151
                               .Select(x => x.Key)
1152
                               .ForAll(x =>
1153
                               {
1154
                                   this.radDropDownListTeam.Items.Add(new RadListDataItem(x, x));
1155
                               });
1156

  
1157

  
1144 1158
                var allTeam = new RadListDataItem("== 전체 ==", string.Empty);
1145 1159
                this.radDropDownListTeam.Items.Insert(0, allTeam);
1146 1160
                allTeam.Selected = true;
1147 1161

  
1148 1162
                //Project List
1149
                if (this.radDropDownListProject.Items.Count > 0)
1150
                    this.radDropDownListProject.Items.Clear();
1151
                informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).ToList()
1152
                                        .ForEach(x =>
1153
                                        {
1154
                                            this.radDropDownListProject.Items.Add(new RadListDataItem(x.Name, x.Code));
1155
                                        });
1156
                
1163
                //if (this.radDropDownListProject.Items.Count > 0)
1164
                //    this.radDropDownListProject.Items.Clear();
1165
                //informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).ToList()
1166
                //                        .ForEach(x =>
1167
                //                        {
1168
                //                            this.radDropDownListProject.Items.Add(new RadListDataItem(x.Name, x.Code));
1169
                //                        });
1170
                (from allPrj in informations.ProjectList
1171
                 join actPrj in informations.ActiveProjects on allPrj.GroupID equals actPrj.ProjectID
1172
                 select allPrj).ForAll(x =>
1173
                 {
1174
                     this.radDropDownListProject.Items.Add(new RadListDataItem(x.Name, x.Code));
1175
                 });
1176

  
1157 1177
                this.radDropDownListProject.Items.Add(new RadListDataItem("== ID2 Project 미등록 ==", null));//ID2 Project 미등록
1158 1178

  
1159 1179
                var allProject = new RadListDataItem("== 전체 ==", string.Empty);
......
1408 1428
            try
1409 1429
            {
1410 1430
                GridViewComboBoxColumn ColProjects = this.radGridViewDocuments.Columns["RefProjectCode"] as GridViewComboBoxColumn;
1411
                ColProjects.DataSource = informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).Select(x => x.Code).ToList();
1431
                //ColProjects.DataSource = informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).Select(x => x.Code).ToList();
1432
                ColProjects.DataSource = (from allPrj in informations.ProjectList
1433
                                         join actPrj in informations.ActiveProjects on allPrj.GroupID equals actPrj.ProjectID
1434
                                         select allPrj).Select(x => x.Code).ToList();
1412 1435
                //ColProjects.DisplayMember = "Name";
1413 1436
                //ColProjects.ValueMember = "Code";
1414 1437

  
......
1651 1674
                    {
1652 1675
                        this.radRibbonBarBackstageViewID2Manager.HidePopup();
1653 1676

  
1654
                        informations.ActiveProject = new ProjectController().GetProjectInfo(informations.ActiveUser.RefProjectID);
1677
                        informations.ActiveProjects = new List<ProjectInfo>() { new ProjectController().GetProjectInfo(informations.ActiveUser.RefProjectID) };
1655 1678
                        informations.ProjectList = new ProjectController().GetAllProjectList().ToList();
1656 1679

  
1657 1680
                        this.LoadProject(true);
......
2489 2512
                {
2490 2513
                    if (informations.ActiveUser != null && !string.IsNullOrEmpty(informations.ActiveUser.RefProjectID))
2491 2514
                    {
2492
                        informations.ActiveProject = new ProjectController().GetProjectInfo(informations.ActiveUser.RefProjectID);
2515
                        //informations.ActiveProject = new ProjectController().GetProjectInfo(informations.ActiveUser.RefProjectID);
2516
                        informations.ActiveProjects = new List<ProjectInfo>() { new ProjectController().GetProjectInfo(informations.ActiveUser.RefProjectID) };
2493 2517
                        informations.ProjectList = new ProjectController().GetAllProjectList().ToList();
2494 2518

  
2495 2519
                        isReload = true;
2496 2520
                    }
2497
                    else if (informations.ActiveProject != null)
2521
                    else if (informations.ActiveProjects.Count > 0)
2498 2522
                    {
2499 2523
                        informations.ProjectList = new ProjectController().GetAllProjectList().ToList();
2500 2524

  
......
2565 2589
        {
2566 2590
            try
2567 2591
            {
2568
                AttFileInfo notiFileInfo = new AttFileController().GetAttFileInfo(informations.ActiveProject.ProjectID, "notice");
2592
                AttFileInfo notiFileInfo = new AttFileController().GetAttFileInfo(informations.ActiveProjects[0].ProjectID, "notice");
2569 2593

  
2570 2594
                if (notiFileInfo == null)
2571 2595
                {
......
2680 2704
                }
2681 2705
            }
2682 2706

  
2683
            using (OpenFileDialog ofd = new OpenFileDialog()
2684
            {
2685
                //Filter = "PDF files (*.pdf)|*.pdf|All files (*.*)|*.*",
2686
                Filter = "All Images Files (*.png;*.jpeg;*.gif;*.jpg;*.bmp)|*.png;*.jpeg;*.gif;*.jpg;*.bmp"
2687
                       + "|PNG Portable Network Graphics (*.png)|*.png"
2688
                       + "|JPEG File Interchange Format (*.jpg *.jpeg *jfif)|*.jpg;*.jpeg;*.jfif"
2689
                       + "|BMP Windows Bitmap (*.bmp)|*.bmp"
2690
                       + "|GIF Graphics Interchange Format (*.gif)|*.gif",
2691
                //Title = "Open an Excel File",
2692
                RestoreDirectory = true
2693
            })
2707
            if (informations.ActiveProjects.Count == 1)
2694 2708
            {
2695
                try
2709
                using (OpenFileDialog ofd = new OpenFileDialog()
2710
                {
2711
                    //Filter = "PDF files (*.pdf)|*.pdf|All files (*.*)|*.*",
2712
                    Filter = "All Images Files (*.png;*.jpeg;*.gif;*.jpg;*.bmp)|*.png;*.jpeg;*.gif;*.jpg;*.bmp"
2713
                           + "|PNG Portable Network Graphics (*.png)|*.png"
2714
                           + "|JPEG File Interchange Format (*.jpg *.jpeg *jfif)|*.jpg;*.jpeg;*.jfif"
2715
                           + "|BMP Windows Bitmap (*.bmp)|*.bmp"
2716
                           + "|GIF Graphics Interchange Format (*.gif)|*.gif",
2717
                    //Title = "Open an Excel File",
2718
                    RestoreDirectory = true
2719
                })
2696 2720
                {
2697
                    if (ofd.ShowDialog() == DialogResult.OK)
2721
                    try
2698 2722
                    {
2699
                        FileInfo fileInfo = new FileInfo(ofd.FileName);
2700
                        if (fileInfo.Exists)
2723
                        if (ofd.ShowDialog() == DialogResult.OK)
2701 2724
                        {
2702
                            AttFileInfo attFile = new AttFileInfo()
2725
                            FileInfo fileInfo = new FileInfo(ofd.FileName);
2726
                            if (fileInfo.Exists)
2703 2727
                            {
2704
                                RefID = informations.ActiveProject.ProjectID,
2705
                                Category = "notice",
2706
                                FileType = GetContentType(fileInfo.FullName),
2707
                                FileName = fileInfo.Name,
2708
                                FilePath = fileInfo.DirectoryName,
2709
                                FileExtension = fileInfo.Extension
2710
                            };
2711

  
2712
                            using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read))
2713
                            {
2714
                                using (var reader = new BinaryReader(stream))
2728
                                AttFileInfo attFile = new AttFileInfo()
2729
                                {
2730
                                    RefID = informations.ActiveProjects[0].ProjectID,
2731
                                    Category = "notice",
2732
                                    FileType = GetContentType(fileInfo.FullName),
2733
                                    FileName = fileInfo.Name,
2734
                                    FilePath = fileInfo.DirectoryName,
2735
                                    FileExtension = fileInfo.Extension
2736
                                };
2737

  
2738
                                using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read))
2715 2739
                                {
2716
                                    attFile.FileData = reader.ReadBytes((int)stream.Length);
2740
                                    using (var reader = new BinaryReader(stream))
2741
                                    {
2742
                                        attFile.FileData = reader.ReadBytes((int)stream.Length);
2743
                                    }
2717 2744
                                }
2718
                            }
2719 2745

  
2720
                            bool result = new AttFileController().SetAttFiles(new List<AttFileInfo>() { attFile }, informations.ActiveUser.ID);
2746
                                bool result = new AttFileController().SetAttFiles(new List<AttFileInfo>() { attFile }, informations.ActiveUser.ID);
2721 2747

  
2722
                            if (result)
2723
                            {
2724
                                RadMessageBox.Show("An Notice has been posted.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
2748
                                if (result)
2749
                                {
2750
                                    RadMessageBox.Show("An Notice has been posted.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
2751
                                }
2725 2752
                            }
2726 2753
                        }
2727 2754
                    }
2755
                    catch (Exception ex)
2756
                    {
2757
                        Program.logger.Error($"An exception occurred from {MethodBase.GetCurrentMethod().Name}", ex);
2758
                        RadMessageBox.Show("Failed to register the Notice.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Error);
2759
                    }
2728 2760
                }
2729
                catch (Exception ex)
2730
                {
2731
                    Program.logger.Error($"An exception occurred from {MethodBase.GetCurrentMethod().Name}", ex);
2732
                    RadMessageBox.Show("Failed to register the Notice.", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Error);
2733
                }
2761
            }
2762
            else
2763
            {
2764
                RadMessageBox.Show("Please select a project.", "Error", MessageBoxButtons.OK, RadMessageIcon.Info);
2765
                return;
2734 2766
            }
2735 2767
        }
2736 2768

  

내보내기 Unified diff