프로젝트

일반

사용자정보

개정판 a36a37c3

IDa36a37c30e7c14b7d19db3cd5935c17265cf7d2b
상위 4e49a209
하위 78c80cca, 4913851c

백흠경이(가) 5년 이상 전에 추가함

issue #923: create PreviewUserMarkupInfoItem if there is no markupinfo or all of markupinfo are avoided

Change-Id: I541878f97686be22a3634baf991d3d98653faa28

차이점 보기:

KCOM/Services/BaseServices.cs
252 252

  
253 253
        /// <summary>
254 254
        /// get markupinfo and markupitem from database
255
        ///  - 1. called when document is loaded
256
        ///  - 2. called when user do consolidation
255 257
        /// </summary>
256 258
        /// <param name="sender"></param>
257 259
        /// <param name="e"></param>
......
264 266
            if (e.Result != null)
265 267
            {
266 268
                ViewerDataModel.Instance._markupInfoList.Clear();
267
                var pureItem = e.Result;
268
                if (pureItem.Count > 0)
269
                if (e.Result.Count > 0)
269 270
                {
270 271
                    ViewerDataModel.Instance.MyMarkupList.Clear();
271 272
                }
......
284 285
                    ViewerDataModel.Instance._markupInfoList.Add(info);
285 286
                }
286 287

  
287
                pureItem.ToList().ForEach(d => d.MarkupList.ForEach(p =>
288
                e.Result.ToList().ForEach(d => d.MarkupList.ForEach(p =>
288 289
                {
289 290
                    if (d.UserID == App.ViewInfo.UserID)
290 291
                    {
......
329 330
                    }
330 331
                }));
331 332

  
332
                var currentUser = e.Result.Where(data => data.UserID == userData.ID).FirstOrDefault();
333
                var currentUser = e.Result.Where(data => data.UserID == App.ViewInfo.UserID && data.AvoidConsolidate == 0).FirstOrDefault();
333 334
                if (currentUser == null)
334 335
                {
336
                    /// create a new markupinfo to do comments
335 337
                    var infoId = Commons.shortGuid();
336 338
                    PreviewUserMarkupInfoItem = new MarkupInfoItem
337 339
                    {
......
361 363
                    App.Custom_ViewInfoId = currentUser.MarkupInfoID;
362 364
                }
363 365

  
364
                foreach(var info in pureItem)
366
                foreach(var info in e.Result)
365 367
                {
366 368
                    if (info.UserID == App.ViewInfo.UserID) info.DisplayColor = "#FFFF0000";
367 369
                }
368 370

  
369
                //Consolidation 된 데이터가 최상단에 올 수 있도록 변경
371
                /// Consolidation 된 데이터가 최상단에 올 수 있도록 변경
370 372
                var markupItem = ViewerDataModel.Instance._markupInfoList.OrderByDescending(p => p.Consolidate == Convert.ToInt32(true)).ToList();
371

  
372 373
                markupItem.ForEach(data =>
373 374
                {
374 375
                    if (data.Depatment == null) data.Depatment = "Unknown";
......
376 377
                gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList;
377 378
                SetCommentPages();
378 379

  
379
                var select_item = ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == App.ViewInfo.UserID).OrderByDescending(order => order.Consolidate == Convert.ToInt32(true)).FirstOrDefault();
380
                this.gridViewMarkup.SelectedItem = select_item;
380
                var SelectedItem = ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == App.ViewInfo.UserID).OrderByDescending(order => order.UpdateTime).FirstOrDefault();
381
                this.gridViewMarkup.SelectedItem = (PreviewUserMarkupInfoItem != null) ? PreviewUserMarkupInfoItem : SelectedItem;
381 382

  
383
                /// create a group descriptor
382 384
                gridViewMarkup.GroupDescriptors.Clear();
383 385
                GroupDescriptor descriptor = new GroupDescriptor();
384 386
                descriptor.Member = "Depatment";
385 387
                descriptor.DisplayContent = "DEPT";
386 388
                descriptor.SortDirection = ListSortDirection.Ascending;
387 389
                gridViewMarkup.GroupDescriptors.Add(descriptor);
390
                /// up to here
388 391
            }
389 392
        }
390 393

  

내보내기 Unified diff

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