Ejemplo n.º 1
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);
                        }
                    }
                }
            }
        }
Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        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);
                        }
                    }
                }
            }
        }
        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.
                    }
                }
            }
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
                }
            }
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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);
        }
Ejemplo n.º 10
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);
     }
 }
Ejemplo n.º 11
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);
     }
 }
Ejemplo n.º 12
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);
                }
            }
        }
Ejemplo n.º 13
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);
            }
        }
Ejemplo n.º 14
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();
        }
Ejemplo n.º 15
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);
            }
        }
        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);
        }
Ejemplo n.º 17
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);
 }
Ejemplo n.º 18
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);
        }
Ejemplo n.º 19
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);
            }
        }
Ejemplo n.º 20
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);
                }
            }
        }
Ejemplo n.º 21
0
        private void numPad1_EnterButtonPressed()
        {
            TenderRequirement tenderReq = new TenderRequirement(this.tenderInfo, numPad1.EnteredDecimalValue, true, balanceAmount);

            if (string.IsNullOrEmpty(tenderReq.ErrorText))
            {
                controlIndex = 1;
                Action(numPad1.EnteredValue);
            }
            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);
                    numPad1.TryAgain();
                }
            }
        }
Ejemplo n.º 22
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);
                }
            }
        }
Ejemplo n.º 23
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();
            }
        }
Ejemplo n.º 24
0
        private void ValidateAmount(decimal amount)
        {
            TenderRequirement tenderReq = new TenderRequirement(this.tenderInfo,
                                                                PosApplication.Instance.Services.Rounding.Round(amount), true, viewModel.Balance);

            if (string.IsNullOrEmpty(tenderReq.ErrorText))
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.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);
                }

                numCurrNumpad.TryAgain();
            }
        }
Ejemplo n.º 25
0
        private void numPad1_EnterButtonPressed()
        {
            TenderRequirement tenderReq = new TenderRequirement(this.tenderInfo, numCashNumpad.EnteredDecimalValue, true, balanceAmount);

            if (string.IsNullOrEmpty(tenderReq.ErrorText))
            {
                registeredAmount  = numCashNumpad.EnteredDecimalValue;
                registeredAmount  = PosApplication.Instance.Services.Rounding.RoundAmount(registeredAmount, ApplicationSettings.Terminal.StoreId, tenderInfo.TenderID.ToString());
                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);
                }
                numCashNumpad.TryAgain();
            }
        }
        private bool ValidateItemIdAndVariantsForPicking(ISaleLineItem lineItem)
        {
            bool isValid = true;

            if (this.prType == PRCountingType.TransferOut || this.prType == PRCountingType.PickingList)
            {
                DataRow row = this.GetRowByItemIdAndVariants(lineItem);

                isValid = (row != null);

                if (!isValid)
                {
                    using (frmMessage frm = new frmMessage(99523, MessageBoxButtons.OK, MessageBoxIcon.Warning))
                    {
                        POSFormsManager.ShowPOSForm(frm);
                    }
                }
            }

            return(isValid);
        }
Ejemplo n.º 27
0
        internal static ICustomerOrderTransaction ShowOrderDetailsOptions(ICustomerOrderTransaction transaction)
        {
            using (formOrderDetailsSelection frm = new formOrderDetailsSelection())
            {
                ICustomerOrderTransaction result = transaction;
                POSFormsManager.ShowPOSForm(frm);
                if (frm.DialogResult == DialogResult.OK)
                {
                    // when in cancel mode, we only allow to enter view details, cancel or close order modes.
                    bool allowedOnCancelMode     = IsSelectionAllowedOnCancelOrderMode(frm.Selection);
                    CustomerOrderTransaction cot = transaction as CustomerOrderTransaction;

                    if (cot != null && cot.Mode == CustomerOrderMode.Cancel && !allowedOnCancelMode)
                    {
                        SalesOrder.InternalApplication.Services.Dialog.ShowMessage(4543);
                        return(result);
                    }

                    switch (frm.Selection)
                    {
                    case OrderDetailsSelection.ViewDetails:
                        SalesOrderActions.ShowOrderDetails(transaction, frm.Selection);
                        break;

                    case OrderDetailsSelection.CloseOrder:
                        CloseOrder(transaction);
                        break;

                    case OrderDetailsSelection.Recalculate:
                        RecalculatePrices(transaction);
                        break;

                    default:
                        break;
                    }
                }

                return(result);
            }
        }
Ejemplo n.º 28
0
        private void OnQtyButtonClick(int rowHandle)
        {
            if (!gridSource[rowHandle].Enabled)
            {
                return;
            }

            // Determine the tender type
            PosisOperations operationTenderType = gridSource[rowHandle].TenderOperationType;

            // Open the denominations form for currencies
            if (operationTenderType == PosisOperations.PayCash || operationTenderType == PosisOperations.PayCurrency)
            {
                using (frmDenominations frmDenom = new frmDenominations(gridSource[rowHandle].Currency,
                                                                        (denominationDataSources.ContainsKey(rowHandle) ? denominationDataSources[rowHandle] : null)))
                {
                    POSFormsManager.ShowPOSForm(frmDenom);
                    if (frmDenom.DialogResult == DialogResult.OK)
                    {
                        gridSource[rowHandle].Total             = frmDenom.Total;
                        this.denominationDataSources[rowHandle] = frmDenom.GridSource;
                        UpdateTotalAmount();
                    }
                }
            }
            else
            {
                // Launch the system calculator
                try
                {
                    System.Diagnostics.Process.Start("calc.exe");
                }
                catch (System.ComponentModel.Win32Exception)
                {
                }
                catch (System.IO.FileNotFoundException)
                {
                }
            }
        }
Ejemplo n.º 29
0
        internal static void ShowOrderDetails(ICustomerOrderTransaction transaction, OrderDetailsSelection selectionMode)
        {
            CustomerOrderTransaction cot = (CustomerOrderTransaction)transaction;

            using (formOrderDetails frm = new formOrderDetails(cot, selectionMode))
            {
                POSFormsManager.ShowPOSForm(frm);
                DialogResult result = frm.DialogResult;

                // Get updated transaction since nested operations might have been run
                transaction = frm.Transaction;

                if (result == DialogResult.OK)
                {
                    // Update the editing mode of the order.
                    UpdateCustomerOrderMode(cot, selectionMode);

                    // Refresh prices/totals
                    SalesOrder.InternalApplication.BusinessLogic.ItemSystem.CalculatePriceTaxDiscount(transaction);

                    // call CalcTotal to roll up misc charge taxes
                    transaction.CalcTotals();

                    // Reminder prompt for Deposit Override w/ Zero deposit applied
                    if (selectionMode == OrderDetailsSelection.PickupOrder &&
                        cot.PrepaymentAmountOverridden &&
                        cot.PrepaymentAmountApplied == decimal.Zero)
                    {
                        SalesOrder.InternalApplication.Services.Dialog.ShowMessage(56139, MessageBoxButtons.OK, MessageBoxIcon.Information);    //"No deposit has been applied to this pickup. To apply a deposit, use the ""Deposit override"" operation."
                    }
                }
                else
                {
                    // Set cancel on the transaction so the original is not updated
                    transaction.OperationCancelled = true;
                }
            }
        }
Ejemplo n.º 30
0
        private void OnQtyButtonClicked(int rowHandle)
        {
            using (frmInputNumpad inputDialog = new frmInputNumpad())
            {
                inputDialog.EntryTypes = NumpadEntryTypes.IntegerPositive;
                inputDialog.PromptText = LSRetailPosis.ApplicationLocalizer.Language.Translate(1944); // "Number of counted units"

                int qty;
                POSFormsManager.ShowPOSForm(inputDialog);

                if (inputDialog.DialogResult != DialogResult.Cancel)
                {
                    if (int.TryParse(inputDialog.InputText, out qty))
                    {
                        // Update the row source and repaint
                        this.GridSource[rowHandle].Quantity = qty;
                        this.gvDenom.RefreshRow(rowHandle);

                        UpdateTotal();
                    }
                }
            }
        }