步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

431 lines
12 KiB

using BBWY.Client.Models;
using BBWY.Client.ViewModels.PackerTask;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Client.ViewModels.SealBox;
2 years ago
using BBWY.Client.ViewModels.TotalPackTask;
2 years ago
using GalaSoft.MvvmLight.Ioc;
2 years ago
using Microsoft.Extensions.DependencyInjection;
3 years ago
using System;
2 years ago
using System.Windows.Navigation;
using static System.Formats.Asn1.AsnWriter;
3 years ago
namespace BBWY.Client.ViewModels
{
public class ViewModelLocator
{
private IServiceProvider sp;
3 years ago
public bool IsCreateWareManager { get; private set; }
public bool IsCreateWareStock { get; private set; }
public bool IsCreateOrderList { get; private set; }
public bool IsCreateBatchPurchaseOrderList { get; private set; }
3 years ago
2 years ago
2 years ago
3 years ago
public ViewModelLocator()
{
sp = (App.Current as App).ServiceProvider;
}
2 years ago
3 years ago
public MainViewModel Main
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<MainViewModel>();
}
}
}
public WareManagerViewModel WareManager
{
get
{
3 years ago
IsCreateWareManager = true;
3 years ago
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<WareManagerViewModel>();
}
}
}
public WareStockViewModel WareStock
{
get
{
3 years ago
IsCreateWareStock = true;
3 years ago
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<WareStockViewModel>();
}
}
}
public BindingPurchaseProductViewModel BindingPurchaseProduct
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<BindingPurchaseProductViewModel>();
}
}
}
public OrderListViewModel OrderList
{
get
{
3 years ago
IsCreateOrderList = true;
3 years ago
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<OrderListViewModel>();
}
}
}
2 years ago
public PackTaskTotalViewModel PackTaskTotal
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<PackTaskTotalViewModel>();
}
}
}
2 years ago
public ShopPackTaskTotalViewModel ShopPackTaskTotal
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<ShopPackTaskTotalViewModel>();
}
}
}
public ServiceOrderViewModel ServiceOrderList
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<ServiceOrderViewModel>();
}
}
}
2 years ago
public ConsumableViewModel Consumable
{
get
{
//IsCreateOrderList = true;
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<ConsumableViewModel>();
}
}
}
2 years ago
public TaskListViewModel TaskList
{
get
{
2 years ago
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<TaskListViewModel>();
}
}
}
2 years ago
public WareHouseListViewModel WareHouseList
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<WareHouseListViewModel>();
}
}
}
2 years ago
2 years ago
public PackServiceViewModel PackServiceList
{
get
{
//IsCreateOrderList = true;
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<PackServiceViewModel>();
}
}
}
public TipsViewModel TipsView
{
get
{
//IsCreateOrderList = true;
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<TipsViewModel>();
}
}
}
public SetBarCodeViewModel CreateSetBarCodeView
{
get
{
2 years ago
2 years ago
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<SetBarCodeViewModel>();
}
}
}
2 years ago
2 years ago
public CreatePackTaskViewModel CreateTaskView
{
get
2 years ago
{
2 years ago
using (var s = sp.CreateScope())
{
2 years ago
var viewModel = s.ServiceProvider.GetRequiredService<CreatePackTaskViewModel>();
//bool areSame = object.ReferenceEquals(viewModel, sp.GetRequiredService<CreatePackTaskViewModel>());
return viewModel;
2 years ago
}
}
}
2 years ago
public ChoosePurchaseSchemeViewModel ChoosePurchaseScheme
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<ChoosePurchaseSchemeViewModel>();
}
}
}
public _1688PreviewPurchaseViewModel _1688PreviewPurchase
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<_1688PreviewPurchaseViewModel>();
}
}
}
3 years ago
public ShopSettingViewModel ShopSetting
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<ShopSettingViewModel>();
}
}
3 years ago
public ProcurementAuditViewModel ProcurementAudit
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<ProcurementAuditViewModel>();
}
}
3 years ago
public BillCorrectionViewModel BillCorrection
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<BillCorrectionViewModel>();
}
}
2 years ago
public EditServiceOrderViewModel EditServiceOrder
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<EditServiceOrderViewModel>();
}
}
2 years ago
public BatchPurchaseOrderListViewModel BatchPurchaseOrderListVM
{
get
{
IsCreateBatchPurchaseOrderList = true;
2 years ago
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<BatchPurchaseOrderListViewModel>();
}
}
public BatchPurchaseCreateNewOrderViewModel BatchPurchaseCreateNewOrder
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<BatchPurchaseCreateNewOrderViewModel>();
}
}
public BatchPurchaseAddProductSkuViewModel BatchPurchaseAddProductSku
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<BatchPurchaseAddProductSkuViewModel>();
}
}
2 years ago
public BatchPublishTaskViewModel BatchPublishTask
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<BatchPublishTaskViewModel>();
}
}
2 years ago
public PublishTaskViewModel PublishTask
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<PublishTaskViewModel>();
}
}
2 years ago
public PackSkuSplitConfigViewModel PackSkuConfig
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<PackSkuSplitConfigViewModel>();
}
}
2 years ago
2 years ago
2 years ago
2 years ago
public QualityViewModel QualityTask
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<QualityViewModel>();
}
}
2 years ago
public PackUserSalaryViewModel PackUserSalary
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<PackUserSalaryViewModel>();
}
}
2 years ago
public SealBoxConfigureViewModel SealBoxConfigureVModel
2 years ago
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<SealBoxConfigureViewModel>();
}
2 years ago
}
public UpdatePurchaseTaskViewModel UpdatePurchaseTask
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<UpdatePurchaseTaskViewModel>();
}
}
2 years ago
public PackDetailViewModel PackDetailVM
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<PackDetailViewModel>();
}
}
2 years ago
public ExportOrderSkuViewModel ExportOrderSkuVM
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<ExportOrderSkuViewModel>();
}
}
2 years ago
public StorePickSelfViewModel StorePickSelfVM
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<StorePickSelfViewModel>();
}
}
public OrderCouponDetailViewModel OrderCouponDetailVM
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<OrderCouponDetailViewModel>();
}
}
2 years ago
public PackerTaskViewModel PackerTaskVM
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<PackerTaskViewModel>();
}
}
public PackerSalaryViewModel PackerSalaryVM
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<PackerSalaryViewModel>();
}
}
//public ShopSealBoxListViewModel ShopSealBoxListVM
//{
// get
// {
// using (var s = sp.CreateScope())
// {
// return s.ServiceProvider.GetRequiredService<ShopSealBoxListViewModel>();
// }
// }
//}
3 years ago
}
}