프로젝트

일반

사용자정보

개정판 2decfbdf

ID2decfbdfc05f09bb5b2ef1618d265f315f6ba8f0
상위 1e901a8d
하위 dfc86b71

alzkakdixm 이(가) 약 5년 전에 추가함

DataBaseItemsModel 수정

Change-Id: I96830cad0b3990bb84346f438ba04e20d55ec26c

차이점 보기:

ConvertService/ServiceBase/IServiceBase/ConvertItem.cs
1 1
using System;
2
using System.Collections.Generic;
3 2
using System.ComponentModel;
4
using System.Linq;
5 3
using System.Runtime.Serialization;
6
using System.Text;
7
using System.Threading.Tasks;
8

  
4
using System.Linq.Expressions;
5
using Markus.Message;
9 6
namespace Markus.Service.Interface
10 7
{
11 8
    [DataContract]
12
    public class ConvertItem : IEquatable<ConvertItem> ,INotifyPropertyChanged
9
    public class ConvertItem :IEquatable<ConvertItem> ,INotifyPropertyChanged
13 10
    {
14 11
        public bool Equals(ConvertItem other)
15 12
        {
......
28 25
            return (id + project).GetHashCode();
29 26
        }
30 27

  
28
        public ConvertItem()
29
        {
30

  
31
        }
31 32

  
32 33
        public ConvertItem(string ProjectNo, string ID)
33 34
        {
......
74 75
            this._FileName = result;
75 76
        }
76 77

  
77
        public ConvertItem(string key, string ProjectNo, string ID, string originfilePath, string convertPath,string Status,int currentPageNo,int totalPage,string exception)
78
        public ConvertItem(string key, string ProjectNo, string ID, string originfilePath, string convertPath, StatusCodeType Status,int currentPageNo,int totalPage,string exception)
78 79
        {
79 80
            this._uniqueKey = key;
80 81
            this._projectNumber = ProjectNo;
81 82
            this._convertID = ID;
82 83
            this._originfilePath = originfilePath;
83 84
            this._convertPath = convertPath;
84
            this._convertState = Status;
85
            this._convertState = (StatusCodeType)Status;
85 86
            this._currentPageNo = currentPageNo;
86 87
            this._totalPage = totalPage;
87 88
            this._exception = exception;
......
98 99
            this._FileName = result;
99 100
        }
100 101

  
102
        //public ConvertItem(string key, string ProjectNo, string ID, string originfilePath, string convertPath, string Status, int currentPageNo, int totalPage, string exception
103
        //    ,string revision, string documentNo, string documentName, string groupName)
104
        //{//세미
105
        //    this._uniqueKey = key;
106
        //    this._projectNumber = ProjectNo;
107
        //    this._convertID = ID;
108
        //    this._originfilePath = originfilePath;
109
        //    this._convertPath = convertPath;
110
        //    this._convertState = Status;
111
        //    this._currentPageNo = currentPageNo;
112
        //    this._totalPage = totalPage;
113
        //    this._exception = exception;
114
        //    this._revision = revision;
115
        //    this._documentNo = documentNo;
116
        //    this._docuemnt_Name = documentName;
117
        //    this._GroupName = groupName;
118

  
119
        //    string result = "";
120
        //    if (originfilePath.Contains("/"))
121
        //    {
122
        //        result = originfilePath.Substring(originfilePath.LastIndexOf("/") + 1);
123
        //    }
124
        //    else
125
        //    {
126
        //        result = originfilePath.Substring(originfilePath.LastIndexOf("%") + 1);
127
        //    }
128
        //    this._FileName = result;
129
        //}
130

  
101 131

  
102 132
        string _uniqueKey;
103 133
        string _projectNumber;
......
107 137
        string _originfilePath;
108 138
        string _FileName;
109 139
        string _convertPath;
110
        string _convertState;
140
        //string _convertState;
141
        StatusCodeType _convertState;
111 142
        int _currentPageNo;
112 143
        int _totalPage;
113 144
        string _exception;
145
        string _revision;//↓ DOCUMENT_ITEM
146
        string _documentNo;
147
        string _docuemnt_Name;
148
        string _GroupName;
149
        string _documentID;
150
        string _validation;
151

  
114 152

  
115 153

  
116 154
        DateTime _createtime;
117 155

  
118 156
        public event PropertyChangedEventHandler PropertyChanged;
157

  
119 158
        private void OnPropertyChanged(string propertyName)
120 159
        {
121 160
            if (PropertyChanged != null)
......
124 163
            }
125 164
        }
126 165

  
127

  
128 166
        [DataMember]
129 167
        public string ConvertID
130 168
        {
......
154 192
                if (_serviceID != value)
155 193
                {
156 194
                    _serviceID = value;
157
                    this.OnPropertyChanged("ServiceID");
195
                    OnPropertyChanged("ServiceID");
158 196
                }
159 197
            }
160 198
        }
......
171 209
                if (_reConverter != value)
172 210
                {
173 211
                    _reConverter = value;
174
                    this.OnPropertyChanged("ReConverter");
212
                    OnPropertyChanged("ReConverter");
175 213
                }
176 214
            }
177 215
        }
......
188 226
                if (_originfilePath != value)
189 227
                {
190 228
                    _originfilePath = value;
191
                    this.OnPropertyChanged("OriginfilePath");
229
                    OnPropertyChanged("OriginfilePath");
192 230
                }
193 231
            }
194 232
        }
......
206 244
                if (_FileName != value)
207 245
                {
208 246
                    _FileName = value;
209
                    this.OnPropertyChanged("FileName");
247
                    OnPropertyChanged("FileName");
210 248
                }
211 249
            }
212 250
        }
......
224 262
                if (_convertPath != value)
225 263
                {
226 264
                    _convertPath = value;
227
                    this.OnPropertyChanged("ConvertPath");
265
                   OnPropertyChanged("ConvertPath");
228 266
                }
229 267
            }
230 268
        }
231 269

  
232 270
        [DataMember]
233
        public string ConvertState
271
        public StatusCodeType ConvertState
234 272
        {
235 273
            get
236 274
            {
......
241 279
                if (_convertState != value)
242 280
                {
243 281
                    _convertState = value;
244
                    this.OnPropertyChanged("ConvertState");
282
                    OnPropertyChanged("ConvertState");
245 283
                }
246 284
            }
247 285
        }
......
263 301
            }
264 302
        }
265 303

  
266
            [DataMember]
304
        [DataMember]
267 305
        public int TotalPage
268 306
        {
269 307
            get
......
275 313
                if (_totalPage != value)
276 314
                {
277 315
                    _totalPage = value;
278
                    this.OnPropertyChanged("TotalPage");
316
                    OnPropertyChanged("TotalPage");
279 317
                }
280 318
            }
281 319
        }
......
292 330
                if (_currentPageNo != value)
293 331
                {
294 332
                    _currentPageNo = value;
295
                    this.OnPropertyChanged("CurrentPageNo");
333
                    OnPropertyChanged("CurrentPageNo");
296 334
                }
297 335
            }
298 336
        }
......
309 347
                if (_createtime != value)
310 348
                {
311 349
                    _createtime = value;
312
                    this.OnPropertyChanged("CreateTime");
350
                    OnPropertyChanged("CreateTime");
313 351
                }
314 352
            }
315 353
        }
......
326 364
                if (_uniqueKey != value)
327 365
                {
328 366
                    _uniqueKey = value;
329
                    this.OnPropertyChanged("UniqueKey");
367
                    OnPropertyChanged("UniqueKey");
330 368
                }
331 369
            }
332 370
        }
......
344 382
                if (_exception != value)
345 383
                {
346 384
                    _exception = value;
347
                    this.OnPropertyChanged("Exception");
385
                   OnPropertyChanged("Exception");
386

  
348 387
                }
349 388
            }
350 389
        }
351 390

  
352 391
        [DataMember]
353 392
        public Int64 ProcessorAffinity { get; set; }
393

  
394
        [DataMember]
395
        public string Revision
396
        {
397
            get
398
            {
399
                return _revision;
400
            }
401
            set
402
            {
403
                if (_revision != value)
404
                {
405
                    _revision = value;
406
                    OnPropertyChanged("REVISION");
407

  
408
                }
409
            }
410
        }
411

  
412
        [DataMember]
413
        public string DocumnetNo
414
        {
415
            get
416
            {
417
                return _documentNo;
418
            }
419
            set
420
            {
421
                if (_documentNo != value)
422
                {
423
                    _documentNo = value;
424
                    OnPropertyChanged("DOCUMENT_NO");
425

  
426
                }
427
            }
428
        }
429

  
430
        [DataMember]
431
        public string DocumnetName
432
        {
433
            get
434
            {
435
                return _docuemnt_Name;
436
            }
437
            set
438
            {
439
                if (_docuemnt_Name != value)
440
                {
441
                    _docuemnt_Name = value;
442
                    OnPropertyChanged("DOCUMENT_NAME");
443

  
444
                }
445
            }
446
        }
447

  
448
        [DataMember]
449
        public string GroupNo
450
        {
451
            get
452
            {
453
                return _GroupName;
454
            }
455
            set
456
            {
457
                if (_GroupName != value)
458
                {
459
                    _GroupName = value;
460
                    OnPropertyChanged("GROUP_NO");
461

  
462
                }
463
            }
464
        }
465

  
466

  
467
        [DataMember]
468
        public string DocumentID
469
        {
470
            get
471
            {
472
                return _documentID;
473
            }
474
            set
475
            {
476
                if (_documentID != value)
477
                {
478
                    _documentID = value;
479
                    OnPropertyChanged("DocumentID");
480

  
481
                }
482
            }
483
        }
484

  
485

  
486
        [DataMember]
487
        public string Validation
488
        {
489
            get
490
            {
491
                return _validation;
492
            }
493
            set
494
            {
495
                if (_validation != value)
496
                {
497
                    _validation = value;
498
                    OnPropertyChanged("Validation");
499

  
500
                }
501
            }
502
        }
354 503
    }
355 504
}
ConvertService/ServiceBase/Markus.Service.DataBase/ConvertDatabase.cs
5 5
using System.Collections.Generic;
6 6
using System.IO;
7 7
using System.Linq;
8
using static Markus.Service.DataBase.ConvertDatabase;
9
using System.Windows;
10
using System.Linq.Expressions;
11
using Markus.Service.Interface;
8 12

  
9 13
namespace Markus.Service.DataBase
10 14
{
......
104 108
                RECONVERTER = 0
105 109
            };
106 110

  
111
            
107 112
            entities.CONVERTER_DOC.Add(convert_doc);
108 113

  
109 114
            if (entities.SaveChanges() == 1)
......
114 119
            return result;
115 120
        }
116 121

  
122
        //public bool SetDocument_Item(string Revision, string Document_No, string Document_Name, string Group_No)//세미
123
        //{
124
        //    bool result = false;
125

  
126
        //    if (Revision.IsNullOrEmpty())
127
        //    {
128
        //        throw new Exception("Revision is Null");
129
        //    }
130

  
131
        //    if (Document_No.IsNullOrEmpty())
132
        //    {
133
        //        throw new Exception("Document_No is Null");
134
        //    }
135

  
136
        //    if (Document_Name.IsNullOrEmpty())
137
        //    {
138
        //        throw new Exception("Document_Name is Null");
139
        //    }
140

  
141
        //    DOCUMENT_ITEM document_item = new DOCUMENT_ITEM
142
        //    {
143
        //        REVISION = Revision,
144
        //        DOCUMENT_NO = Document_No,
145
        //        DOCUMENT_NAME = Document_Name,
146
        //        GROUP_NO = Group_No
147
        //    };
148

  
149
        //    entities.DOCUMENT_ITEM.Add(document_item);
150

  
151
        //    if (entities.SaveChanges() == 1)
152
        //    {
153
        //        result = true;
154
        //    }
155

  
156
        //    return result;
157
        //}
117 158
        /// <summary>
118 159
        /// 컨버터서비스를 이용하는 문서 정보 저장
119 160
        /// UniqueID
......
214 255
                if (convertItem.STATUS == (int)StatusCodeType.Completed)
215 256
                {
216 257
                    result = new Interface.ConvertItem(convertItem.DOCUMENT_ID, convertItem.PROJECT_NO, convertItem.ID, convertItem.DOCUMENT_URL, convertPath,
217
                                                        convertItem.STATUS.ToString(), convertItem.CURRENT_PAGE, convertItem.TOTAL_PAGE, convertItem.EXCEPTION);
258
                                                        (StatusCodeType)convertItem.STATUS, convertItem.CURRENT_PAGE, convertItem.TOTAL_PAGE, convertItem.EXCEPTION);
218 259
                }
219 260
                else
220 261
                {
......
277 318
        /// <param name="convertID">StatusCodeType을 변경하고자 하는 ConvertItem의 ID</param>
278 319
        /// <param name="ReConvert">ReConvert가 2이면 다시 Convert를 시도 안하기 때문에 기존 값으로 유지 하고 계속 시도 할수 있도록 0을 주는 경우가 있다.</param>
279 320
        /// <returns></returns>
280
        public int SetCleanUpItem(string convertID,int ReConvert)
321
        /// 
322
        public int SetCleanUpItem(ConvertItem _ConvertItem)
281 323
        {
282 324
            int result = 0;
283 325

  
284
            var items = entities.CONVERTER_DOC.Where(x=> x.ID == convertID);
326
            //var items = entities.CONVERTER_DOC.Where(x => x.ID == _ConvertItem.ConvertID && x.DOCUMENT_ID == _ConvertItem.DocumentID);
327
            var items = entities.CONVERTER_DOC.Where(x => x.ID == _ConvertItem.ConvertID);
285 328

  
286 329
            result = items.Count();
287 330

  
......
289 332
            {
290 333
                var item = items.First();
291 334

  
292
                item.RECONVERTER = item.RECONVERTER - ReConvert;
293
                item.CREATE_DATETIME = DateTime.Now;
335
                item.RECONVERTER = item.RECONVERTER - _ConvertItem.ReConverter;
336
                item.CREATE_DATETIME = DateTime.Now;//여기서도 변경 되고 디비에서도 변경됨
294 337
                //item.START_DATETIME = null;
295
                item.END_DATETIME = null;
296
                item.STATUS = (int)StatusCodeType.None;
338
                //item.END_DATETIME = null;
339
                item.STATUS = (int)StatusCodeType.None; //여기서는 값 변경 되는데 디비에서 변경 안됨 => 0 되었다가 파일수에 따라 점차 늘어나는것 
340

  
297 341

  
298 342
                result = entities.SaveChanges();
299 343
            }
300 344

  
301 345
            return result;
302 346
        }
347
        //public int SetCleanUpItem(string convertID,int ReConvert)
348
        //{
349
        //    int result = 0;
350

  
351
        //    var items = entities.CONVERTER_DOC.Where(x=> x.ID == convertID);
352

  
353
        //    result = items.Count();
354

  
355
        //    if (items.Count() > 0)
356
        //    {
357
        //        var item = items.First();
358

  
359
        //        item.RECONVERTER = item.RECONVERTER - ReConvert;
360
        //        item.CREATE_DATETIME = DateTime.Now;//여기서도 변경 되고 디비에서도 변경됨
361
        //        //item.START_DATETIME = null;
362
        //        //item.END_DATETIME = null;
363
        //        item.STATUS = (int)StatusCodeType.None; //여기서는 값 변경 되는데 디비에서 변경 안됨 => 0 되었다가 파일수에 따라 점차 늘어나는것 
364

  
365

  
366
        //        result = entities.SaveChanges();
367
        //    }
368

  
369
        //    return result;
370
        //}
303 371

  
304 372

  
305 373
        /// <summary>
......
341 409
                    {
342 410
                        ReConverter = item.RECONVERTER,
343 411
                        ServiceID = item.SERVICE_ID,
344
                        ConvertState = ((StatusCodeType)item.STATUS).ToString(),
412
                        ConvertState = ((StatusCodeType)item.STATUS),
345 413
                        CreateTime = item.CREATE_DATETIME,
346 414
                        TotalPage = item.TOTAL_PAGE,
347 415
                        CurrentPageNo = item.CURRENT_PAGE,
......
375 443
                    {
376 444
                        ReConverter = item.RECONVERTER,
377 445
                        ServiceID = item.SERVICE_ID,
378
                        ConvertState = ((StatusCodeType)item.STATUS).ToString(),
446
                        //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
447
                        ConvertState = ((StatusCodeType)item.STATUS),
379 448
                        CreateTime = item.CREATE_DATETIME,
380 449
                        TotalPage = item.TOTAL_PAGE,
381 450
                        CurrentPageNo = item.CURRENT_PAGE,
......
390 459
            return convertItems;
391 460
        }
392 461

  
393
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(Func<CONVERTER_DOC, bool> @where)
394
        {
395
            var items = entities.CONVERTER_DOC.Where(@where);
462
        //List<Interface.ConvertItem> StatusKeep = new List<Interface.ConvertItem>();
396 463

  
397
            if (items.Count() > 0)
464
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(Markus.Service.Interface.ConvertItem selectedConvert)
465
        {
466
            List<Interface.ConvertItem> StatusKeep = new List<Interface.ConvertItem>();
467
            System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();///////////////디비 테스트 후 해보기 
468
            stopwatch.Start();
469
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();//디비 다 조인 후 조건 비교 후 그리드 출력
470
            var query = from items in entities.CONVERTER_DOC //세미
471
                        join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID into GroupItems
472
                        from subpet in GroupItems.DefaultIfEmpty()
473
                        where items.PROJECT_NO == selectedConvert.ProjectNumber && items.DOCUMENT_ID == selectedConvert.DocumentID
474
                        orderby items.CREATE_DATETIME descending 
475
                        select new
476
                        {
477
                            ID = items.ID,
478
                            DOCUMENT_URL = items.DOCUMENT_URL,
479
                            RECONVERTER = items.RECONVERTER,
480
                            SERVICE_ID = items.SERVICE_ID,
481
                            STATUS = items.STATUS,
482
                            CREATE_DATETIME = items.CREATE_DATETIME,
483
                            TOTAL_PAGE = items.TOTAL_PAGE,
484
                            CURRENT_PAGE = items.CURRENT_PAGE,
485
                            EXCEPTION = items.EXCEPTION,
486
                            PROJECT_NO = items.PROJECT_NO,
487
                            DOCUMENT_ID = items.DOCUMENT_ID,
488
                            REVISION = subpet.REVISION,
489
                            DOCUMENT_NO = subpet.DOCUMENT_NO,
490
                            DOCUMENT_NAME = subpet.DOCUMENT_NAME,
491
                            GROUP_NO = subpet.GROUP_NO
492
                        };
493

  
494
            if (query.Count() > 0)//세미
398 495
            {
399
                foreach (var item in items)
496
                foreach (var item in query)
400 497
                {
401

  
402
                    yield return new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
498
                    //var convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
499
                    Interface.ConvertItem convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
403 500
                    {
501

  
404 502
                        ReConverter = item.RECONVERTER,
405 503
                        ServiceID = item.SERVICE_ID,
406 504
                        //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
407
                        ConvertState = (item.STATUS).ToString(),
505
                        //ConvertState = (item.STATUS).ToString(),
506
                        ConvertState = (StatusCodeType)item.STATUS,
408 507
                        CreateTime = item.CREATE_DATETIME,
409 508
                        TotalPage = item.TOTAL_PAGE,
410 509
                        CurrentPageNo = item.CURRENT_PAGE,
411 510
                        Exception = item.EXCEPTION,
412
                        ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID)
511
                        ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
512

  
513
                        Revision = item.REVISION,
514
                        DocumnetNo = item.DOCUMENT_NO,
515
                        DocumnetName = item.DOCUMENT_NAME,
516
                        GroupNo = item.GROUP_NO
413 517
                    };
518
                    //if (@whereq(convertitem))
519
                    //{
520
                        ////convertItems.Add(convertitem);
521
                        StatusKeep.Add(convertitem);
522
                   // }
414 523

  
415 524
                }
416 525
            }
417
        }
526
            System.Diagnostics.Debug.WriteLine(new TimeSpan(stopwatch.ElapsedTicks).ToString());
527
            //return convertItems;//디비 다 조인 후 조건 비교 후 그리드 출력
528
            return StatusKeep;
529

  
418 530

  
419
        public List<Interface.ConvertItem> GetConvertProjects(Func<CONVERTER_DOC, bool> @where, StatusCodeType status)
531
        }
532
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(System.Collections.ObjectModel.ObservableCollection<Interface.ConvertItem> selectedConvert)
420 533
        {
421
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
534
            List<Interface.ConvertItem> StatusKeep = new List<Interface.ConvertItem>();
535
            //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();///////////////디비 테스트 후 해보기 
536
            //stopwatch.Start();
537
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();//디비 다 조인 후 조건 비교 후 그리드 출력
422 538

  
539
            foreach (var selectedConvertItem in selectedConvert)
540
            {
541
                var query = from items in entities.CONVERTER_DOC //세미
542
                            join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID into GroupItems
543
                            from subpet in GroupItems.DefaultIfEmpty()
544
                            where items.PROJECT_NO == selectedConvertItem.ProjectNumber && items.ID == selectedConvertItem.ConvertID 
545
                            select new
546
                            {
547
                                ID = items.ID,
548
                                DOCUMENT_URL = items.DOCUMENT_URL,
549
                                RECONVERTER = items.RECONVERTER,
550
                                SERVICE_ID = items.SERVICE_ID,
551
                                STATUS = items.STATUS,
552
                                CREATE_DATETIME = items.CREATE_DATETIME,
553
                                TOTAL_PAGE = items.TOTAL_PAGE,
554
                                CURRENT_PAGE = items.CURRENT_PAGE,
555
                                EXCEPTION = items.EXCEPTION,
556
                                PROJECT_NO = items.PROJECT_NO,
557
                                DOCUMENT_ID = items.DOCUMENT_ID,
558
                                REVISION = subpet.REVISION,
559
                                DOCUMENT_NO = subpet.DOCUMENT_NO,
560
                                DOCUMENT_NAME = subpet.DOCUMENT_NAME,
561
                                GROUP_NO = subpet.GROUP_NO
562
                            };
563

  
564

  
565
                if (query.Count() > 0)//세미
566
                {
567
                    foreach (var item in query)
568
                    {
569
                        //var convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
570
                        Interface.ConvertItem convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
571
                        {
423 572

  
424
            //var items = entities.CONVERTER_DOC.Where(x => x.STATUS == (int)statusCodeType).Take(takeCount).ToList(); //.Where(x => x.PROJECT_NO == gProjectNo);
425
            var items = entities.CONVERTER_DOC.Where(x => x.STATUS == (int)status).ToList();
573
                            ReConverter = item.RECONVERTER,
574
                            ServiceID = item.SERVICE_ID,
575
                            //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
576
                            //ConvertState = (item.STATUS).ToString(),
577
                            ConvertState = (StatusCodeType)item.STATUS,
578
                            CreateTime = item.CREATE_DATETIME,
579
                            TotalPage = item.TOTAL_PAGE,
580
                            CurrentPageNo = item.CURRENT_PAGE,
581
                            Exception = item.EXCEPTION,
582
                            ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
583

  
584
                            Revision = item.REVISION,
585
                            DocumnetNo = item.DOCUMENT_NO,
586
                            DocumnetName = item.DOCUMENT_NAME,
587
                            GroupNo = item.GROUP_NO
588
                        };
589
                        //if (@whereq(convertitem))
590
                        //{
591
                        ////convertItems.Add(convertitem);
592
                        StatusKeep.Add(convertitem);
593
                        // }
426 594

  
427
            if (items.Count() > 0)
595
                    }
596
                }
597
            }
598
                //System.Diagnostics.Debug.WriteLine(new TimeSpan(stopwatch.ElapsedTicks).ToString());
599
                //return convertItems;//디비 다 조인 후 조건 비교 후 그리드 출력
600
                return StatusKeep;
601

  
602
            
603

  
604
        }
605
        //public IEnumerable<Interface.ConvertItem> GetConvertProjects(Func<Interface.ConvertItem, bool> @whereq, int status)//조인 후 조건 & 조건and조인
606
        ////public List<Interface.ConvertItem> GetConvertProjects(Expression<Func<CONVERTER_DOC, bool>> @where) //linq and entity and sql
607
        ////public IEnumerable<Interface.ConvertItem> GetConvertProjects(Func<CONVERTER_DOC, bool> @where) //원본
608
        //{
609
        //    System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();///////////////디비 테스트 후 해보기 
610
        //    stopwatch.Start();
611
        //    List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();//디비 다 조인 후 조건 비교 후 그리드 출력
612
        //    var query = from items in entities.CONVERTER_DOC //세미
613
        //                join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID
614
        //                where items.PROJECT_NO == documents.PROJECT_NO && items.STATUS == status
615
        //                orderby items.CREATE_DATETIME descending
616
        //                select new
617
        //                {
618
        //                    ID = items.ID,
619
        //                    DOCUMENT_URL = items.DOCUMENT_URL,
620
        //                    RECONVERTER = items.RECONVERTER,
621
        //                    SERVICE_ID = items.SERVICE_ID,
622
        //                    STATUS = items.STATUS,
623
        //                    CREATE_DATETIME = items.CREATE_DATETIME,
624
        //                    TOTAL_PAGE = items.TOTAL_PAGE,
625
        //                    CURRENT_PAGE = items.CURRENT_PAGE,
626
        //                    EXCEPTION = items.EXCEPTION,
627
        //                    PROJECT_NO = items.PROJECT_NO,
628
        //                    DOCUMENT_ID = items.DOCUMENT_ID,
629
        //                    REVISION = documents.REVISION,
630
        //                    DOCUMENT_NO = documents.DOCUMENT_NO,
631
        //                    DOCUMENT_NAME = documents.DOCUMENT_NAME,
632
        //                    GROUP_NO = documents.GROUP_NO
633
        //                };
634

  
635
        //    if (query.Count() > 0)//세미
636
        //    {
637
        //        foreach (var item in query)
638
        //        {
639
        //            //var convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
640
        //            Interface.ConvertItem convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
641
        //            {
642

  
643
        //                ReConverter = item.RECONVERTER,
644
        //                ServiceID = item.SERVICE_ID,
645
        //                //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
646
        //                ConvertState = (item.STATUS).ToString(),
647
        //                CreateTime = item.CREATE_DATETIME,
648
        //                TotalPage = item.TOTAL_PAGE,
649
        //                CurrentPageNo = item.CURRENT_PAGE,
650
        //                Exception = item.EXCEPTION,
651
        //                //ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
652

  
653
        //                Revision = item.REVISION,
654
        //                DocumnetNo = item.DOCUMENT_NO,
655
        //                DocumnetName = item.DOCUMENT_NAME,
656
        //                GroupNo = item.GROUP_NO
657
        //            };
658
        //            if (@whereq(convertitem))
659
        //            {
660
        //                //convertItems.Add(convertitem);
661
        //                StatusKeep.Add(convertitem);
662
        //            }
663

  
664
        //        }
665
        //    }
666
        //    System.Diagnostics.Debug.WriteLine(new TimeSpan(stopwatch.ElapsedTicks).ToString());
667
        //    //return convertItems;//디비 다 조인 후 조건 비교 후 그리드 출력
668
        //    return StatusKeep;
669

  
670

  
671
        //}
672

  
673
        //public IEnumerable<Interface.ConvertItem> GetConvertProjects(Func<CONVERTER_DOC, bool> @where) //@where는 입력값이 CONVERTER_DOC이고 출력값이 bool //부장님
674
        //public List<Interface.ConvertItem> GetConvertProjects(Func<CONVERTER_DOC, bool> @where) //@where는 입력값이 CONVERTER_DOC이고 출력값이 bool
675
        //System.Linq.IQueryable
676
        public IEnumerable<Interface.ConvertItem> GetConvertProjects(int status)//조인 후 조건 & 조건and조인
677
        //public List<Interface.ConvertItem> GetConvertProjects(Expression<Func<CONVERTER_DOC, bool>> @where) //linq and entity and sql
678
        //public IEnumerable<Interface.ConvertItem> GetConvertProjects(Func<CONVERTER_DOC, bool> @where) //원본
679
        {
680
            // System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();///////////////디비 테스트 후 해보기 
681
            // stopwatch.Start();
682

  
683
            // //@ 심벌 ex) string filename = "C:\\Temp\\1.txt"; -> filename = @"C:\Temp\1.txt"; and 여러 문자열 사용 가능
684
            ////var items = entities.CONVERTER_DOC.Where(@where);//부장님
685
            // List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
686

  
687
            // var query = from items in entities.CONVERTER_DOC //세미
688
            //              join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID
689
            //              //where @where(items)
690
            //             select new//new 다음에 클래스 이름 넣으면 안됨 
691
            //             {
692
            //                 ID = items.ID,
693
            //                 DOCUMENT_URL = items.DOCUMENT_URL,
694
            //                 RECONVERTER = items.RECONVERTER,
695
            //                 SERVICE_ID = items.SERVICE_ID,
696
            //                 STATUS = items.STATUS,
697
            //                 CREATE_DATETIME = items.CREATE_DATETIME,
698
            //                 TOTAL_PAGE = items.TOTAL_PAGE,
699
            //                 CURRENT_PAGE = items.CURRENT_PAGE,
700
            //                 EXCEPTION = items.EXCEPTION,
701
            //                 PROJECT_NO = items.PROJECT_NO,
702
            //                 DOCUMENT_ID = items.DOCUMENT_ID,
703
            //                 REVISION = documents.REVISION,
704
            //                 DOCUMENT_NO = documents.DOCUMENT_NO,
705
            //                 DOCUMENT_NAME = documents.DOCUMENT_NAME,
706
            //                 GROUP_NO = documents.GROUP_NO
707
            //             };
708

  
709

  
710
            // if (query.Count() > 0)//ConvertItem에 값들 넣어야 함 그래야 값이 바뀌면 propertychanged로 그리드 실시간 없데이트 가능
711
            // {
712
            //     foreach (var item in query)
713
            //     {
714
            //         var convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
715
            //         {
716
            //             ReConverter = item.RECONVERTER,
717
            //             ServiceID = item.SERVICE_ID,
718
            //             //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
719
            //             ConvertState = (item.STATUS).ToString(),
720
            //             CreateTime = item.CREATE_DATETIME,
721
            //             TotalPage = item.TOTAL_PAGE,
722
            //             CurrentPageNo = item.CURRENT_PAGE,
723
            //             Exception = item.EXCEPTION,
724
            //             ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
725

  
726
            //             Revision = item.REVISION,
727
            //             DocumnetNo = item.DOCUMENT_NO,
728
            //             DocumnetName = item.DOCUMENT_NAME,
729
            //             GroupNo = item.GROUP_NO
730
            //         };
731

  
732

  
733
            //         convertItems.Add(convertitem);
734
            //     }
735
            // }
736
            //System.Diagnostics.Debug.WriteLine(new TimeSpan(stopwatch.ElapsedTicks).ToString());
737
            //return convertItems;///////////////디비 테스트 후 해보기 
738

  
739
            //select new Interface.ConvertItem(ConvertDoc.DOCUMENT_ID, ConvertDoc.PROJECT_NO, ConvertDoc.ID, ConvertDoc.DOCUMENT_URL)
740
            //{
741
            //    ReConverter = ConvertDoc.RECONVERTER,
742
            //    ServiceID = ConvertDoc.SERVICE_ID,
743
            //    //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
744
            //    ConvertState = (ConvertDoc.STATUS).ToString(),
745
            //    CreateTime = ConvertDoc.CREATE_DATETIME,
746
            //    TotalPage = ConvertDoc.TOTAL_PAGE,
747
            //    CurrentPageNo = ConvertDoc.CURRENT_PAGE,
748
            //    Exception = ConvertDoc.EXCEPTION,
749
            //    ConvertPath = GetConvertPath(ConvertDoc.PROJECT_NO, ConvertDoc.DOCUMENT_ID),
750

  
751
            //    Revision = documents.REVISION,
752
            //    DocumnetNo = documents.DOCUMENT_NO,
753
            //    DocumnetName = documents.DOCUMENT_NAME,
754
            //    GroupNo = documents.GROUP_NO
755
            //};
756
            //System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();///////////////디비 테스트 후 해보기 
757
            //stopwatch.Start();
758
            List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();//디비 다 조인 후 조건 비교 후 그리드 출력
759
            var query = from items in entities.CONVERTER_DOC //세미
760
                        join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID into GroupItems
761
                        from subpet in GroupItems.DefaultIfEmpty()
762
                        where items.STATUS == status
763
                        orderby items.CREATE_DATETIME descending
764
                        select new
765
                        {
766
                            ID = items.ID,
767
                            DOCUMENT_URL = items.DOCUMENT_URL,
768
                            RECONVERTER = items.RECONVERTER,
769
                            SERVICE_ID = items.SERVICE_ID,
770
                            STATUS = items.STATUS,
771
                            CREATE_DATETIME = items.CREATE_DATETIME,
772
                            TOTAL_PAGE = items.TOTAL_PAGE,
773
                            CURRENT_PAGE = items.CURRENT_PAGE,
774
                            EXCEPTION = items.EXCEPTION,
775
                            PROJECT_NO = items.PROJECT_NO,
776
                            DOCUMENT_ID = items.DOCUMENT_ID,
777
                            REVISION = subpet.REVISION,
778
                            DOCUMENT_NO = subpet.DOCUMENT_NO,
779
                            DOCUMENT_NAME = subpet.DOCUMENT_NAME,
780
                            GROUP_NO = subpet.GROUP_NO
781
                            //REVISION = documents.REVISION,
782
                            //DOCUMENT_NO = documents.DOCUMENT_NO,
783
                            //DOCUMENT_NAME = documents.DOCUMENT_NAME,
784
                            //GROUP_NO = documents.GROUP_NO
785
                        };
786

  
787
            if (query.Count() > 0)//세미
428 788
            {
429
                foreach (var item in items)
789
                foreach (var item in query)
430 790
                {
431

  
432
                    var convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
791
                    //var convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
792
                    Interface.ConvertItem convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
433 793
                    {
794

  
434 795
                        ReConverter = item.RECONVERTER,
435 796
                        ServiceID = item.SERVICE_ID,
436 797
                        //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
437
                        ConvertState = (item.STATUS).ToString(),
798
                        //ConvertState = (item.STATUS).ToString(),
799
                        ConvertState = (StatusCodeType)item.STATUS,
438 800
                        CreateTime = item.CREATE_DATETIME,
439 801
                        TotalPage = item.TOTAL_PAGE,
440 802
                        CurrentPageNo = item.CURRENT_PAGE,
441 803
                        Exception = item.EXCEPTION,
442
                        ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID)
443
                    };
444

  
804
                        //ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
445 805

  
806
                        Revision = item.REVISION,
807
                        DocumnetNo = item.DOCUMENT_NO,
808
                        DocumnetName = item.DOCUMENT_NAME,
809
                        GroupNo = item.GROUP_NO,
810
                        DocumentID = item.DOCUMENT_ID
811
                    };
812
                        convertItems.Add(convertitem);
446 813
                }
447 814
            }
815
            //System.Diagnostics.Debug.WriteLine(new TimeSpan(stopwatch.ElapsedTicks).ToString());
816
            return convertItems;//디비 다 조인 후 조건 비교 후 그리드 출력
817

  
818
                                //if (Wheredel(convertitem) == false)
819
                    //if (@where(convertitem) == false)
820
                    //{
821
                    //    break;
822
                    //}
823
                    //if (@where(convertitem))
824
                    //{
825
                    //    convertItems.Add(convertitem);
826
                    //}
827

  
828
                    //yield return new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
829
                    //{
830
                    //    ReConverter = item.RECONVERTER,
831
                    //    ServiceID = item.SERVICE_ID,
832
                    //    //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
833
                    //    ConvertState = (item.STATUS).ToString(),
834
                    //    CreateTime = item.CREATE_DATETIME,
835
                    //    TotalPage = item.TOTAL_PAGE,
836
                    //    CurrentPageNo = item.CURRENT_PAGE,
837
                    //    Exception = item.EXCEPTION,
838
                    //    ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
839

  
840
                    //    Revision = item.REVISION,
841
                    //    DocumnetNo = item.DOCUMENT_NO,
842
                    //    DocumnetName = item.DOCUMENT_NAME,
843
                    //    GroupNo = item.GROUP_NO
844
                    //};
845

  
846

  
847
            //var query = entities.CONVERTER_DOC.Where(@where);//이렇게 해서 두 테이블 조인하는  프로시저 만들어라
848

  
849
            //if (query.Count() > 0)
850
            //{
851
            //    foreach (var item in query)
852
            //    {
853
            //        //var docitem = entities.DOCUMENT_ITEM.Where(x => x.DOCUMENT_ID == item.DOCUMENT_ID);
854
            //        if (@where(item))
855
            //        {
856
            //            //string rev = "";
857
            //            //string docNo = "";
858
            //            //string docName = "";
859
            //            //string grpNo = "";
860

  
861
            //            //if (item.Count() > 0)
862
            //            //{
863
            //            //    rev = docitem.First().REVISION;
864
            //            //    docNo = docitem.First().DOCUMENT_NO;
865
            //            //    docName = docitem.First().DOCUMENT_NAME;
866
            //            //    grpNo = docitem.First().GROUP_NO;
867
            //            //}
868

  
869
            //            yield return new Interface.ConvertItem(item.DOCUMENT_ID, item.projectNo, item.ID, item.DOCUMENT_URL)
870
            //            {
871
            //                ReConverter = item.RECONVERTER,
872
            //                ServiceID = item.SERVICE_ID,
873
            //                //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
874
            //                CreateTime = item.CREATE_DATETIME,
875
            //                TotalPage = item.TOTAL_PAGE,
876
            //                CurrentPageNo = item.CURRENT_PAGE,
877
            //                Exception = item.EXCEPTION,
878
            //                ConvertPath = GetConvertPath(item.projectNo, item.DOCUMENT_ID),
879

  
880
            //                Revision = item.REVISION,
881
            //                DocumnetNo = item.DOCUMENT_NO,
882
            //                DocumnetName = item.DOCUMENT_NAME,
883
            //                GroupNo = item.GROUP_NO
884
            //            };
885
            //        }
886
            //    }
887
            //}//프로시저
888

  
889
            //var items = entities.CONVERTER_DOC.Where(@where);//부장님원본
890
            //if (items.Count() > 0)//원본
891
            //{
892
            //    foreach (var item in items)
893
            //    {
894
            //        yield return new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
895
            //        {
896
            //            ReConverter = item.RECONVERTER,
897
            //            ServiceID = item.SERVICE_ID,
898
            //            //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
899
            //            ConvertState = (item.STATUS).ToString(),
900
            //            CreateTime = item.CREATE_DATETIME,
901
            //            TotalPage = item.TOTAL_PAGE,
902
            //            CurrentPageNo = item.CURRENT_PAGE,
903
            //            Exception = item.EXCEPTION,
904
            //            ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID)
905
            //        };
906
            //    }
907
            //}//원본
908

  
909
            //LINQKit 하다 말음
910
            //List<Interface.ConvertItem> convertItems = new List<Interface.ConvertItem>();
911
            //var query = 
912
            //    from items in entities.CONVERTER_DOC //세미
913
            //    join documents in entities.DOCUMENT_ITEM on items.DOCUMENT_ID equals documents.DOCUMENT_ID
914
            //    select new//new 다음에 클래스 이름 넣으면 안됨 
915
            //            {
916
            //                ID = items.ID,
917
            //                DOCUMENT_URL = items.DOCUMENT_URL,
918
            //                RECONVERTER = items.RECONVERTER,
919
            //                SERVICE_ID = items.SERVICE_ID,
920
            //                STATUS = items.STATUS,
921
            //                CREATE_DATETIME = items.CREATE_DATETIME,
922
            //                TOTAL_PAGE = items.TOTAL_PAGE,
923
            //                CURRENT_PAGE = items.CURRENT_PAGE,
924
            //                EXCEPTION = items.EXCEPTION,
925
            //                PROJECT_NO = items.PROJECT_NO,
926
            //                DOCUMENT_ID = items.DOCUMENT_ID,
927
            //                REVISION = documents.REVISION,
928
            //                DOCUMENT_NO = documents.DOCUMENT_NO,
929
            //                DOCUMENT_NAME = documents.DOCUMENT_NAME,
930
            //                GROUP_NO = documents.GROUP_NO
931
            //            };
932

  
933
            //if (query.Count() > 0)//ConvertItem에 값들 넣어야 함 그래야 값이 바뀌면 propertychanged로 그리드 실시간 없데이트 가능
934
            //{
935
            //    foreach (var item in query)
936
            //    {
937
            //        var convertitem = new Interface.ConvertItem(item.DOCUMENT_ID, item.PROJECT_NO, item.ID, item.DOCUMENT_URL)
938
            //        {
939
            //            ReConverter = item.RECONVERTER,
940
            //            ServiceID = item.SERVICE_ID,
941
            //            //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
942
            //            ConvertState = (item.STATUS).ToString(),
943
            //            CreateTime = item.CREATE_DATETIME,
944
            //            TotalPage = item.TOTAL_PAGE,
945
            //            CurrentPageNo = item.CURRENT_PAGE,
946
            //            Exception = item.EXCEPTION,
947
            //            ConvertPath = GetConvertPath(item.PROJECT_NO, item.DOCUMENT_ID),
948

  
949
            //            Revision = item.REVISION,
950
            //            DocumnetNo = item.DOCUMENT_NO,
951
            //            DocumnetName = item.DOCUMENT_NAME,
952
            //            GroupNo = item.GROUP_NO
953
            //        };
954

  
955

  
956
            //        convertItems.Add(convertitem);
957

  
958
            //    }
959
            //}
960
            //return convertItems;
961
            //LINQKit
448 962

  
449
            return convertItems;
450 963
        }
451 964

  
452 965
        public List<Interface.ConvertItem> GetConvertProjectsStatus(Func<CONVERTER_DOC, bool> @where)
......
466 979
                        ReConverter = item.RECONVERTER,
467 980
                        ServiceID = item.SERVICE_ID,
468 981
                        //ConvertState = ((StatusCodeType)item.STATUS).ToString(),
469
                        ConvertState = (item.STATUS).ToString(),
982
                        //ConvertState = (item.STATUS).ToString(),
983
                        ConvertState = (StatusCodeType)item.STATUS,
470 984
                        CreateTime = item.CREATE_DATETIME,
471 985
                        TotalPage = item.TOTAL_PAGE,
472 986
                        CurrentPageNo = item.CURRENT_PAGE,
ConvertService/ServiceBase/Markus.Service.DataBase/Markus.Service.DataBase.csproj
71 71
      <HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
72 72
    </Reference>
73 73
    <Reference Include="Markus.EntityModel, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
74
      <HintPath>..\packages\MarkusDatabase.1.7.2\lib\net45\Markus.EntityModel.dll</HintPath>
74
      <HintPath>..\packages\MarkusDatabase.1.8.0\lib\net45\Markus.EntityModel.dll</HintPath>
75 75
    </Reference>
76 76
    <Reference Include="Markus.Message, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL">
77 77
      <HintPath>..\packages\Markus.Message.1.5.4\lib\net45\Markus.Message.dll</HintPath>
ConvertService/ServiceBase/Markus.Service.DataBase/packages.config
3 3
  <package id="EntityFramework" version="6.2.0" targetFramework="net45" />
4 4
  <package id="EntityFramework.ko" version="6.2.0" targetFramework="net45" />
5 5
  <package id="Markus.Message" version="1.5.4" targetFramework="net45" />
6
  <package id="MarkusDatabase" version="1.7.2" targetFramework="net45" />
6
  <package id="MarkusDatabase" version="1.8.0" targetFramework="net45" developmentDependency="true" />
7 7
</packages>
ConvertService/ServiceBase/Markus.Service.Extensions/Exntensions/CollectionExtenstions.cs
168 168
            foreach (var item in enumerable)
169 169
            {
170 170
                if (where(item))//UpdateWhere에서 맨마지막 조건
171
                {
172
                    update(item);
173
                }
171
                {//그리드 collection 돌면서 where절 조건 만족하면 update
172
                    update(item);//그리드 status와 디비 status 같으면  업데이트
173
                }//업데이트 함수 
174 174
            }
175 175
            return enumerable;
176 176
        }
ConvertService/ServiceBase/Markus.Service.Station/ServiceStation.ini
15 15
#MarkusDataBaseConnectionString = AkxeK6rlR/pvDogtyJST7sHEFe9zDPwVf8W7ulsvVrFnqBcpEKFhacEE4OpBvuJYrkkubP91v40LyQ6mReCd3pXhTAPs5gL4W6eRhG6GszFyxlv0fncEZ+aacRQNNIzTlQCenZdTJdt2ylaRyCRYXb9HZCIeZKcuDef2pn1ny3dp90lB2vv15bn5UIaqIZA8bLSbBTXt8Ft4Xttl4In5Ow==
16 16

  
17 17
# remote test MARKUS_V3
18
MarkusDataBaseConnectionString = ScTg8MgTdbARVQXhb1K9YI3/6emjnMuODvTWZ+UnUZQ8z/Gv4TksSLRn84HTZiC5pT5Vi9KdIFiJ/icpeXrUfa2LTnWdibJ7Oz+4QcYCftqVNPaS3nbiAo67l93XLRVqCpyt4tTSgwhRhdJob48gZhx+zmvoKmAwBR/ofCam3SNjx85gHFWc+gFffVOACIGbvM940SGroUFzK85kDd7Xlg==
18
#MarkusDataBaseConnectionString = ScTg8MgTdbARVQXhb1K9YI3/6emjnMuODvTWZ+UnUZQ8z/Gv4TksSLRn84HTZiC5pT5Vi9KdIFiJ/icpeXrUfa2LTnWdibJ7Oz+4QcYCftqVNPaS3nbiAo67l93XLRVqCpyt4tTSgwhRhdJob48gZhx+zmvoKmAwBR/ofCam3SNjx85gHFWc+gFffVOACIGbvM940SGroUFzK85kDd7Xlg==
19

  
20
#효성 복사본
21
MarkusDataBaseConnectionString = ScTg8MgTdbARVQXhb1K9YI3/6emjnMuODvTWZ+UnUZQ8z/Gv4TksSLRn84HTZiC5/7jdSUr5EUZM30ywChLhQpD7JcUP0OmFolKm/ESAXOyQExjIscSgqZRobsvvTqCJXTB9cMiVyw40ez2n/sz6jEVUlTnXcrgyES00Kne7l1/Vxq1xlZB35sr7iyMcMkAFI6eGTZyU34DfS3t1LQu55A==
22

  
19 23

  
20 24
DownloadTempFolder = C:\CONVERT_SERVICE_TEMP
21 25
MULTI_TRHEAD_MAX_PAGE = 150
ConvertService/ServiceBase/Markus.Service.StationController/App.config
4 4
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
5 5
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
6 6
  </configSections>
7
  <connectionStrings />
7 8
  <startup>
8 9
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
9 10
  </startup>
ConvertService/ServiceBase/Markus.Service.StationController/Controls/RowIndexColumn.cs
36 36
                    {
37 37
                        if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
38 38
                        {
39
                            this.Refresh();
39
                            this.Dispatcher.InvokeAsync(() => this.Refresh());
40
                            //이거 때믄에 row 개수 옮길때  ex)200개 -> 50개 할때 에러 하지만 이게 있어야 row컨버터 후 삭제 및 다시add 할때 index번호가 들어감
41
                            //후 조취: 그냥 에러부분을 messagebox가 아닌 오류 목록에 놨음
40 42
                        }
41 43
                    };
42 44
                }
ConvertService/ServiceBase/Markus.Service.StationController/Extensions/ConvertItemChangeValue.cs
23 23
                {
24 24
                    if (item.GetValue(changeitem) != newinfo.First().GetValue(newitem))
25 25
                    {
26
                        item.SetValue(changeitem, newinfo.First().GetValue(newitem));
26
                        item.SetValue(changeitem, newinfo.First().GetValue(newitem));//오브젝트, 객체
27 27
                    }
28 28
                }
29 29
            }
ConvertService/ServiceBase/Markus.Service.StationController/Markus.Service.StationController.csproj
72 72
    <Reference Include="GemBox.Spreadsheet, Version=39.3.30.1215, Culture=neutral, PublicKeyToken=b1b72c69714d4847, processorArchitecture=MSIL">
73 73
      <HintPath>..\packages\GemBox.Spreadsheet.39.3.30.1215\lib\net30\GemBox.Spreadsheet.dll</HintPath>
74 74
    </Reference>
75
    <Reference Include="LinqKit, Version=1.1.17.0, Culture=neutral, PublicKeyToken=bc217f8844052a91, processorArchitecture=MSIL">
76
      <HintPath>..\packages\LinqKit.1.1.17\lib\net45\LinqKit.dll</HintPath>
77
    </Reference>
75 78
    <Reference Include="Markus.EntityModel, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
76
      <HintPath>..\packages\MarkusDatabase.1.7.2\lib\net45\Markus.EntityModel.dll</HintPath>
79
      <HintPath>..\packages\MarkusDatabase.1.8.0\lib\net45\Markus.EntityModel.dll</HintPath>
77 80
    </Reference>
78 81
    <Reference Include="Markus.Message, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL">
79 82
      <HintPath>..\packages\Markus.Message.1.5.4\lib\net45\Markus.Message.dll</HintPath>
......
163 166
    <Compile Include="Extensions\ConvertItemChangeValue.cs" />
164 167
    <Compile Include="Extensions\GetStatusTypeEnums.cs" />
165 168
    <Compile Include="Extensions\VisualTreeHelper.cs" />
166
    <Compile Include="ViewModel\DataBaseByStatusViewModel.cs" />
167 169
    <Compile Include="ViewModel\AliveViewModel.cs" />
170
    <Compile Include="ViewModel\DataBaseByStatusViewModel.cs" />
168 171
    <Compile Include="ViewModel\DataBaseItemsModel.cs" />
169 172
    <Compile Include="ViewModel\MergeDataViewModel.cs" />
170 173
    <Compile Include="ViewModel\MainViewModel.cs" />
ConvertService/ServiceBase/Markus.Service.StationController/Properties/Settings.settings
1 1
<?xml version='1.0' encoding='utf-8'?>
2
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
3
  <Profiles>
4
    <Profile Name="(Default)" />
5
  </Profiles>
2
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3
  <Profiles />
6 4
  <Settings />
7 5
</SettingsFile>
ConvertService/ServiceBase/Markus.Service.StationController/StationController.ini
14 14
#MarkusDataBaseConnectionString = yRW0I8OJY/boJcR9rTFeH229g456BwO8BaXQbW8h6iCR10JRc5tOl2BDWa1595q0bvW9uD5HsHn9ke4oK3yaw2OYHh8pgYKdhW48xeAl49510h1DPv8uSbqcWdwZ2AjernORxxaEAUqHZb5DFlndcWuid82ZwP/EGxGNhaaCG+KVogeHwI5FZZKrmUTWe3159qk11Q4XswrHeLy8HQn5Qg==
15 15

  
16 16

  
17
# remote test MARKUS_V3
17
#효성 복사본
18 18
MarkusDataBaseConnectionString = ScTg8MgTdbARVQXhb1K9YI3/6emjnMuODvTWZ+UnUZQ8z/Gv4TksSLRn84HTZiC5q/RkHKkgbsc6TL5EdTsnSwK0ngDgXD0P0yPKObgtPfk0MX0wmEG95SDQzGzbT6sH73Lkzde0AeChQWveAWZGvACoQISpdUwNj96c2AQuTqaUHwSkCwSI84HZCYugjlg3gAF1FpPggKCIeu4r/qFi0w==
19

  
20
# remote test MARKUS_V3
21
#MarkusDataBaseConnectionString = ScTg8MgTdbARVQXhb1K9YI3/6emjnMuODvTWZ+UnUZQ8z/Gv4TksSLRn84HTZiC5q/RkHKkgbsc6TL5EdTsnSwK0ngDgXD0P0yPKObgtPfk0MX0wmEG95SDQzGzbT6sH73Lkzde0AeChQWveAWZGvACoQISpdUwNj96c2AQuTqaUHwSkCwSI84HZCYugjlg3gAF1FpPggKCIeu4r/qFi0w==
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/AliveViewModel.cs
12 12

  
13 13
namespace Markus.Service.StationController.ViewModel
14 14
{
15
    public class AliveViewModel :Mvvm.ToolKit.ViewModelBase
15
    public class AliveViewModel : Mvvm.ToolKit.ViewModelBase
16 16
    {
17 17
        BackgroundWorker backgroundWorker;
18 18

  
......
47 47
            get => connectionLog;
48 48
            set
49 49
            {
50
                if(connectionLog != value)
50
                if (connectionLog != value)
51 51
                {
52 52
                    connectionLog = value;
53 53
                    OnPropertyChanged(() => ConnectionLog);
......
74 74
        {
75 75
            while (IsAcitve)
76 76
            {
77
                System.Threading.Thread.Sleep(new TimeSpan(0,0,3));
78 77

  
79 78
                if (!IsLoading)
80 79
                {
......
124 123
            }
125 124
        }
126 125

  
127
       
126

  
128 127

  
129 128
        private void ItemsUpdate(List<ConvertItem> newitems)
130 129
        {
......
181 180
            }
182 181
        }
183 182

  
184
        private void LogWrite(string log,bool IsError)
183
        private void LogWrite(string log, bool IsError)
185 184
        {
186
            if(IsError)
185
            if (IsError)
187 186
            {
188 187
                System.Diagnostics.Trace.Fail(log);
189 188
            }
......
202 201
            {
203 202
                using (System.Net.Http.HttpClient Client = new System.Net.Http.HttpClient())
204 203
                {
205
                    Client.Timeout = new TimeSpan(0, 0,60);
206
                    
204
                    Client.Timeout = new TimeSpan(0, 0, 60);
205

  
207 206
                    var message = await Client.GetAsync(uri);
208 207

  
209 208
                    System.Net.HttpStatusCode StatusCode = message.StatusCode;
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseByStatusViewModel.cs
63 63
            }
64 64
        }
65 65

  
66
       
66

  
67 67

  
68 68
        public DataBaseByStatusViewModel()
69 69
        {
......
144 144
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
145 145
                }
146 146
            }
147
            
147

  
148 148
        }
149 149

  
150 150
        public override void Loaded()
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs
2 2
using Markus.Message;
3 3
using Markus.Service.DataBase;
4 4
using Markus.Service.Extensions;
5
//using Markus.Service.Interface;
6
using Markus.Service.StationController;
5 7
using Markus.Service.StationController.Behaviors;
6 8
using Markus.Service.StationController.Extensions;
7 9
using Microsoft.Win32;
8 10
using System;
9 11
using System.Collections.Generic;
12
using System.Collections.ObjectModel;
10 13
using System.ComponentModel;
14
using System.Diagnostics;
11 15
using System.Linq;
16
using System.Threading.Tasks;
17
using System.Web;
12 18
using System.Windows;
13 19
using Telerik.Windows.Controls;
14 20
using Telerik.Windows.Data;
15 21
using ConvertItem = Markus.Service.Interface.ConvertItem;
22
//using AliveConvertItem = Markus.Service.WcfClient.StationServiceTask.ConvertItem;
23
using Markus.Service.WcfClient.StationServiceTask;
24
using System.Text;
25
using Markus.Service.Helper;
16 26

  
17 27
namespace Markus.Service.StationController.ViewModel
18 28
{
19 29
    //세미
20
    public class DataBaseItemsModel : Mvvm.ToolKit.ViewModelBase
30
    public class DataBaseItemsModel : Mvvm.ToolKit.ViewModelBase, INotifyPropertyChanged
21 31
    {
32
        //alive
33
        private BackgroundWorker AlivebackgroundWorker;
34
        
35
        private bool isLoading;
36
        private System.Windows.Documents.FlowDocument connectionLog;
37

  
38
        private System.Collections.ObjectModel.ObservableCollection<ConvertItem> _AliveItems;
39

  
40
        public System.Collections.ObjectModel.ObservableCollection<ConvertItem> AliveItems
41
        {
42
            get => _AliveItems; set
43
            {
44
              _AliveItems = value;
45
                OnPropertyChanged(() => AliveItems);
46
            }
47
        }
48

  
49
        public bool AliveIsLoading
50
        {
51
            get => isLoading; set
52
            {
53
                if (isLoading != value)
54
                {
55
                    isLoading = value;
56
                    OnPropertyChanged(() => AliveIsLoading);
57
                }
58
            }
59
        }
60

  
61

  
62
        public System.Windows.Documents.FlowDocument ConnectionLog
63
        {
64
            get => connectionLog;
65
            set
66
            {
67
                if (connectionLog != value)
68
                {
69
                    connectionLog = value;
70
                    OnPropertyChanged(() => ConnectionLog);
71
                }
72
            }
73
        }
74

  
75
        //public AliveViewModel()
76
        //{
77
        //}
78

  
79
        //// 진행률에 변화가 있을때 이벤트가 발생
80
        //private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
81
        //{
82
        //}
83

  
84
        //// 일이 모두 마쳤을때 수행되어야할 코드
85
        //private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
86
        //{
87
        //}
88

  
89
        // BackgroundWorker에서 수행할 일을 정의.
90
        private void AlivebackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
91
        {
92
        }
93
        private void AlivebackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
94
        {
95
        }
96
        private async void AlivebackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
97
        {
98
            while (IsAcitve)
99
            {
100
                //System.Threading.Thread.Sleep(new TimeSpan(0, 0, 3));
101

  
102
                if (!IsLoading)
103
                {
104
                    IsLoading = true;
105

  
106
                    try
107
                    {
108

  
109
                        List<ConvertItem> newitems = new List<ConvertItem>();
110

  
111
                        foreach (var client in App.StationClientList)
112
                        {
113
                            if (await SimplePingAsync(client.Endpoint.Address.ToString()))
114
                            {
115
                                try
116
                                {
117
                                    List<ConvertItem> itemsToList = new List<ConvertItem>();
118
                                    var items = await client.AliveConvertListAsync();
119
                                    //int i = 0;
120
                                    foreach (var item in items)
121
                                    {
122
                                        ConvertItem itemsToEach = new ConvertItem();
123
                                        itemsToEach.ServiceID = item.ServiceID;
124
                                        itemsToEach.ConvertID = item.ConvertID;
125
                                        itemsToEach.ProjectNumber = item.ProjectNumber;
126
                                        //itemsToEach.ConvertState = (StatusCodeType.)item.ConvertState;// (StatusCodeType) item.ConvertState;
127
                                        itemsToEach.ConvertState = (StatusCodeType)Enum.Parse(typeof(StatusCodeType), item.ConvertState);
128
                                        itemsToEach.CurrentPageNo = item.CurrentPageNo;
129
                                        itemsToEach.TotalPage = item.TotalPage;
130
                                        itemsToEach.OriginfilePath = item.OriginfilePath;
131
                                        itemsToEach.ConvertPath = item.ConvertPath;
132

  
133
                                        itemsToList.Add(itemsToEach);
134
                                        //i++;
135
                                    }
136
                                    newitems.AddRange(itemsToList);
137
                                    //System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} ping");
138

  
139
                                    if (items.Count() == 0)
140
                                    {
141
                                        //System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} Alive Items is zero.");
142
                                    }
143
                                }
144
                                catch (Exception ex)
145
                                {
146
                                    //System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} {ex.Message}");
147
                                }
148
                            }
149
                            else
150
                            {
151
                                //System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} ping Error");
152
                            }
153
                        }
154

  
155
                       // ItemsUpdate(newitems);
156
                        await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => ItemsUpdate(newitems));
157
                    }
158
                    catch (Exception ex)
159
                    {
160
                        System.Diagnostics.Debug.WriteLine(ex.ToString());
161
                    }
162

  
163
                    IsLoading = false;
164
                }
165

  
166
            }
167
        }
168

  
169

  
170
        private async void AliveDataSelect()
171
        {
172
            try
173
            {
174
                List<ConvertItem> newitems = new List<ConvertItem>();
175

  
176
                foreach (var client in App.StationClientList)
177
                {
178
                    if (await SimplePingAsync(client.Endpoint.Address.ToString()))
179
                    {
180
                        try
181
                        {
182
                            List<ConvertItem> itemsToList = new List<ConvertItem>();
183
                            var items = await client.AliveConvertListAsync();
184
                            //int i = 0;
185
                            foreach (var item in items)
186
                            {
187
                                ConvertItem itemsToEach = new ConvertItem();
188
                                itemsToEach.ServiceID = item.ServiceID;
189
                                itemsToEach.ConvertID = item.ConvertID;
190
                                itemsToEach.ProjectNumber = item.ProjectNumber;
191
                                //itemsToEach.ConvertState = (StatusCodeType.)item.ConvertState;// (StatusCodeType) item.ConvertState;
192
                                try
193
                                {
194
                                    itemsToEach.ConvertState = (StatusCodeType)Enum.Parse(typeof(StatusCodeType), item.ConvertState);
195
                                }
196
                                catch (Exception ex)
197
                                {
198

  
199
                                    throw ex;
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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