change-默认时间

master
liuwf 1 month ago
parent 69639cd91d
commit fba24e5b24

@ -24,7 +24,8 @@ namespace SlnMesnac.RfidUpload.UI
public ContainerTransferOrderWindow(ContainerTransferOrderViewModel containerOrderViewModel) public ContainerTransferOrderWindow(ContainerTransferOrderViewModel containerOrderViewModel)
{ {
InitializeComponent(); InitializeComponent();
containerOrderViewModel.StartDate = DateTime.Now.Date;
containerOrderViewModel.EndDate = DateTime.Now.Date;
this.DataContext = containerOrderViewModel; this.DataContext = containerOrderViewModel;
containerOrderViewModel.SuccessEvent += () => containerOrderViewModel.SuccessEvent += () =>
{ {

@ -24,7 +24,8 @@ namespace SlnMesnac.RfidUpload.UI
public TransferOrderWindow(TransferOrderViewModel orderViewModel) public TransferOrderWindow(TransferOrderViewModel orderViewModel)
{ {
InitializeComponent(); InitializeComponent();
orderViewModel.StartDate = DateTime.Now.Date;
orderViewModel.EndDate = DateTime.Now.Date;
this.DataContext = orderViewModel; this.DataContext = orderViewModel;
orderViewModel.SuccessEvent += () => orderViewModel.SuccessEvent += () =>
{ {

@ -93,7 +93,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
} }
private DateTime? _startDate; private DateTime? _startDate ;
public DateTime? StartDate public DateTime? StartDate
{ {
get => _startDate; get => _startDate;
@ -104,7 +104,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
} }
} }
private DateTime? _endDate; private DateTime? _endDate ;
public DateTime? EndDate public DateTime? EndDate
{ {
get => _endDate; get => _endDate;
@ -137,16 +137,20 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI"); private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI");
[RelayCommand] [RelayCommand]
private void GetTransferOrder() private void GetTransferOrder()
{
try
{ {
if (_startDate == null || _endDate == null) if (_startDate == null || _endDate == null)
{ {
MessageBox.Show("请选择开始日期或者结束日期"); MessageBox.Show("请选择开始日期或者结束日期");
return; return;
}else if (_startDate > _endDate) }
else if (_startDate > _endDate)
{ {
MessageBox.Show("开始日期不能大于结束日期"); MessageBox.Show("开始日期不能大于结束日期");
return; return;
} }
_endDate = _endDate.Value.AddDays(1); _endDate = _endDate.Value.AddDays(1);
#region 正式启用 #region 正式启用
CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb(_drj, _startDate.Value.ToString(), _endDate.Value.ToString()); CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb(_drj, _startDate.Value.ToString(), _endDate.Value.ToString());
@ -166,36 +170,10 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
} }
#endregion #endregion
}catch (Exception ex)
{
//#region 测试 MessageBox.Show(ex.Message);
//result res = new result() }
//{
// status = "1",
// msg = "测试",
// @object = new List<TransferOrderInfo>()
// {
// new TransferOrderInfo()
// {
// dbdh = "123",
// jsdw = "123",
// ffjhNo = "jh123",
// ffjhscrq = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
// },
// new TransferOrderInfo()
// {
// dbdh = "324",
// jsdw = "456",
// ffjhNo = "jh456",
// ffjhscrq = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
// }
// }
//};
//if (res.@object != null)
//{
// TransferOrderInfoItems = new ObservableCollection<TransferOrderInfo>(res.@object);
//}
//#endregion
} }

Loading…
Cancel
Save