프로젝트

일반

사용자정보

개정판 cdb2c0a2

IDcdb2c0a26b91776e94cd1845845d3586c2437463
상위 50b63148
하위 95e7bd84

김태성이(가) 4년 이상 전에 추가함

Document Info가 Null인 경우 발생하는 오류 수정

Change-Id: I62003b061af04cab567aaa0efa1a2216ef622d63

차이점 보기:

KCOM/Services/BaseServices.cs
255 255
            if (e.Error != null)
256 256
            {
257 257
                DialogMessage_Alert("The page cannot be displayed.", "Alert");
258
                return;
259 258
            }
260

  
261
            string sFolder = _ViewInfo.DocumentItemID.All(char.IsDigit) ? (Convert.ToUInt32(_ViewInfo.DocumentItemID) / 100).ToString() : (_ViewInfo.DocumentItemID.Length >= 5 ? _ViewInfo.DocumentItemID.Substring(0, 5) : _ViewInfo.DocumentItemID);
262
            var MainUrl = string.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal).Replace("png","jpg"), _ViewInfo.ProjectNO, sFolder, _ViewInfo.DocumentItemID, "{PageNo}");
263
            _DocInfo = e.Result;
264
            _DocInfo.ORIGINAL_FILE = HttpUtility.UrlDecode(_DocInfo.ORIGINAL_FILE);
265
            foreach (var item in _DocInfo.DOCPAGE.OrderBy(order => order.PAGE_NUMBER))
259
            else if (_DocInfo == null)
266 260
            {
267
                ViewerDataModel.Instance.Document_Info.Add(item);
261
                DialogMessage_Alert("Document information is missing.", "Alert");
268 262
            }
269
            Logger.sendReqLog("GetMarkupInfoItemsAsync", _ViewInfo.ProjectNO + "," + _DocInfo.ID, 1);
270
           CurrentDoc = new Common.DocumentSet
263
            else
271 264
            {
272
                docInfo = _DocInfo,
273
                Document_Id = _DocInfo.DOCUMENT_ID,
274
                File_Original = _DocInfo.ORIGINAL_FILE,
275

  
276
                Document_NO = _DocItem?.DOCUMENT_NO,
277
                File_Result = _DocItem?.RESULT_FILE,
278
                Group_No = _DocItem?.GROUP_NO,
279
                ProjectNo = _DocItem?.PROJECT_NO,
280
                Revision = _DocItem?.REVISION,
281
            };
265
                string sFolder = _ViewInfo.DocumentItemID.All(char.IsDigit) ? (Convert.ToUInt32(_ViewInfo.DocumentItemID) / 100).ToString() : (_ViewInfo.DocumentItemID.Length >= 5 ? _ViewInfo.DocumentItemID.Substring(0, 5) : _ViewInfo.DocumentItemID);
266
                var MainUrl = string.Format(CommonLib.Common.GetConfigString("mainServerImageWebPath", "URL", "", App.isExternal).Replace("png", "jpg"), _ViewInfo.ProjectNO, sFolder, _ViewInfo.DocumentItemID, "{PageNo}");
267
                _DocInfo = e.Result;
268
                _DocInfo.ORIGINAL_FILE = HttpUtility.UrlDecode(_DocInfo.ORIGINAL_FILE);
269
                foreach (var item in _DocInfo.DOCPAGE.OrderBy(order => order.PAGE_NUMBER))
270
                {
271
                    ViewerDataModel.Instance.Document_Info.Add(item);
272
                }
273
                Logger.sendReqLog("GetMarkupInfoItemsAsync", _ViewInfo.ProjectNO + "," + _DocInfo.ID, 1);
274
                CurrentDoc = new Common.DocumentSet
275
                {
276
                    docInfo = _DocInfo,
277
                    Document_Id = _DocInfo.DOCUMENT_ID,
278
                    File_Original = _DocInfo.ORIGINAL_FILE,
279

  
280
                    Document_NO = _DocItem?.DOCUMENT_NO,
281
                    File_Result = _DocItem?.RESULT_FILE,
282
                    Group_No = _DocItem?.GROUP_NO,
283
                    ProjectNo = _DocItem?.PROJECT_NO,
284
                    Revision = _DocItem?.REVISION,
285
                };
282 286

  
283
            var instanceMain = this.ParentOfType<MainWindow>();
284
            string firstpage = "1";
285
            string lastpage = _DocInfo.PAGE_COUNT.ToString();
286
            instanceMain.dzTopMenu.tlcurrentPage.Text = firstpage;
287
            instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = lastpage;
288
            string apptitle = string.Format("MARKUS(ver.{2}) - {0}(Rev.{1})", _DocItem?.DOCUMENT_NO, _DocItem?.REVISION, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
287
                var instanceMain = this.ParentOfType<MainWindow>();
288
                string firstpage = "1";
289
                string lastpage = _DocInfo.PAGE_COUNT.ToString();
290
                instanceMain.dzTopMenu.tlcurrentPage.Text = firstpage;
291
                instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = lastpage;
292
                string apptitle = string.Format("MARKUS(ver.{2}) - {0}(Rev.{1})", _DocItem?.DOCUMENT_NO, _DocItem?.REVISION, System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
289 293

  
290
            instanceMain.Title = apptitle;
294
                instanceMain.Title = apptitle;
291 295

  
292
            #region 페이지 이미지를 로컬에 저장
293
            string tempStoragePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(),"MARKUS", System.IO.Path.GetRandomFileName());
296
                #region 페이지 이미지를 로컬에 저장
297
                string tempStoragePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MARKUS", System.IO.Path.GetRandomFileName());
294 298

  
295
            //.Replace("jpg", "png")을 붙이는 이유는 MainUrl에 확장명이 jpg로 설정한 경우가 있기 때문
299
                //.Replace("jpg", "png")을 붙이는 이유는 MainUrl에 확장명이 jpg로 설정한 경우가 있기 때문
296 300

  
297
            #endregion
298
            App.PageStorage = new PageManager.PageStorage(MainUrl.Replace("jpg","png"), tempStoragePath,"png", _DocInfo.PAGE_COUNT);
299
         
300
            await this.pageNavigator.SetPageNaviAsync(CurrentDoc.docInfo.DOCPAGE.ToList(), MainUrl);
301
                #endregion
302
                App.PageStorage = new PageManager.PageStorage(MainUrl.Replace("jpg", "png"), tempStoragePath, "png", _DocInfo.PAGE_COUNT);
301 303

  
304
                await this.pageNavigator.SetPageNaviAsync(CurrentDoc.docInfo.DOCPAGE.ToList(), MainUrl);
305
            }
302 306
        }
303 307

  
304 308
        private void pageNavigator_ThumbInitialized(object sender,EventArgs e)

내보내기 Unified diff

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