Filterung der Ergebnisse nach dem Zeitintervall hinzugefügt
This commit is contained in:
parent
47336e0b8d
commit
6fc09ad7da
@ -270,7 +270,7 @@ namespace ENI2.Controls
|
|||||||
this.maerskDataList.Add(md);
|
this.maerskDataList.Add(md);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.TimeFilterItemSource();
|
||||||
this.SortItemSource();
|
this.SortItemSource();
|
||||||
this.dataGridPOCores.SelectedItem = null;
|
this.dataGridPOCores.SelectedItem = null;
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
||||||
@ -291,6 +291,29 @@ namespace ENI2.Controls
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TimeFilterItemSource()
|
||||||
|
{
|
||||||
|
List<MaerskData> removeList = new List<MaerskData>();
|
||||||
|
foreach (MaerskData md in this.maerskDataList)
|
||||||
|
{
|
||||||
|
if (md.ETA.HasValue)
|
||||||
|
{
|
||||||
|
if (this.dateTimePickerFrom.SelectedDate.HasValue && (md.ETA.Value < this.dateTimePickerFrom.SelectedDate.Value))
|
||||||
|
removeList.Add(md);
|
||||||
|
|
||||||
|
if (this.dateTimePickerTo.SelectedDate.HasValue) {
|
||||||
|
|
||||||
|
DateTime toDate = this.dateTimePickerTo.SelectedDate.Value.ToUniversalTime().Add(new TimeSpan(23, 59, 59));
|
||||||
|
if(md.ETA.Value > toDate)
|
||||||
|
removeList.Add(md);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (MaerskData md in removeList)
|
||||||
|
this.maerskDataList.Remove(md);
|
||||||
|
}
|
||||||
|
|
||||||
private void SortItemSource()
|
private void SortItemSource()
|
||||||
{
|
{
|
||||||
ObservableCollection<MaerskData> temp;
|
ObservableCollection<MaerskData> temp;
|
||||||
@ -425,6 +448,7 @@ namespace ENI2.Controls
|
|||||||
maerskDataList.Add(md);
|
maerskDataList.Add(md);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.TimeFilterItemSource();
|
||||||
this.SortItemSource();
|
this.SortItemSource();
|
||||||
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user