Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inPosIntegrationClient"></param>
        /// <returns></returns>
        private bool pInitLocations(PosIntegrationClient inPosIntegrationClient)
        {
            bool result = true;

            //:::::::::::::::::::::::::::::::::

            try
            {
                DTOLocation[] dtoLocations = inPosIntegrationClient.GetAllLocations();
                pClearLocationInfoList();

                foreach (DTOLocation dtoLocation in dtoLocations)
                {
                    _locationList.Add(_locationInfoBuilder.BuildLocationInfo(_posIntegrationClient, dtoLocation));
                }

                _locationIndex = (_locationList.Count == 0) ? -1 : 0;
            }
            catch
            {
                result = false;
            }

            //:::::::::::::::::::::::::::::::::

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inID"></param>
        /// <returns></returns>
        private DTOLocation pDTOLocationWithID(int inID)
        {
            DTOLocation result = null;

            //:::::::::::::::::::::::::::::::::

            DTOLocation[] dtoLocations = _posIntegrationClient.GetAllLocations();

            foreach (DTOLocation dtoLocation in dtoLocations)
            {
                if (dtoLocation.Id == inID)
                {
                    result = dtoLocation;
                    break;
                }
            }

            //:::::::::::::::::::::::::::::::::

            return(result);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Resets the Floor Plan locations (System.Collections.Generic.List<DTOLocation> class).  Retrieve the locations info from the PosIntegration service
        /// </summary>
        /// <param name="document"></param>
        /// <exceptions>
        ///    <exception name="PosIntegration client Exception" description="Any Exception coming from PosIntegration client"></exception>
        /// </exceptions>
        /// <returns></returns>
        protected virtual void refreshLocations()
        {
            try
            {
                _locations.Clear();

                DTOLocation[] locations = _posIntegrationClient.GetAllLocations();

                foreach (DTOLocation loc in locations)
                {
                    _locations.Add(loc);
                }
            }
            catch (Exception exc) // Pos Integration Exception
            {
                _posIntegrationFailed = true;
                throw new PosIntegrationException(exc.Message);
            }
        }
Exemplo n.º 4
0
        static void TestService()
        {
            PosIntegrationClient client = new PosIntegrationClient();

            // Use the 'client' variable to call operations on the service.

            try
            {
                DTOLocation[] locations = client.GetAllLocations();

                foreach (DTOLocation location in locations)
                {
                    System.Console.WriteLine(location.Name);

                    byte[] bckgImg = client.GetBackgroundImgDataForLocation(location.Id);

                    DTOReservable[] tables = client.GetTablesForLocation(location.Id);

                    foreach (DTOReservable table in tables)
                    {
                        System.Console.WriteLine(string.Format(@"{4} Table: {0}  Position:{1}, {2}  Shape: {3}", table.Id, table.X, table.Y, table.Shape, @"\t"));
                    }
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.Message);
            }
            finally
            {
                System.Console.ReadLine();

                // Always close the client.
                client.Close();
            }
        }