|
@@ -64,29 +64,39 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
string prono;
|
|
|
private void query()
|
|
|
{
|
|
|
- if (SelectedEndDate < SelectedStartDate || SelectedStartDate == default)
|
|
|
+ try
|
|
|
{
|
|
|
- MessageBox.Show("请选择正确的日期", "提示");
|
|
|
- return;
|
|
|
- }
|
|
|
+ if (SelectedEndDate < SelectedStartDate || SelectedStartDate == default)
|
|
|
+ {
|
|
|
+ MessageBox.Show("请选择正确的日期", "提示");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ _infNew.Clear();
|
|
|
|
|
|
- _infNew.Clear();
|
|
|
+ var endTime = SelectedEndDate.AddDays(1);
|
|
|
+ if (ProCode != "")
|
|
|
+ {
|
|
|
+ var res = repository.GetAllQuery<Information>(c => c.ProCode == ProCode && c.CreateTime >= SelectedStartDate && c.CreateTime <= endTime);
|
|
|
+ if (res[0].ProNo != "")
|
|
|
+ { prono = res[0].ProNo; }
|
|
|
+ else { prono = res[1].ProNo; }
|
|
|
|
|
|
- var endTime = SelectedEndDate.AddDays(1);
|
|
|
- var res = repository.GetAllQuery<Information>(c => c.ProCode == ProCode && c.CreateTime >= SelectedStartDate && c.CreateTime <= endTime);
|
|
|
- if (res[0].ProNo != "")
|
|
|
- { prono = res[0].ProNo; }
|
|
|
- else { prono = res[1].ProNo; }
|
|
|
-
|
|
|
- var list = repository.GetAllQuery<Information>(c => c.ProNo == prono && c.CreateTime >= SelectedStartDate && c.CreateTime <= endTime);
|
|
|
+ var list = repository.GetAllQuery<Information>(c => c.ProNo == prono && c.CreateTime >= SelectedStartDate && c.CreateTime <= endTime);
|
|
|
|
|
|
- list.Reverse();
|
|
|
- var dtos = _mapper.Map<List<Information>>(list);
|
|
|
- _infNew.AddRange(dtos);
|
|
|
+ list.Reverse();
|
|
|
+ var dtos = _mapper.Map<List<Information>>(list);
|
|
|
+ _infNew.AddRange(dtos);
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- InfNew = _infNew.Take(PageCount).ToList();
|
|
|
- MaxCount = _infNew.Count / PageCount + 1;
|
|
|
+ InfNew = _infNew.Take(PageCount).ToList();
|
|
|
+ MaxCount = _infNew.Count / PageCount + 1;
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ MessageBox.Show("StatementPage:" + ex.Message);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|