프로젝트

일반

사용자정보

개정판 902f397c

ID902f397cb47fb62e1c3e8d6a39ef33cda1d8aa60
상위 a9e86f7a
하위 5a954acc

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

DatabaseFilter 수정

Change-Id: I44d6697b18f74f21cd98d46243a56e1d3b50cc26

차이점 보기:

ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseItemsModel.cs
20 20
using System.Diagnostics;
21 21
using System.Windows.Input;
22 22
using Markus.Mvvm.ToolKit;
23
using System.Windows.Data;
23 24

  
24 25
namespace Markus.Service.StationController.ViewModel
25 26
{
......
58 59
        private System.Collections.ObjectModel.ObservableCollection<ConvertItem> _FilterConvertSource;
59 60
        public System.Collections.ObjectModel.ObservableCollection<ConvertItem> FilterConvertSource
60 61
        {
61
            get => _FilterConvertSource;
62
            //get => _FilterConvertSource;
63
            get
64
            {
65
                //if (_FilterConvertSource == null)
66
                //{
67
                //    _FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertItem>();
68
                //}
69
                //var view = CollectionViewSource.GetDefaultView(FilterConvertSource);
70
                //if (view.CanFilter)
71
                //{
72
                //    view.Filter = TestFilter;
73
                //}
74
                return _FilterConvertSource;
75
            }
62 76
            set
63 77
            {
64 78
                _FilterConvertSource = value;
......
213 227
                OnPropertyChanged(() => ConvertShow);
214 228
            }
215 229
        }
230

  
231
        public string _ProjectNumberFilter;
232
        public string ProjectNumberFilter
233
        {
234
            get { return _ProjectNumberFilter; }
235
            set
236
            {
237
                if (_ProjectNumberFilter != value)
238
                {
239
                    _ProjectNumberFilter = value;
240
                    OnPropertyChanged(() => ProjectNumberFilter); 
241
                    CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh();
242
                }
243
            }
244
        }
245

  
246
        public string _UniqueKeyFilter;
247
        public string UniqueKeyFilter
248
        {
249
            get { return _UniqueKeyFilter; }
250
            set
251
            {
252
                if (_UniqueKeyFilter != value)
253
                {
254
                    _UniqueKeyFilter = value;
255
                    OnPropertyChanged(() => UniqueKeyFilter);
256
                    CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh();
257
                }
258
            }
259
        }
260

  
261
        public string _ConvertStateFilter;
262
        public string ConvertStateFilter
263
        {
264
            get { return _ConvertStateFilter; }
265
            set
266
            {
267
                if (_ConvertStateFilter != value)
268
                {
269
                    _ConvertStateFilter = value;
270
                    OnPropertyChanged(() => ConvertStateFilter);
271
                    CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh();
272
                }
273
            }
274
        }
275

  
276
        public string _Docuemnt_NOFilter;
277
        public string Docuemnt_NOFilter
278
        {
279
            get { return _Docuemnt_NOFilter; }
280
            set
281
            {
282
                if (_Docuemnt_NOFilter != value)
283
                {
284
                    _Docuemnt_NOFilter = value;
285
                    OnPropertyChanged(() => Docuemnt_NOFilter);
286
                    CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh();
287
                }
288
            }
289
        }
290

  
291
        public string _Docuemnt_NameFilter;
292
        public string Docuemnt_NameFilter
293
        {
294
            get { return _Docuemnt_NameFilter; }
295
            set
296
            {
297
                if (_Docuemnt_NameFilter != value)
298
                {
299
                    _Docuemnt_NameFilter = value;
300
                    OnPropertyChanged(() => Docuemnt_NameFilter);
301
                    CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh();
302
                }
303
            }
304
        }
305

  
306
        public string _ReconverterFilter;
307
        public string ReconverterFilter
308
        {
309
            get { return _ReconverterFilter; }
310
            set
311
            {
312
                if (_ReconverterFilter != value)
313
                {
314
                    _ReconverterFilter = value;
315
                    OnPropertyChanged(() => ReconverterFilter);
316
                    CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh();
317
                }
318
            }
319
        }
320

  
321
        public string _Service_IDFilter;
322
        public string Service_IDFilter
323
        {
324
            get { return _Service_IDFilter; }
325
            set
326
            {
327
                if (_Service_IDFilter != value)
328
                {
329
                    _Service_IDFilter = value;
330
                    OnPropertyChanged(() => Service_IDFilter);
331
                    CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh();
332
                }
333
            }
334
        }
335

  
336
        public string _RevisionFilter;
337
        public string RevisionFilter
338
        {
339
            get { return _RevisionFilter; }
340
            set
341
            {
342
                if (_RevisionFilter != value)
343
                {
344
                    _RevisionFilter = value;
345
                    OnPropertyChanged(() => RevisionFilter);
346
                    CollectionViewSource.GetDefaultView(FilterConvertSource).Refresh();
347
                }
348
            }
349
        }
216 350
        #endregion
217 351

  
218 352
        #region Command
......
344 478
                        _status = (int)SelectedStatus.Value;
345 479
                    }
346 480

  
481
                    //if (ProjectNumberFilter != null)
482
                    //{
483
                    //    from item in FilterConvertSource
484
                    //    where like % item.ProjectNumber
485
                    //}
486

  
347 487
                    var items = database.GetConvertProjects(_status)//x:database객체 y:statusCodeTypeList의값  Count()안에 predicator 조건 만족하면 count개수안에 넣음
348 488
                                          .Take(SelectedCount.ValueMember).ToList();
349 489

  
......
777 917

  
778 918
        #endregion
779 919

  
920
        #region TestFilter
921

  
922

  
923
        /// <summary>
924
        /// Grid Filter
925
        /// </summary>
926

  
927
        private bool TestFilter(object item)
928
        {
929
            var Item = item as ConvertItem;
930
            if (ProjectNumberFilter == null) return true;
931
            if (ProjectNumberFilter == Item.ProjectNumber) return true;
932
            return false;
933
        }
934

  
935
        #endregion
936

  
780 937
        #endregion
781 938
    }
782 939
}

내보내기 Unified diff

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