|
|
@ -66,6 +66,10 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
public ICommand EditQuantityRatioCommand { get; set; } |
|
|
|
|
|
|
|
public ICommand AddQuantityCommand { get; set; } |
|
|
|
|
|
|
|
public ICommand SubtractQuantityCommand { get; set; } |
|
|
|
|
|
|
|
public BatchPurchaseCreateNewOrderViewModel(PurchaseProductAPIService purchaseProductAPIService, PurchaseService purchaseService, GlobalContext globalContext) |
|
|
|
{ |
|
|
|
this.globalContext = globalContext; |
|
|
@ -78,6 +82,8 @@ namespace BBWY.Client.ViewModels |
|
|
|
AddProductSkuCommand = new RelayCommand(AddProductSku); |
|
|
|
DeleteProductSkuWithSchemeCommand = new RelayCommand<ProductSkuWithScheme>(DeleteProductSkuWithScheme); |
|
|
|
EditQuantityRatioCommand = new RelayCommand<object>(EditQuantityRatio); |
|
|
|
AddQuantityCommand = new RelayCommand<PurchaseSchemeProductSku>(AddQuantity); |
|
|
|
SubtractQuantityCommand = new RelayCommand<PurchaseSchemeProductSku>(SubtractQuantity); |
|
|
|
this.delayTrigger = new DelayTrigger(); |
|
|
|
this.delayTrigger.OnExecute = OnDelayTriggerExecute; |
|
|
|
} |
|
|
@ -102,6 +108,15 @@ namespace BBWY.Client.ViewModels |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (ProductSkuWithSchemeList.Count() == 0) |
|
|
|
{ |
|
|
|
ProductAmount = 0; |
|
|
|
FreightAmount = 0; |
|
|
|
TotalAmount = 0; |
|
|
|
IsLoading = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
IsLoading = true; |
|
|
|
//IsLoading = true;
|
|
|
|
//Task.Factory.StartNew(() => purchaseOrderService.PreviewPurchaseOrder(new Consignee()
|
|
|
@ -309,5 +324,16 @@ namespace BBWY.Client.ViewModels |
|
|
|
purchaseSchemeProductSku.ItemTotal = quantityRatio * skuQuantity; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void AddQuantity(PurchaseSchemeProductSku purchaseSchemeProductSku) |
|
|
|
{ |
|
|
|
purchaseSchemeProductSku.ItemTotal++; |
|
|
|
} |
|
|
|
|
|
|
|
private void SubtractQuantity(PurchaseSchemeProductSku purchaseSchemeProductSku) |
|
|
|
{ |
|
|
|
if (purchaseSchemeProductSku.ItemTotal > 1) |
|
|
|
purchaseSchemeProductSku.ItemTotal--; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|