프로젝트

일반

사용자정보

개정판 35a96e24

ID35a96e24e41374f3a5277c44524f7e04d7c1e5cd
상위 d10bc7ef
하위 16a422d1

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

issue #000: BaseClient_GetMarkupInfoItemsCompleted에서 컨트롤을 생성하도록 수정

Change-Id: I378eb435ba6f0c5c45e3af40cb4ebfb6b79c2afa

차이점 보기:

KCOM/Events/Implementation/TopMenuEvent.cs
334 334

  
335 335
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
336 336

  
337
                //콘솔리 데잇일 경우 
338
                //if (ViewerDataModel.Instance.IsConsolidate && menu.gridViewMarkup.SelectedItems.Count > 1)
339
                //if (ViewerDataModel.Instance.IsConsolidate)
340
                //{
341
                //    ViewerDataModel.Instance.IsConsolidate = false;
342
                //    return;
343
                //}
344

  
345
                //코멘트가 없을 경우
346
                //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
347
                //{
348
                //    foreach (var item in menu.gridViewMarkup.SelectedItems)
349
                //    {
350
                //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
351
                //        {
352
                //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
353
                //            return;
354
                //        }
355
                //    }
356
                //}
357

  
358 337
                //코멘트가 없을 경우
359 338
                if (ViewerDataModel.Instance.MarkupList_USER.Count == 0)
360 339
                {
......
368 347
                    }
369 348
                }
370 349

  
371
                if (ViewerDataModel.Instance.MarkupList_USER.Count > 0)
372
                {
373
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
374
                    {
375
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
376
                        {
377
                            /*
378
                            if (menu.UndoData.Markup_List[0].Markup..GetType().Name == "TextControl" && ((MarkupToPDF.Controls.Text.TextControl)(item as IKCOM.MarkupInfoItem).MarkupList[0].).OverViewText == null)
379
                            {
380
                            }
381

  
382
                            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
383
                            return;*/
384
                        }
385
                    }
386
                }
387
                
388

  
389
                    //코멘트가 없을 경우
390
                    //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0)
391
                    //if (ViewerDataModel.Instance.MarkupControls_USER.Count == 0 && menu.gridViewMarkup.SelectedItems.Count == 0)
392
                    //{
393
                    //    foreach (var item in menu.gridViewMarkup.SelectedItems)
394
                    //    {
395
                    //        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
396
                    //        {
397
                    //            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
398
                    //            return;
399
                    //        }
400
                    //    }
401
                    //}
402

  
403
                    menu.ChangeCommentReact();
350
                menu.ChangeCommentReact();
404 351

  
405 352
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
406 353
                {
......
411 358
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
412 359
                    return;
413 360
                }
414
                //else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as  IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
415
                //{
416
                //    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
417
                //    return;
418
                //}
419
                // 변경
420 361
                else
421 362
                {
422 363
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
......
446 387
                            return;
447 388
                        }
448 389
                    }
449
                    ////강인구 변경
450
                    //this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
451 390
                }
452 391
                if (sender != null)
453 392
                {
KCOM/KCOM.csproj
320 320
    </Compile>
321 321
    <Compile Include="Controls\TeighaD3DImage.cs" />
322 322
    <Compile Include="Controls\TeighaD3DImageResult.cs" />
323
    <Compile Include="Events\ConsolidateCommand.cs" />
323 324
    <Compile Include="Events\DeleteCommand.cs" />
324 325
    <Compile Include="Events\SaveCommand.cs" />
325 326
    <Compile Include="IAbstractDatabase.cs" />
KCOM/Services/BaseServices.cs
183 183
        }
184 184
        public MarkupInfoItem PreviewUserMarkupInfoItem { get; set; }
185 185

  
186
        /// <summary>
187
        /// get markupinfo and markupitem from database
188
        /// </summary>
189
        /// <param name="sender"></param>
190
        /// <param name="e"></param>
186 191
        private void BaseClient_GetMarkupInfoItemsCompleted(object sender, GetMarkupInfoItemsCompletedEventArgs e)
187 192
        {
188 193
            Logger.sendResLog("GetMarkupInfoItemsCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1);
......
204 209
                        d.userDelete = true;
205 210
                        d.DisplayColor = "#FFFF0000";
206 211

  
207
                        ViewerDataModel.Instance.MarkupList_USER.Add(new MarkupItemEx
212
                        MarkupItemEx markup = new MarkupItemEx
208 213
                        {
209 214
                            Data = p.Data,
210 215
                            Data_Type = p.Data_Type,
......
214 219
                            PageNumber = p.PageNumber,
215 220
                            Symbol_ID = p.Symbol_ID,
216 221
                            Group_ID = p.Group_ID
217
                        });
222
                        };
223
                        ViewerDataModel.Instance.MarkupList_USER.Add(markup);
224

  
225
                        var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, d.DisplayColor, "",
226
                                        d.MarkupInfoID, markup.ID);
227
                        control.Visibility = Visibility.Hidden;
218 228
                    }
219 229
                    else
220 230
                    {
221
                        ViewerDataModel.Instance.MarkupList_Pre.Add(new MarkupItemEx
231
                        MarkupItemEx markup = new MarkupItemEx
222 232
                        {
223 233
                            Data = p.Data,
224 234
                            Data_Type = p.Data_Type,
......
228 238
                            PageNumber = p.PageNumber,
229 239
                            Symbol_ID = p.Symbol_ID,
230 240
                            Group_ID = p.Group_ID
231
                        });
241
                        };
242
                        ViewerDataModel.Instance.MarkupList_Pre.Add(markup);
243

  
244
                        var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, d.DisplayColor, "",
245
                                        d.MarkupInfoID, markup.ID);
246
                        control.Visibility = Visibility.Hidden;
232 247
                    }
233
                    //if (p.ID ==App.ViewInfo.UserID)
234
                    //{
235
                    //    d.userDelete = true;
236
                    //    d.DisplayColor = "#FFFF0000";
237
                    //}
238 248
                }));
239 249

  
240 250
                var currentUser = e.Result.Where(data => data.UserID == userData.ID).FirstOrDefault();
241
                //var currentUser = e.Result.Where(data => data.UserID == "H2014410").FirstOrDefault();
242 251
                if (currentUser == null)
243 252
                {
244 253
                    var infoId = Commons.shortGuid();
......
262 271
                    };
263 272

  
264 273
                    App.Custom_ViewInfoId = infoId;
265
                    //pureItem.Insert(0,PreviewUserMarkupInfoItem);
266 274
                }
267 275
                else
268 276
                {
269 277
                    App.Custom_ViewInfoId = currentUser.MarkupInfoID;
270 278
                }
271 279

  
272
                //pureItem.ForEach(d => d.MarkupList = null);
273
                //ViewerDataModel.Instance._markupInfoList = new ObservableCollection<MarkupInfoItem>(pureItem);
274 280
                ViewerDataModel.Instance._markupInfoList = SetDisplayColor(pureItem, _ViewInfo.UserID);
275
                //ViewerDataModel.Instance._markupInfoList = SetDisplayColor(e.Result, _ViewInfo.UserID);
276 281

  
277

  
278

  
279
                //if (e.Result.Where(data => data.UserID == userData.ID).FirstOrDefault() == null)
280
                //{
281

  
282
                //    PreviewUserMarkupInfoItem = new MarkupInfoItem
283
                //    {
284
                //        CreateTime = DateTime.Now,
285
                //        Depatment = userData.DEPARTMENT,
286
                //        DisplayColor = "#FFFF0000",
287
                //        UserID = userData.ID,
288
                //        UserName = userData.NAME + "(임시저장)",
289
                //        PageCount = 1,
290
                //        Description = "",
291
                //        MarkupInfoID = Commons.shortGuid(),
292
                //        MarkupList = null,
293
                //        MarkupVersionID = Commons.shortGuid(),
294
                //        Consolidate = 0,
295
                //        PartConsolidate = 0,
296
                //        userDelete = true,
297
                //        AvoidConsolidate = 0,
298
                //        IsPreviewUser = true
299
                //    };
300
                //    ViewerDataModel.Instance._markupInfoList.Add(PreviewUserMarkupInfoItem);
301
                //}
302

  
303

  
304

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

  
307 285
                markupItem.ForEach(data =>
308 286
                {
309
                    if (data.Depatment == null)
310
                    {
311
                        data.Depatment = "Unknown";
312
                        //BaseClient.NoticeAccountErrorAsync(_ViewInfo.ProjectNO, data.UserID);
313
                    }
287
                    if (data.Depatment == null) data.Depatment = "Unknown";
314 288
                });
315 289
                gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList;
316 290
                SetCommentPages();
......
388 362
                            MarkupInfoItem instanceItem = e.AddedItems.FirstOrDefault() as MarkupInfoItem;
389 363
                            var result = instanceItem.Consolidate;
390 364

  
391
                            //dataSet.Where(data => data.UserID == "H2011357").ToList().ForEach(data => lstbox.SelectedItems.Remove(data));
392 365
                            if (ea.DialogResult.Value)
393 366
                            {
394 367
                                ConsolidationMethod();
KCOM/Views/MainMenu.xaml.cs
515 515
                    gridViewMarkup.SelectedItem = PreviewUserMarkupInfoItem;
516 516
                }
517 517
            }
518

  
519 518
        }
520 519

  
521 520
        bool ComingNewBieEnd = false;
......
5228 5227
        }
5229 5228
        public void ConsolidationMethod()
5230 5229
        {
5231
            ChangeCommentReact();
5232

  
5233 5230
            if (this.gridViewMarkup.SelectedItems.Count == 0)
5234 5231
            {
5235 5232
                this.ParentOfType<MainWindow>().DialogMessage_Alert("Please select at least one user", "Alert");
5236 5233
            }
5237 5234
            else
5238 5235
            {
5236
                /*
5239 5237
                ViewerDataModel.Instance.IsConsolidate = true;
5240 5238
                this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null);
5241
                List<KCOMDataModel.DataModel.MARKUP_DATA> instanceDataSet = new List<KCOMDataModel.DataModel.MARKUP_DATA>();
5242 5239

  
5243 5240
                string project_no = App.ViewInfo.ProjectNO;
5244 5241
                string doc_id = _DocInfo.ID;
......
5250 5247
                }
5251 5248
                Logger.sendReqLog("Consolidate", project_no + "," + user_id + "," + doc_id + "," + markupInfoItems, 1);
5252 5249
                Logger.sendResLog("Consolidate", this.BaseClient.Consolidate(project_no, user_id, doc_id, markupInfoItems).ToString(), 1);
5253
                //this.BaseClient.Consolidate(project_no, user_id, doc_id, markupInfoItems);
5254 5250

  
5255 5251
                Logger.sendReqLog("GetMarkupInfoItemsAsync", App.ViewInfo.ProjectNO + "," + _DocInfo.ID, 1);
5256 5252
                this.BaseClient.GetMarkupInfoItemsAsync(App.ViewInfo.ProjectNO, _DocInfo.ID);
5253
                */
5254
                
5255
                List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>();
5256
                foreach (var item in this.gridViewMarkup.SelectedItems)
5257
                {
5258
                    MySelectItem.Add(item as IKCOM.MarkupInfoItem);
5259
                }
5260
                int iPageNo = Convert.ToInt32(this.ParentOfType<MainWindow>().dzTopMenu.tlcurrentPage.Text);
5257 5261

  
5262
                ConsolidateCommand.Instance.Execute(MySelectItem, iPageNo);
5258 5263
            }
5259 5264
        }
5260 5265

  

내보내기 Unified diff

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