Beispiel #1
0
 public static IState Instance(IDoubleEnumerator ide)
 {
     ie = ide;
     try
     {
         if (ie.MoveNext())
         {
             ie.ShowCurrent(Target.Cashier);
         }
         else
         {
             throw new ListingException();
         }
         ShowList();
     }
     catch (ListingException)
     {
         throw new Exception(PosMessage.LIST_EMPTY);
     }
     catch (Exception ex)
     {
         cr.Log.Error("Exception occured. {0}", ex.Message);
         throw new ListingException();
     }
     return(state);
 }
Beispiel #2
0
        //Instance method has 2 parameters
        //1. Enumerator for a list of items to be displayed. Each item implements
        //IMenuItem interface, which means that it knows howto display itself
        //2. Delegate for the method which will be called on the selected item
        //when the user presses enter key
        public static new IState Instance(IDoubleEnumerator ide, ProcessSelectedItem psi)
        {
#if WindowsCE
            return(List.Instance(ide, psi));
#else
            ListForm.SetList(ide);
            ProcessSelected = psi;
            List.Instance(ide);
            return(state);
#endif
        }
Beispiel #3
0
        //PSI not supplied in below function - designed to be called from inherited classes such
        //as SetupMenu where returnCancel may be CashRegisterLoadError instance

        //protected static IState Instance(IDoubleEnumerator ide, StateInstance returnCancel)
        //{
        //    ReturnCancel = returnCancel;
        //    return Instance(ide);
        //}

        public override void Escape()
        {
            if (ie.Current is FiscalItem && cr.Item.TotalAmount > 0)
            {
                return;
            }
            ie = null;
            if (ReturnCancel == null)
            {
                cr.State = Start.Instance();
            }
            else
            {
                cr.State = ReturnCancel();
            }
            ReturnCancel = null;
        }
Beispiel #4
0
 public static new IState Instance(IDoubleEnumerator ide)
 {
     Instance(ide, new ProcessSelectedItem(cr.Execute));
     return(state);
 }
Beispiel #5
0
 public static IState Instance(IDoubleEnumerator ide, ProcessSelectedItem psi, StateInstance returnCancel)
 {
     ProcessSelected = psi;
     ReturnCancel    = returnCancel;
     return(Instance(ide));
 }
Beispiel #6
0
 //Instance method has 2 parameters
 //1. Enumerator for a list of items to be displayed. Each item implements
 //IMenuItem interface, which means that it knows howto display itself
 //2. Delegate for the method which will be called on the selected item
 //when the user presses enter key
 public static IState Instance(IDoubleEnumerator ide, ProcessSelectedItem psi)
 {
     ProcessSelected = psi;
     return(Instance(ide));
 }
Beispiel #7
0
 public static IState Instance(IDoubleEnumerator ide, ProcessSelectedItem <MenuLabel> psi, StateInstance returnCancel)
 {
     ReturnCancel = returnCancel;
     return(Instance(ide, psi));
 }
Beispiel #8
0
 public static IState Instance(IDoubleEnumerator ide, ProcessSelectedItem <MenuLabel> psi)
 {
     ProcessSelected = psi;
     List.Instance(ide);
     return(state);
 }