diff --git a/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs b/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs index 14e889a2..1a118d7a 100644 --- a/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs +++ b/Aucma.Core.ProductOffLine/Business/offLineBusiness.cs @@ -17,20 +17,21 @@ namespace Aucma.Core.ProductOffLine.Business /// /// 入库业务逻辑 /// - public class offLineBusiness + public class OffLineBusiness { + #region 单例实现 - //private static readonly InStoreBusiness lazy = new InStoreBusiness(); - //public static InStoreBusiness Instance - //{ - // get - // { - // return lazy; - // } - //} + private static readonly OffLineBusiness lazy = new OffLineBusiness(); + public static OffLineBusiness Instance + { + get + { + return lazy; + } + } #endregion - + System.Timers.Timer timer = new System.Timers.Timer(1000); #region 接口引用 @@ -52,12 +53,16 @@ namespace Aucma.Core.ProductOffLine.Business #endregion - public offLineBusiness() + public OffLineBusiness() { _baseBomInfoService = App.ServiceProvider.GetService(); BaseBomInfo bom = _baseBomInfoService.FirstAsync().Result; Console.WriteLine(); + } + public void test() + { + } } } diff --git a/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs b/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs index d71dca43..9f20923a 100644 --- a/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.ProductOffLine/ViewModels/IndexPageViewModel.cs @@ -44,11 +44,13 @@ namespace Aucma.Core.ProductOffLine.ViewModels private readonly IProductPlanInfoServices? _productPlanInfoServices; private readonly IProductOffLineServices ? _productOffLineServices; System.Timers.Timer timer = new System.Timers.Timer(1000); + private OffLineBusiness offLineBusiness = OffLineBusiness.Instance; int a = 0; public IndexPageViewModel() { - offLineBusiness business = new offLineBusiness(); - _productOffLineServices = App.ServiceProvider.GetService(); + offLineBusiness.test(); + + _productOffLineServices = App.ServiceProvider.GetService(); _baseOrderInfoServices = App.ServiceProvider.GetService(); _productPlanInfoServices = App.ServiceProvider.GetService(); MvCodeHelper.ReceiveCodeEvent += ReceiveCode;