Exemplo n.º 1
0
 public void Update(ItemVoid pEvent)
 {
     prompt = PosContext.Instance.PosPrompt;
     if (prompt != null)
     {
         prompt.PromptText = pEvent.PromptText;
         if (pEvent.States().PeekState() == ItemVoid.GET_LINE_NUMBER)
         {
             prompt.InputText = PosContext.Instance.Receipt.OperDisplay.GetCurrentLineNo.ToString();              // PosContext.Instance.CurrentEjItem.LineNo.ToString();
             PosContext.Instance.InputLine = PosContext.Instance.Receipt.OperDisplay.GetCurrentLineNo.ToString(); //PosContext.Instance.CurrentEjItem.LineNo.ToString();
             prompt.StartInputAnimation();
         }
     }
 }
Exemplo n.º 2
0
        public void Update(EjItem ejItem)
        {
            int state = ejItem.States().PeekState();

            StringBuilder strDisplay = new StringBuilder(prompt.MessageWidth);

            //  for (int i = 0; i < prompt.MessageWidth; i++)
            //  {
            //      strDisplay.Append(" ");
            //  }


            switch (state)
            {
            case (int)EjItemStates.ENTER_QTY:
                //  strDisplay.Append("Item : ");
                strDisplay.Append(ejItem.Item.Short_Desc + "  ");
                prompt.MessageText = strDisplay.ToString();     //ejItem.Item.Short_Desc +"   "+ " ? " + ejItem.Item.Shipping_uom + " ? $";
                break;

            case (int)EjItemStates.ENTER_AMOUNT:
                strDisplay.Append(ejItem.Item.Short_Desc + "    ");
                strDisplay.Append(string.Format("{0:###########0.00}", ejItem.Quantity) + " " + ejItem.Item.Shipping_uom);
                prompt.MessageText = strDisplay.ToString();      //ejItem.Item.Short_Desc + "   " + string.Format("{0:###########0.00}", ejItem.Quantity) +ejItem.Item.Shipping_uom + " X " + "    ?$";
                break;

            case (int)EjItemStates.ITEM_FINAL:
                prompt.MessageText = "";      //ejItem.Item.Short_Desc + "    " + ejItem.Quantity.ToString() + string.Format("{0:###########0.00}", ejItem.Amount);
                prompt.EndInputAnimation();
                break;
defaut:
                prompt.MessageText = "";
                break;
            }


            if (state != (int)EjItemStates.ITEM_FINAL)
            {
                if (prompt != null)
                {
                    this.prompt.PromptText = ejItem.PromptText;
                    // this.posDisplay.MessageText = "";
                    prompt.InputText = "";
                    prompt.StartInputAnimation();
                }
                return;
            }



            prompt.PromptText = ejItem.PromptText;
            prompt.InputText  = "";
            //	posDisplay.MessageText = ejItem.Quantity.ToString()+ " * " +
            //		ejItem.Desc +"    "+ string.Format( "{0:###########0.00}", ejItem.Amount);

            if (PosHardware.Instance.LineDisplay != null)
            {
                PosHardware.Instance.LineDisplay.Clear();
                PosHardware.Instance.LineDisplay.SetText(ejItem.Desc, 0, 0);
                //Item price
                string itemPrice = string.Format("{0:#########0.00}", ejItem.Amount);
                int    col       = PosHardware.Instance.LineDisplay.PromptWidth() - itemPrice.Length - 1;
                PosHardware.Instance.LineDisplay.SetText(itemPrice, 1, col);
                //Total
                string total = string.Format("{0:<#########0.00>}", PosContext.Instance.CurrentEj.EjSubTotal());;
                PosHardware.Instance.LineDisplay.SetText(total, 1, 0);
            }
        }