Exemple #1
0
 public bool Initialize(string vipno = null)
 {
     lock (_locker)
     {
         if (Wrapper.User == null)
         {
             return(Initialized = false);
         }
         ActivityLogService.Logger.LogFunctionCall();
         try
         {
             _vipno         = vipno;
             _previousSales = new List <SaleDiscount>();
             _shoppingBag   = new List <ShoppingItem>();
             SaleDiscount.ResetCounter();
             EngineRestarted?.Invoke();
             return(Initialized = true);
         }
         catch (Exception ex)
         {
             ActivityLogService.Logger.LogError(ex);
             return(Initialized = false);
         }
     }
 }
Exemple #2
0
 //### Testing purpose
 public bool InitializeForDebugging()
 {
     lock (_locker)
     {
         ActivityLogService.Logger.LogFunctionCall();
         try
         {
             _previousSales = new List <SaleDiscount>();
             AvailableSales = makeSalesForTester();
             _shoppingBag   = new List <ShoppingItem>();
             SaleDiscount.ResetCounter();
             EngineRestarted?.Invoke();
             return(Initialized = true);
         }
         catch (Exception ex)
         {
             ActivityLogService.Logger.LogError(ex);
             return(Initialized = false);
         }
     }
 }