프로젝트

일반

사용자정보

개정판 b1591ae6

IDb1591ae676d4d0abf270e7c23dd0bedfb69fd2cb
상위 295ce375
하위 367fc955

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

issue #0000
저장수정 - 되는지 모름

Change-Id: I6b5f4412c72dcf593eee783e400c6b25372b94d1

차이점 보기:

ID2.Manager/ID2.Manager/Classes/DocumentsWorker.cs
88 88
        }
89 89
        protected override void DoWork(BackgroundWorker worker, DoWorkEventArgs e)
90 90
        {
91
            /*
92
            //수정리스트
93
            var sets = this.DocList.Where(x => !this.OrgList.Any(y => y.Equals(x))).ToList();
94
            var setorgs = this.OrgList.Intersect(sets, new DocumentsKeyComparer()).ToList();
95
            var newsets = sets.Except(this.OrgList, new DocumentsKeyComparer()).ToList();
96
            foreach (var newset in newsets)
97
            {
98
                newset.DocID = null;
99
            }
100
            if (sets != null && sets.Count > 0)
101
            {
102
                this.SetList.AddRange(sets);
103
            }
104
            //newsets.Select(x => { x.DocID = null; return x; });
105
            //sets.Except(this.OrgList, new DocumentsKeyComparer()).Select(x => { x.DocID = null; return x; })
106
            //this.OrgList.Except(this.DocList, new DocumentsKeyComparer())
107

  
108
            foreach (var set in sets)
109
            {
110
                List<AttFileInfo> setAtts = set.AttFiles ?? new List<AttFileInfo>();
111
                List<AttFileInfo> orgAtts = new List<AttFileInfo>();
112
                List<AttFileInfo> finalAtts = new List<AttFileInfo>();
113

  
114
                var org = setorgs.Where(x => x.DocID == (set.DocID ?? string.Empty)).FirstOrDefault();
115
                if (org != null)
116
                {
117
                    if (org.AttFiles != null)
118
                    {
119
                        orgAtts = org.AttFiles;
120
                    }
121
                }
122

  
123
                finalAtts.AddRange(orgAtts.Where(x => !setAtts.Any(y => y.FileID.Equals(x.FileID))));
124
                finalAtts.AddRange(setAtts.Where(x => !orgAtts.Any(y => y.FileID.Equals(x.FileID))).Select(x => { x.FileID = null; return x; }));
125

  
126
                if (finalAtts.Count > 0)
127
                {
128
                    set.AttFiles = finalAtts;
129
                }
130

  
131
                this.SetList.Add(set);
132
            }
133

  
134

  
135
            //this.DocList.Where(x => !this.OrgList.Any(y => y.Equals(x)))
136
            //            .ToList().ForEach(x => this.SetList.Add(x));
137

  
138
            //this.SetList.Intersect(this.OrgList, new DocumentsKeyComparer());
139

  
140
            //this.SetList.Select(x =>
141
            //{
142
            //    x.inter (this.OrgList, new DocumentsAttFileComparer())
143
            //    return x;
144
            //});
145
            //var test = this.OrgList.Except(this.DocList, new DocumentsAttFileComparer());
146
            */
147

  
91 148
            //수정리스트
92 149
            this.DocList.Where(x => !this.OrgList.Any(y => y.Equals(x)))
93 150
                        .ToList().ForEach(x => this.SetList.Add(x));
151
            foreach (var set in this.SetList)
152
            {
153
                List<AttFileInfo> setAtts = set.AttFiles ?? new List<AttFileInfo>();
154
                List<AttFileInfo> orgAtts = new List<AttFileInfo>();
155
                List<AttFileInfo> finalAtts = new List<AttFileInfo>();
156

  
157
                var org = this.OrgList.Where(x => x.DocID == (set.DocID ?? string.Empty)).FirstOrDefault();
158
                if (org != null)
159
                {
160
                    if (org.AttFiles != null)
161
                    {
162
                        orgAtts = org.AttFiles;
163
                    }
164
                }
165

  
166
                finalAtts.AddRange(orgAtts.Where(x => !setAtts.Any(y => y.FileID.Equals(x.FileID))));
167
                finalAtts.AddRange(setAtts.Where(x => !orgAtts.Any(y => y.FileID.Equals(x.FileID))).Select(x => { x.FileID = null; return x; }));
168

  
169
                if (finalAtts.Count > 0)
170
                {
171
                    set.AttFiles = finalAtts;
172
                }
173
            }
174

  
94 175
            //삭제리스트
95 176
            this.DelList.AddRange(this.OrgList.Except(this.DocList, new DocumentsKeyComparer()));
96 177

  

내보내기 Unified diff

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