change-默认时间

master
liuwf 1 month ago
parent 69639cd91d
commit fba24e5b24

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

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

@ -93,7 +93,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
}
private DateTime? _startDate;
private DateTime? _startDate ;
public DateTime? StartDate
{
get => _startDate;
@ -104,7 +104,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
}
}
private DateTime? _endDate;
private DateTime? _endDate ;
public DateTime? EndDate
{
get => _endDate;
@ -138,64 +138,42 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
[RelayCommand]
private void GetTransferOrder()
{
if (_startDate == null || _endDate == null)
try
{
MessageBox.Show("请选择开始日期或者结束日期");
return;
}else if (_startDate > _endDate)
{
MessageBox.Show("开始日期不能大于结束日期");
return;
}
_endDate = _endDate.Value.AddDays(1);
#region 正式启用
CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb(_drj, _startDate.Value.ToString(), _endDate.Value.ToString());
MessageBox.Show("容器封发-获取调拨单和封发计划:" + res.GetMsg());
if (res.code == "200")
{
JObject job = JObject.Parse(res.body);
string str = job["retBody"]?["object"]?.ToString();
if (!str.IsNullOrEmpty())
if (_startDate == null || _endDate == null)
{
List<TransferOrderInfo> institutionList = JsonConvert.DeserializeObject<List<TransferOrderInfo>>(str);
TransferOrderInfoItems = new ObservableCollection<TransferOrderInfo>(institutionList);
TotalAmount = TransferOrderInfoItems.Count.ToString();
MessageBox.Show("请选择开始日期或者结束日期");
return;
}
}
#endregion
else if (_startDate > _endDate)
{
MessageBox.Show("开始日期不能大于结束日期");
return;
}
_endDate = _endDate.Value.AddDays(1);
#region 正式启用
CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb(_drj, _startDate.Value.ToString(), _endDate.Value.ToString());
MessageBox.Show("容器封发-获取调拨单和封发计划:" + res.GetMsg());
if (res.code == "200")
{
JObject job = JObject.Parse(res.body);
string str = job["retBody"]?["object"]?.ToString();
if (!str.IsNullOrEmpty())
{
List<TransferOrderInfo> institutionList = JsonConvert.DeserializeObject<List<TransferOrderInfo>>(str);
TransferOrderInfoItems = new ObservableCollection<TransferOrderInfo>(institutionList);
TotalAmount = TransferOrderInfoItems.Count.ToString();
}
}
#endregion
//#region 测试
//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
}catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

Loading…
Cancel
Save