프로젝트

일반

사용자정보

개정판 41fa3d98

ID41fa3d98ae87e979aed72513a7731f31a9674c2c
상위 c47f358b
하위 783f535c

김동진이(가) 5년 이상 전에 추가함

issue #1123: docinfo update 수정. ignore true 옵션 추가.

Change-Id: I82f28d36d2485116fc009ec008ccb05ae48cc2ad

차이점 보기:

ConvertService/ServiceBase/Markus.Service.DataBase/ConvertDatabase.cs
138 138
                string docId = new Guid().CreateUniqueGuid().ToString();
139 139

  
140 140
                var docinfo = entities.DOCINFO.FirstOrDefault(x => x.PROJECT_NO == convertDoc.PROJECT_NO && x.DOCUMENT_ID == convertDoc.DOCUMENT_ID);
141

  
141
                
142 142
                if (docinfo != null)
143 143
                {
144
                    // 기존 코멘트 유지
145
                    docId = docinfo.ID;
144
                    // 기존 Docpage 삭제.
146 145
                    entities.DOCPAGE.RemoveRange(docinfo.DOCPAGE);
147
                    entities.DOCINFO.Remove(docinfo);
146

  
147
                    // 기존 코멘트 유지를 위한 Docinfo update                    
148
                    docinfo.PROJECT_NO = convertDoc.PROJECT_NO;
149
                    docinfo.ORIGINAL_FILE = convertDoc.DOCUMENT_URL;
150
                    docinfo.PAGE_COUNT = totalPage;                    
151
                    docinfo.DOCPAGE = pageinfo;                    
148 152
                    entities.SaveChanges();
153
                    result = true;
149 154
                }
150

  
151
                DOCINFO instace = new DOCINFO
152
                {
153
                    ID = docId,
154
                    PROJECT_NO = convertDoc.PROJECT_NO,
155
                    ORIGINAL_FILE = convertDoc.DOCUMENT_URL,
156
                    DOCUMENT_ID = convertDoc.DOCUMENT_ID,
157
                    PAGE_COUNT = totalPage,
158
                    DOCPAGE = pageinfo
159
                };
160

  
161
                entities.DOCINFO.Add(instace);
162
                var save = entities.SaveChanges();
163

  
164
                if (save == pageinfo.Count() + 1)
155
                else
165 156
                {
166
                    result = true;
157
                    DOCINFO instace = new DOCINFO
158
                    {
159
                        ID = docId,
160
                        PROJECT_NO = convertDoc.PROJECT_NO,
161
                        ORIGINAL_FILE = convertDoc.DOCUMENT_URL,
162
                        DOCUMENT_ID = convertDoc.DOCUMENT_ID,
163
                        PAGE_COUNT = totalPage,
164
                        DOCPAGE = pageinfo
165
                    };
166

  
167
                    entities.DOCINFO.Add(instace);
168
                    var save = entities.SaveChanges();
169

  
170
                    if (save == pageinfo.Count() + 1)
171
                    {
172
                        result = true;
173
                    }
167 174
                }
175

  
176
                
177
                
168 178
            }
169 179

  
170 180
            return result;

내보내기 Unified diff

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