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); } } }
//### 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); } } }