Exemple #1
0
        public void initFloorPlan()
        {
            try
            {
                bckImgTimer       = Helper.createTimer(bckImgRefreshTime);
                bckImgTimer.Tick += new EventHandler(bckImgTimer_Tick);
                //bckImgTimer.Stop();

                tableNameChangeTimer       = Helper.createTimer(tableNameChangeRefreshTime);
                tableNameChangeTimer.Tick += new EventHandler(tableNameChangeTimer_Tick);
                //tableNameChangeTimer.Stop();

                canvas = createCanvas();
                this.panelWorkshop.Controls.Add(canvas);

                //...........................

                editingFloorPlan = EditingFloorPlan.Instance;

                initGUI(editingFloorPlan.locations, 0);
            }
            catch (PosIntegrationException exc)
            {
                initGUI(null, 0);
                MessageBox.Show(exc.Message);
            }
        }
Exemple #2
0
        public static void reArrangeTableNumbers()
        {
            EditingFloorPlan editingFP = EditingFloorPlan.Instance;

            DTOReservable[] tablesInLocation = editingFP.tablesInLocation;

            for (int i = 0; i < tablesInLocation.Length; i++)
            {
                tablesInLocation[i].Number = i + 1;
            }

            editingFP.signalTablesChanged();
        }
Exemple #3
0
        public static bool checkForDuplicateTableNumber(int inTableNumber)
        {
            bool result = true;

            EditingFloorPlan editingFP = EditingFloorPlan.Instance;

            DTOReservable[] tablesInLocation = editingFP.tablesInLocation;

            foreach (DTOReservable table in tablesInLocation)
            {
                if (table.Number == inTableNumber)
                {
                    result = false; // Table Number already exists
                    break;
                }
            }

            return(result);
        }
Exemple #4
0
        public static int nextTableNumber()
        {
            EditingFloorPlan editingFP = EditingFloorPlan.Instance;

            DTOReservable[] tablesInLocation = editingFP.tablesInLocation;

            int max = 0;

            if (tablesInLocation.Length > 0)
            {
                max = tablesInLocation[0].Number;
                foreach (DTOReservable table in tablesInLocation)
                {
                    if (table.Number > max)
                    {
                        max = table.Number;
                    }
                }
            }

            return(max + 1);
        }