Example #1
0
        private void ShowStockCountLines(string selectedJournalId, string selectedRecId)
        {
            DialogResult result = DialogResult.Cancel;

            if (ApplicationSettings.Terminal.TerminalOperator.UserIsInventoryUser)
            {
                using (frmStockCount dialog = new frmStockCount())
                {
                    dialog.SelectedJournalId = selectedJournalId;
                    dialog.SelectedRecordId  = selectedRecId;
                    this.Application.ApplicationFramework.POSShowForm(dialog);
                    result = dialog.DialogResult;
                }

                if (result == DialogResult.OK)
                {
                    this.repeatCall = true;
                    ShowStockCountHeaders();
                }
            }
            else
            {
                POSFormsManager.ShowPOSMessageDialog(3540);             // Not allowed.
            }
        }
Example #2
0
        /// <summary>
        /// Gift card payment related methods
        /// </summary>
        /// <param name="valid"></param>
        /// <param name="comment"></param>
        /// <param name="posTransaction"></param>
        /// <param name="cardInfo"></param>
        /// <param name="gcTenderInfo"></param>
        public void AuthorizeGiftCardPayment(ref bool valid, ref string comment, IPosTransaction posTransaction, ICardInfo cardInfo, ITender gcTenderInfo)
        {
            if (cardInfo == null)
            {
                throw new ArgumentNullException("cardInfo");
            }

            LogMessage("Authorizing a gift card payment", LogTraceLevel.Trace);

            valid = false;

            GiftCardController controller = new GiftCardController(GiftCardController.ContextType.GiftCardPayment, (PosTransaction)posTransaction, (Tender)gcTenderInfo);

            controller.CardNumber = cardInfo.CardNumber;
            using (GiftCardForm giftCardForm = new GiftCardForm(controller))
            {
                POSFormsManager.ShowPOSForm(giftCardForm);

                if (giftCardForm.DialogResult == DialogResult.OK)
                {
                    valid = true;
                    cardInfo.CardNumber   = controller.CardNumber;
                    cardInfo.Amount       = controller.Amount;
                    cardInfo.CurrencyCode = controller.Currency;
                }
            }
        }
Example #3
0
        private bool UserHasAccessRights(PosisOperations OperationID)
        {
            bool userHasAccess = false;

            if (logonMode == LogonModes.UserList)
            {
                operatorId = grvUserData.GetDataRow(grvUserData.GetSelectedRows()[0])["STAFFID"].ToString();

                if (!PosApplication.Instance.BusinessLogic.UserAccessSystem.UserHasAccess(operatorId, OperationID))
                {
                    using (frmMessage dialog = new frmMessage(1322)) // Unauthorized
                    {
                        POSFormsManager.ShowPOSForm(dialog);
                    }
                }
                else
                {
                    using (frmInputNumpad frmNumPad = new frmInputNumpad())
                    {
                        frmNumPad.EntryTypes = NumpadEntryTypes.Password;
                        frmNumPad.PromptText = ApplicationLocalizer.Language.Translate(2379); //"Password";

                        do
                        {
                            POSFormsManager.ShowPOSForm(frmNumPad);
                            if (frmNumPad.DialogResult == DialogResult.OK)
                            {
                                LogonData logonData = new LogonData(PosApplication.Instance.Settings.Database.Connection, PosApplication.Instance.Settings.Database.DataAreaID);
                                password      = frmNumPad.InputText;
                                userHasAccess = logonData.ValidatePasswordHash(ApplicationSettings.Terminal.StoreId, operatorId, LogonData.ComputePasswordHash(operatorId, password, ApplicationSettings.Terminal.StaffPasswordHashName));

                                if (!userHasAccess)
                                {
                                    using (frmMessage errorMessage = new frmMessage(1325))
                                    {
                                        POSFormsManager.ShowPOSForm(errorMessage);                                         // Invalid password
                                    }

                                    frmNumPad.TryAgain();
                                }
                            }
                            else
                            {
                                break;
                            }
                        }while (!userHasAccess);
                    }
                }
            }
            else
            {
                using (ManagerAccessForm frmManager = new ManagerAccessForm(OperationID))
                {
                    POSFormsManager.ShowPOSForm(frmManager);
                    userHasAccess = DialogResult.OK == frmManager.DialogResult;
                }
            }

            return(userHasAccess);
        }
Example #4
0
        /// <summary>
        /// Shows purchase order list.
        /// </summary>
        public void ShowPurchaseOrderList()
        {
            DialogResult   result = DialogResult.Cancel;
            string         selectedReceiptNumber = string.Empty;
            string         selectedPONumber      = string.Empty;
            PRCountingType prType;

            if (ApplicationSettings.Terminal.TerminalOperator.UserIsInventoryUser)
            {
                using (frmPurchaseOrderReceiptSearch dialog = new frmPurchaseOrderReceiptSearch())
                {
                    dialog.RepeatCalled = this.repeatCall;
                    this.Application.ApplicationFramework.POSShowForm(dialog);
                    result = dialog.DialogResult;
                    selectedReceiptNumber = dialog.SelectedReceiptNumber;
                    selectedPONumber      = dialog.SelectedPONumber;
                    prType = dialog.SelectedPRType;
                }

                if (result == DialogResult.OK && !string.IsNullOrEmpty(selectedReceiptNumber) && !string.IsNullOrEmpty(selectedPONumber))
                {
                    ReceivePurchaseOrder(selectedPONumber, selectedReceiptNumber, prType);
                }
            }
            else
            {
                POSFormsManager.ShowPOSMessageDialog(3540);             // Not allowed.
            }
        }
Example #5
0
        private void OnTotalButtonClicked(int rowHandle)
        {
            using (frmInputNumpad inputDialog = new frmInputNumpad())
            {
                inputDialog.EntryTypes = NumpadEntryTypes.Price;
                inputDialog.PromptText = LSRetailPosis.ApplicationLocalizer.Language.Translate(1443); // "Enter amount"

                decimal total;
                POSFormsManager.ShowPOSForm(inputDialog);
                if (inputDialog.DialogResult != DialogResult.Cancel)
                {
                    if (decimal.TryParse(inputDialog.InputText, out total))
                    {
                        // Update the row source and repaint
                        this.GridSource[rowHandle].Total = total;
                        this.gvDenom.RefreshRow(rowHandle);

                        UpdateTotal();
                    }
                    else
                    {
                        using (frmMessage dialog = new frmMessage(LSRetailPosis.ApplicationLocalizer.Language.Translate(1949),
                                                                  MessageBoxButtons.OK, MessageBoxIcon.Warning))
                        {
                            POSFormsManager.ShowPOSForm(dialog);
                        }
                    }
                }
            }
        }
Example #6
0
        private void RemoveSlipPaper()
        {
            bool tryAgain;

            NetTracer.Information("Peripheral [Printer] - Remove slip paper");

            do
            {
                tryAgain = false;
                NewStatusWindow(100);
                oposPrinter.BeginRemoval(LSRetailPosis.Settings.HardwareProfiles.Printer.DocInsertRemovalTimeout * 1000);

                if (oposPrinter.ResultCode == (int)OPOS_Constants.OPOS_SUCCESS)
                {
                    oposPrinter.EndRemoval();
                }
                else if (oposPrinter.ResultCode == (int)OPOS_Constants.OPOS_E_TIMEOUT)
                {
                    CloseExistingMessageWindow();
                    using (frmMessage errDialog = new frmMessage(13052, MessageBoxButtons.OKCancel, MessageBoxIcon.Information))
                    {
                        POSFormsManager.ShowPOSForm(errDialog);
                        if (errDialog.DialogResult == DialogResult.OK)
                        {
                            tryAgain = true;
                        }
                    }
                }
            } while (tryAgain);
        }
Example #7
0
        private void ShowStockCountHeaders()
        {
            DialogResult result            = DialogResult.Cancel;
            string       selectedJournalId = null;
            string       selectedRecId     = null;

            if (ApplicationSettings.Terminal.TerminalOperator.UserIsInventoryUser)
            {
                using (frmStockCountJournals dialog = new frmStockCountJournals())
                {
                    dialog.RepeatCall = repeatCall;
                    this.Application.ApplicationFramework.POSShowForm(dialog);
                    result            = dialog.DialogResult;
                    selectedJournalId = dialog.SelectedJournalId;
                    selectedRecId     = dialog.SelectedRecordId;
                }

                if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(selectedJournalId) && !string.IsNullOrWhiteSpace(selectedRecId))
                {
                    ShowStockCountLines(selectedJournalId, selectedRecId);
                }
            }
            else
            {
                POSFormsManager.ShowPOSMessageDialog(3540);             // Not allowed.
            }
        }
        private void AssignOperator()
        {
            using (ExtendedLogOnScanForm scanForm = new ExtendedLogOnScanForm())
            {
                POSFormsManager.ShowPOSForm(scanForm);

                if (scanForm.DialogResult == DialogResult.OK)
                {
                    try
                    {
                        viewModel.ExecuteAssign(scanForm.ExtendedLogOnInfo);
                    }
                    catch (PosisException pex)
                    {
                        NetTracer.Error(pex, "ExtendedLogOnForm::AssignOperator: Failed.");

                        POSFormsManager.ShowPOSMessageDialog(pex.ErrorMessageNumber);
                    }
                    catch (Exception ex)
                    {
                        NetTracer.Error(ex, "ExtendedLogOnForm::AssignOperator: Failed.");

                        POSFormsManager.ShowPOSMessageDialog(99412); // Generic failure.
                    }
                }
            }
        }
        private void OnQtyButtonClicked(int rowHandle)
        {
            LineItemViewModel lineItem = this.ViewModel.Items[rowHandle];

            // If it is not for pickup at the current store, the button should be disabled and thus no form should be shown.
            // If there's no remaining items to pick up, the button should be disable
            if (!lineItem.IsPickupAtStore(ApplicationSettings.Terminal.StoreId) || lineItem.QuantityRemaining == 0)
            {
                return;
            }

            using (frmInputNumpad inputDialog = new frmInputNumpad())
            {
                inputDialog.EntryTypes = NumpadEntryTypes.IntegerPositive;
                inputDialog.PromptText = LSRetailPosis.ApplicationLocalizer.Language.Translate(56396); // "Pickup quantity"
                inputDialog.Text       = LSRetailPosis.ApplicationLocalizer.Language.Translate(99656); // Item details page
                int qty;
                POSFormsManager.ShowPOSForm(inputDialog);
                if (inputDialog.DialogResult != DialogResult.Cancel)
                {
                    if (int.TryParse(inputDialog.InputText, out qty))
                    {
                        // Update the row source and repaint
                        if (qty <= lineItem.QuantityRemaining)
                        {
                            this.ViewModel.SetPickupQuantity(lineItem.ItemId, lineItem.LineId, qty);
                            this.ViewModel.CommitChanges();
                            this.gridView.RefreshRow(rowHandle);
                        }
                    }
                }
            }
        }
Example #10
0
        /// <summary>
        /// Searches the specified search term.
        /// </summary>
        /// <param name="searchType">Startup type of the search.</param>
        /// <param name="searchTerm">The search term.</param>
        /// <param name="showUIForEmptyResult">if set to <c>true</c> then show UI even when result is empty.</param>
        /// <returns>
        /// Selected result if found, null otherwise.
        /// </returns>
        public ISearchResult Search(SearchType searchType, string searchTerm, bool showUIForEmptyResult)
        {
            SearchResult    result    = null;
            SearchViewModel viewModel = new SearchViewModel(searchType, searchTerm);

            viewModel.ExecuteSearch();

            // We will not show the UI for emtpy result if not requested.
            if (showUIForEmptyResult ||
                viewModel.Results.Count > 0 ||
                viewModel.SearchTerms.Length < viewModel.MinimumSearchTermLengh)
            {
                result = new SearchResult();

                using (frmSmartSearch searchForm = new frmSmartSearch(viewModel))
                {
                    POSFormsManager.ShowPOSForm(searchForm);

                    if (searchForm.DialogResult == DialogResult.OK)
                    {
                        result.SearchType = (SearchResultType)viewModel.SelectedResult.SearchType;
                        result.Number     = viewModel.SelectedResult.Number;
                    }
                }
            }

            return(result);
        }
Example #11
0
        /// <summary>
        /// Gets the card information and amount for the specific card.
        /// </summary>
        /// <param name="cardInfo">Card information</param>
        /// <returns>True if the system should continue with the authorization process and false otherwise.</returns>
        public bool GetCardInfoAndAmount(ref ICardInfo cardInfo)
        {
            // Show UI. Input Card number, Amount, etc.

            //cardInfo.CardType = CardTypes.InternationalCreditCard;
            //cardInfo.CardNumber = "1234-5678-9012-3456";
            //cardInfo.ExpDate = "05/10";
            //cardInfo.CardReady = true;

            //return cardInfo.CardReady;

            // We have access to all information from the EFT section of the current Hardware Profile
            //      For instance, set "IsTestMode" based on the TestMode checkbox.  Can also get things
            //      like the provider Server Name, UserID, Password, etc.
            cardInfo.IsTestMode = LSRetailPosis.Settings.HardwareProfiles.EFT.TestMode == 1 ? true : false;

            //Other useful settings are in LSRetailPosis.Settings.ApplicationSettings.Terminal.  Examples:
            // LSRetailPosis.Settings.ApplicationSettings.Terminal.StoreCurrency
            // LSRetailPosis.Settings.ApplicationSettings.Terminal.TerminalOperator.OperatorId

            // If the card info is already known from a magnetic swipe, we only need to get the Amount from the window
            bool getAmountOnly = (cardInfo.CardEntryType == CardEntryTypes.MAGNETIC_STRIPE_READ);

            // Need to gather information needed to process the payment.  This can be done interactively with a window
            //      or by interacting with another device (pinpad, signature capture, etc.).  Note that if a card is swiped
            //      from the main window, and OPOS event will be fired which will call this method.

            if (cardInfo.CardType == CardTypes.InternationalDebitCard)
            {
                // We know that the card was swiped and matched a Debit Card
                // TODO:  Use the frmCard as a basis for a Debit Card window
            }
            else
            {
                // We either know the card was swiped and matched a Credit Card or the Card Payment
                //      button was pressed and we need to manually type in a card number.
                using (frmCard cardDialog = new frmCard(cardInfo, getAmountOnly))
                {
                    POSFormsManager.ShowPOSForm(cardDialog);  // Display the window
                    if (getAmountOnly)
                    {
                        //We only want to grab the amount from the window since all other card information was read from the swipe
                        cardInfo.Amount = cardDialog.amountPaid;
                    }
                    else
                    {
                        //Otherwise, we we want to set the cardInfo object to the local version from the window
                        cardInfo = cardDialog.CardInfo;
                    }
                    cardInfo.CardReady = cardDialog.everythingValid; // Pull the valid flag from the window
                    sEFTApprovalCode   = cardDialog.sApprovalCode;
                    sCExpMonth         = cardDialog.sCardExpMonth;
                    sCExpYear          = cardDialog.sCardExpYear;
                }
            }

            // Need to return a true or false for whether everything validated and we can proceed.  CardReady
            //  property has this information so return that.
            return(cardInfo.CardReady);
        }
Example #12
0
        private void LogonSuccessful()
        {
            try
            {
                //Set the status for the Main form to know what's going on
                status = LogOnStatus.LogOn;

                PosApplication.Instance.BusinessLogic.LogonLogoffSystem.ConcludeSuccessfulLogOn();

                lblUser.Text          = string.Empty;
                operatorId            = string.Empty;
                password              = string.Empty;
                operatorName          = string.Empty;
                operatorNameOnReceipt = string.Empty;

                dlgResult = DialogResult.OK;

                this.Close();
            }
            catch (Exception ex)
            {
                using (frmError errorForm = new LSRetailPosis.POSProcesses.frmError(ex.Message, ex))
                {
                    POSFormsManager.ShowPOSForm(errorForm);
                }
            }
        }
Example #13
0
        /// <summary>
        /// Receive purchase order.
        /// </summary>
        /// <param name="poNumber"></param>
        /// <param name="receiptNumber"></param>
        public void ReceivePurchaseOrder(string poNumber, string receiptNumber, PRCountingType prType)
        {
            if (!ApplicationSettings.Terminal.TerminalOperator.UserIsInventoryUser)
            {
                POSFormsManager.ShowPOSMessageDialog(3540);             // Not allowed.
            }
            else
            {
                DialogResult result = DialogResult.Cancel;

                using (frmPurchaseOrderReceiving dialog = new frmPurchaseOrderReceiving())
                {
                    dialog.ReceiptNumber = receiptNumber;
                    dialog.PONumber      = poNumber;
                    dialog.PRType        = prType;
                    this.Application.ApplicationFramework.POSShowForm(dialog);
                    result = dialog.DialogResult;
                }

                if (result == DialogResult.OK)
                {
                    this.repeatCall = true;
                    ShowPurchaseOrderList();
                }
            }
        }
Example #14
0
 /// <summary>
 /// Displays message as per given message id.
 /// </summary>
 /// <param name="message"></param>
 /// <param name="msgBoxButtons"></param>
 /// <param name="msgBoxIcon"></param>
 /// <returns></returns>
 public DialogResult ShowMessage(string message, MessageBoxButtons msgBoxButtons, MessageBoxIcon msgBoxIcon)
 {
     using (frmMessage dialog = new frmMessage(message, msgBoxButtons, msgBoxIcon))
     {
         POSFormsManager.ShowPOSForm(dialog);
         return(dialog.DialogResult);
     }
 }
Example #15
0
 /// <summary>
 /// Displays message as per given message id.
 /// </summary>
 /// <param name="messageId"></param>
 /// <param name="msgBoxButtons"></param>
 /// <returns></returns>
 public DialogResult ShowMessage(int messageId, MessageBoxButtons msgBoxButtons)
 {
     using (frmMessage dialog = new frmMessage(messageId, msgBoxButtons))
     {
         POSFormsManager.ShowPOSForm(dialog);
         return(dialog.DialogResult);
     }
 }
Example #16
0
        public void AddToGiftCard(IRetailTransaction retailTransaction, ITender gcTenderInfo)
        {
            //Start: added on 16/07/2014 for customer selection is must
            RetailTransaction retailTrans = retailTransaction as RetailTransaction;

            if (retailTrans != null)
            {
                if (Convert.ToString(retailTrans.Customer.CustomerId) == string.Empty || string.IsNullOrEmpty(retailTrans.Customer.CustomerId))
                {
                    using (LSRetailPosis.POSProcesses.frmMessage dialog = new LSRetailPosis.POSProcesses.frmMessage("Add a customer to transaction before making a deposit", MessageBoxButtons.OK, MessageBoxIcon.Error))
                    {
                        LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog);
                    }
                    return;
                }
            }
            //End: added on 16/07/2014 for customer selection is must

            LogMessage("Adding money to gift card.",
                       LSRetailPosis.LogTraceLevel.Trace,
                       "GiftCard.AddToGiftCard");

            GiftCardController controller = new GiftCardController(GiftCardController.ContextType.GiftCardAddTo, (PosTransaction)retailTransaction, (Tender)gcTenderInfo);

            using (GiftCardForm giftCardForm = new GiftCardForm(controller))
            {
                POSFormsManager.ShowPOSForm(giftCardForm);

                if (giftCardForm.DialogResult == DialogResult.OK)
                {
                    // Add the gift card to the transaction.
                    GiftCertificateItem giftCardItem = (GiftCertificateItem)this.Application.BusinessLogic.Utility.CreateGiftCardLineItem(
                        ApplicationSettings.Terminal.StoreCurrency, this.Application.Services.Rounding, retailTransaction);

                    giftCardItem.SerialNumber  = controller.CardNumber;
                    giftCardItem.StoreId       = retailTransaction.StoreId;
                    giftCardItem.TerminalId    = retailTransaction.TerminalId;
                    giftCardItem.StaffId       = retailTransaction.OperatorId;
                    giftCardItem.TransactionId = retailTransaction.TransactionId;
                    giftCardItem.ReceiptId     = retailTransaction.ReceiptId;
                    giftCardItem.Amount        = controller.Amount;
                    giftCardItem.Balance       = controller.Balance;
                    giftCardItem.Date          = DateTime.Now;
                    giftCardItem.AddTo         = true;

                    giftCardItem.Price = giftCardItem.Amount;
                    giftCardItem.StandardRetailPrice = giftCardItem.Amount;
                    giftCardItem.Quantity            = 1;
                    giftCardItem.TaxRatePct          = 0;
                    giftCardItem.Description         = ApplicationLocalizer.Language.Translate(55000); // Add to Gift Card
                    giftCardItem.Comment             = controller.CardNumber;
                    giftCardItem.NoDiscountAllowed   = true;
                    giftCardItem.Found = true;

                    ((RetailTransaction)retailTransaction).Add(giftCardItem);
                }
            }
        }
        private bool GetItemInfo(string barcode, bool skipDimensionDialog)
        {
            if (string.IsNullOrEmpty(barcode))
            {
                return(false);
            }

            this.saleLineItem = (SaleLineItem)PurchaseOrderReceiving.InternalApplication.BusinessLogic.Utility.CreateSaleLineItem(
                ApplicationSettings.Terminal.StoreCurrency,
                PurchaseOrderReceiving.InternalApplication.Services.Rounding,
                posTransaction);

            IScanInfo scanInfo = PurchaseOrderReceiving.InternalApplication.BusinessLogic.Utility.CreateScanInfo();

            scanInfo.ScanDataLabel = barcode;
            scanInfo.EntryType     = BarcodeEntryType.ManuallyEntered;

            IBarcodeInfo barcodeInfo = PurchaseOrderReceiving.InternalApplication.Services.Barcode.ProcessBarcode(scanInfo);

            if ((barcodeInfo.InternalType == BarcodeInternalType.Item) && (barcodeInfo.ItemId != null))
            {
                // The entry was a barcode which was found and now we have the item id...
                this.saleLineItem.ItemId    = barcodeInfo.ItemId;
                this.saleLineItem.BarcodeId = barcodeInfo.BarcodeId;
                this.saleLineItem.SalesOrderUnitOfMeasure = barcodeInfo.UnitId;
                this.saleLineItem.EntryType           = barcodeInfo.EntryType;
                this.saleLineItem.Dimension.ColorId   = barcodeInfo.InventColorId;
                this.saleLineItem.Dimension.SizeId    = barcodeInfo.InventSizeId;
                this.saleLineItem.Dimension.StyleId   = barcodeInfo.InventStyleId;
                this.saleLineItem.Dimension.VariantId = barcodeInfo.VariantId;
            }
            else
            {
                // It could be an ItemId
                this.saleLineItem.ItemId    = barcodeInfo.BarcodeId;
                this.saleLineItem.EntryType = barcodeInfo.EntryType;
            }

            // fetch all the addtional item properties
            PurchaseOrderReceiving.InternalApplication.Services.Item.ProcessItem(saleLineItem, true);

            if (saleLineItem.Found == false)
            {
                POSFormsManager.ShowPOSMessageDialog(2611);             // Item not found.
                return(false);
            }
            else if ((saleLineItem.Dimension != null) &&
                     (saleLineItem.Dimension.EnterDimensions || !string.IsNullOrEmpty(saleLineItem.Dimension.VariantId)) &&
                     !skipDimensionDialog)
            {
                if (!barcodeInfo.Found)
                {
                    return(OpenItemDimensionsDialog(barcodeInfo));
                }
            }

            return(true);
        }
Example #18
0
        /// <summary>
        /// Returns message as per given message id as DialogResult.
        /// </summary>
        /// <param name="messageId"></param>
        /// <returns></returns>
        public DialogResult ShowMessage(int messageId)
        {
            using (frmMessage dialog = new frmMessage(messageId))
            {
                POSFormsManager.ShowPOSForm(dialog);

                return(dialog.DialogResult);
            }
        }
Example #19
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     if (entryTable.GetChanges() != null)
     {
         POSFormsManager.ShowPOSMessageDialog(103119);
         return;
     }
     this.DialogResult = DialogResult.OK;
 }
Example #20
0
        /// <summary>
        /// Executes sales invoice functionality.
        /// </summary>
        /// <param name="posTransaction"></param>
        public void SalesInvoices(IPosTransaction posTransaction)
        {
            // The sales invoice functionality is only allowed if a customer has already been added to the transaction
            if (string.IsNullOrEmpty(((RetailTransaction)posTransaction).Customer.Name))
            {
                POSFormsManager.ShowPOSMessageDialog(57000);
                return;
            }

            PaySalesInvoice(posTransaction);
        }
Example #21
0
        /// <summary>
        /// Handles Gift Card Balance operation.
        /// </summary>
        public void GiftCardBalance(IPosTransaction posTransaction)
        {
            LogMessage("Inquiring gift card balance.",
                       LSRetailPosis.LogTraceLevel.Trace,
                       "GiftCard.GiftCardBalance");

            GiftCardController controller = new GiftCardController(GiftCardController.ContextType.GiftCardBalance, (PosTransaction)posTransaction);

            using (GiftCardForm giftCardForm = new GiftCardForm(controller))
            {
                POSFormsManager.ShowPOSForm(giftCardForm);
            }
        }
Example #22
0
        static internal void DisplayInvalidSwipeMessage()
        {
            //  1112 = "Card swipe is not supported."
            //  This is not a great message and the developer should consider changing it.  It really means that "Card swipe is not supported _at this time_."
            //  The process flow is set up so that the card swipe should happen from the main POS form.  If the user entered the dialog from pressing the "pay card"
            //  button, we want them to manually enter the card so this message is fired if the swipe happens AFTER the window is open.
            using (frmMessage dialog = new frmMessage(1112, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information))
            {
                POSFormsManager.ShowPOSForm(dialog);
            }

            EFT.InternalApplication.Services.Peripherals.MSR.EnableForSwipe();
        }
        private bool ValidateData(EntryItem item, ISaleLineItem lineItem)
        {
            bool valid = true;

            // Check if the unit allows any decimals
            UnitOfMeasureData uomData = new UnitOfMeasureData(
                ApplicationSettings.Database.LocalConnection,
                ApplicationSettings.Database.DATAAREAID,
                ApplicationSettings.Terminal.StorePrimaryId,
                PurchaseOrderReceiving.InternalApplication);

            int unitDecimals = uomData.GetUnitDecimals(item.Unit);

            if ((unitDecimals == 0) && ((item.QuantityReceived - (int)item.QuantityReceived) != 0))
            {
                string msg = ApplicationLocalizer.Language.Translate(103157, (object)item.ItemNumber);

                using (frmMessage frm = new frmMessage(msg, MessageBoxButtons.OK, MessageBoxIcon.Warning))
                {
                    POSFormsManager.ShowPOSForm(frm);
                }
                valid = false;
            }

            if (this.prType == PRCountingType.TransferOut || this.prType == PRCountingType.PickingList)
            {
                decimal qtyReceived = item.QuantityReceived;
                if (!this.isEdit)
                {
                    DataRow row = this.GetRowByItemIdAndVariants(saleLineItem);
                    if (row != null)
                    {
                        qtyReceived += row.Field <decimal>(DataAccessConstants.QuantityReceivedNow);
                    }
                }

                if (qtyReceived + lineItem.QuantityPickedUp > lineItem.QuantityOrdered)
                {
                    using (frmMessage frm = new frmMessage(99521, MessageBoxButtons.OK, MessageBoxIcon.Warning))
                    {
                        POSFormsManager.ShowPOSForm(frm);
                    }
                    valid = false;
                }
            }

            return(valid);
        }
Example #24
0
 private static bool IsNumber(string str)
 {
     try
     {
         Convert.ToInt64(str);
         return(true);
     }
     catch (Exception)
     {
         using (frmMessage dialog = new frmMessage(50163, MessageBoxButtons.OK, MessageBoxIcon.Error))                 //Odometer can not have letters in it.
         {
             POSFormsManager.ShowPOSForm(dialog);
         }
     }
     return(false);
 }
Example #25
0
        private bool LoadNextSlipPaper(bool firstSlip)
        {
            bool result = true;
            bool tryAgain;

            NetTracer.Information("Peripheral [Printer] - Load next slip paper");

            if (!firstSlip)
            {
                RemoveSlipPaper();
            }

            do
            {
                tryAgain = false;
                NewStatusWindow(98);
                oposPrinter.BeginInsertion(LSRetailPosis.Settings.HardwareProfiles.Printer.DocInsertRemovalTimeout * 1000);

                if (oposPrinter.ResultCode == (int)OPOS_Constants.OPOS_SUCCESS)
                {
                    NewStatusWindow(99);
                    oposPrinter.EndInsertion();
                    linesLeftOnCurrentPage = totalNumberOfLines;
                    PrintArray(headerLines);
                }
                else
                {
                    CloseExistingMessageWindow();
                    using (frmMessage errDialog = new frmMessage(13051, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                    {
                        POSFormsManager.ShowPOSForm(errDialog);
                        if (errDialog.DialogResult == DialogResult.Yes)
                        {
                            tryAgain = true;
                        }
                        else
                        {
                            result = false;
                        }
                    }
                }
            } while (tryAgain);

            return(result);
        }
Example #26
0
        private void amtCustAmounts_AmountChanged(decimal outAmount, string currCode)
        {
            TenderRequirement tenderReq = new TenderRequirement(this.tenderInfo, outAmount, true, balanceAmount);

            if (string.IsNullOrEmpty(tenderReq.ErrorText))
            {
                controlIndex = 1;
                Action(outAmount.ToString());
            }
            else
            {
                using (frmMessage dialog = new frmMessage(tenderReq.ErrorText, MessageBoxButtons.OK, MessageBoxIcon.Stop))
                {
                    // The amount entered is higher than the maximum amount allowed
                    POSFormsManager.ShowPOSForm(dialog);
                }
            }
        }
Example #27
0
        /// <summary>
        /// Show blind closed shifts.
        /// </summary>
        /// <param name="transaction">The current transaction instance.</param>
        public void ShowBlindClosedShifts(IPosTransaction transaction)
        {
            if (transaction == null)
            {
                NetTracer.Warning("transaction parameter is null");
                throw new ArgumentNullException("transaction");
            }

            BatchData batchData          = new BatchData(Application.Settings.Database.Connection, Application.Settings.Database.DataAreaID);
            string    operatorId         = ApplicationSettings.Terminal.TerminalOperator.OperatorId;
            bool      multipleShiftLogOn = Application.BusinessLogic.UserAccessSystem.UserHasPermission(operatorId, AllowMultipleShiftLogOnPermission);
            IList <IPosBatchStaging> blindClosedShifts = batchData.GetPosBatchesWithStatus(PosBatchStatus.BlindClosed, multipleShiftLogOn ? null : operatorId);

            using (BlindClosedShiftsForm blindClosedShiftsForm = new BlindClosedShiftsForm(blindClosedShifts))
            {
                POSFormsManager.ShowPOSForm(blindClosedShiftsForm);
            }
        }
Example #28
0
        /// <summary>
        /// Prints to printer.
        /// </summary>
        /// <param name="printerMap">The printer map.</param>
        /// <param name="formMod">The form mod.</param>
        /// <param name="formType">Type of the form.</param>
        /// <param name="posTransaction">The pos transaction.</param>
        /// <param name="copyReceipt">if set to <c>true</c> [copy receipt].</param>
        /// <returns></returns>
        internal static bool PrintFormTransaction(
            PrinterAssociation printerMap,
            FormModulation formMod,
            FormType formType,
            IPosTransaction posTransaction,
            bool copyReceipt)
        {
            FormInfo formInfo = printerMap.PrinterFormInfo;
            bool     result   = false;

            // Checking for header only.
            if (formInfo.HeaderTemplate == null)
            {
                // Note: This is allowed now that we have multiple printers...
                result = false;
            }
            else if (PrintingActions.ShouldWePrint(formInfo, formType, copyReceipt, printerMap))
            {
                result = true;
                try
                {
                    formMod.GetTransformedTransaction(formInfo, (RetailTransaction)posTransaction);

                    if (formInfo.PrintAsSlip)
                    {
                        printerMap.Printer.PrintSlip(formInfo.Header, formInfo.Details, formInfo.Footer);
                    }
                    else
                    {
                        // Note: In this API Errors are handled in the printer and exceptions do not bubble up.
                        printerMap.Printer.PrintReceipt(formInfo.Header + formInfo.Details + formInfo.Footer);
                    }
                }
                catch (Exception ex)
                {
                    NetTracer.Warning("Printing [Printing] - Exception while printing receipt");

                    POSFormsManager.ShowPOSErrorDialog(new PosisException(1003, ex));
                    result = false;
                }
            }

            return(result);
        }
Example #29
0
        private void amountViewer1_AmountChanged(decimal outAmount, string currCode)
        {
            TenderRequirement tenderReq = new TenderRequirement(this.tenderInfo, outAmount, true, balanceAmount);

            if (string.IsNullOrEmpty(tenderReq.ErrorText))
            {
                registeredAmount  = outAmount;
                operationDone     = true;
                this.DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                using (frmMessage dialog = new frmMessage(tenderReq.ErrorText, MessageBoxButtons.OK, MessageBoxIcon.Stop)) //The amount entered is higher than the maximum amount allowed
                {
                    POSFormsManager.ShowPOSForm(dialog);
                }
            }
        }
Example #30
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            String keyboardInput = useSingleLine ? textKeyboardInput.Text : memoKeyboardInput.Text;

            if ((currentInputType == InputType.Email) && (!IsEmail(keyboardInput)))
            {
                this.DialogResult = DialogResult.None;
                using (frmMessage dialog = new frmMessage(ApplicationLocalizer.Language.Translate(1242), MessageBoxButtons.OK, MessageBoxIcon.Error))
                {
                    POSFormsManager.ShowPOSForm(dialog);
                }
            }
            else
            {
                this.DialogResult = DialogResult.OK;
                inputText         = keyboardInput;
                Close();
            }
        }