|
|
@ -76,6 +76,8 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
public ICommand SearchOrderCommand { get; set; } |
|
|
|
|
|
|
|
public ICommand SyncOrderCommand { get; set; } |
|
|
|
|
|
|
|
public ICommand CopyTextCommand { get; set; } |
|
|
|
|
|
|
|
public ICommand CopyOrderWaybillCommand { get; set; } |
|
|
@ -110,6 +112,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
Task.Factory.StartNew(() => LoadOrder(1)); //手动点击查询订单
|
|
|
|
Task.Factory.StartNew(() => LoadTodayAchievement(StartDate, EndDate)); |
|
|
|
}); |
|
|
|
SyncOrderCommand = new RelayCommand(SyncOrder); |
|
|
|
CopyTextCommand = new RelayCommand<string>(s => |
|
|
|
{ |
|
|
|
try |
|
|
@ -470,5 +473,19 @@ namespace BBWY.Client.ViewModels |
|
|
|
//LoadOrder(PageIndex);
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private void SyncOrder() |
|
|
|
{ |
|
|
|
IsLoading = true; |
|
|
|
Task.Factory.StartNew(() => orderService.SyncOrder(globalContext.User.Shop.ShopId, StartDate, EndDate)).ContinueWith(r => |
|
|
|
{ |
|
|
|
IsLoading = false; |
|
|
|
var response = r.Result; |
|
|
|
if (response.Success) |
|
|
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show("同步任务创建成功,该任务会执行一段时间,请稍后查询订单列表观察同步结果", "同步订单")); |
|
|
|
else |
|
|
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show(response.Msg, "同步订单")); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|