/// <summary> /// Creates the default cash drawer. /// </summary> /// <param name="instance">Specifies the cash drawer instance that should be used.</param> /// <returns>True if the cash drawer was created, false otherwise.</returns> private async Task <bool> CreateDefaultCashDrawerObject(CashDrawerInstance instance) { rootPage.NotifyUser("Creating cash drawer object.", NotifyType.StatusMessage); CashDrawer tempDrawer = null; tempDrawer = await CashDrawer.GetDefaultAsync(); if (tempDrawer == null) { rootPage.NotifyUser("Cash drawer not found. Please connect a cash drawer.", NotifyType.ErrorMessage); return(false); } switch (instance) { case CashDrawerInstance.Instance1: cashDrawerInstance1 = tempDrawer; break; case CashDrawerInstance.Instance2: cashDrawerInstance2 = tempDrawer; break; default: return(false); } return(true); }
/// <summary> /// Creates the default cash drawer. /// </summary> /// <returns>True if the cash drawer was created, false otherwise.</returns> private async Task <bool> CreateDefaultCashDrawerObject() { rootPage.NotifyUser("Creating cash drawer object.", NotifyType.StatusMessage); if (drawer == null) { drawer = await CashDrawer.GetDefaultAsync(); if (drawer == null) { return(false); } } return(true); }