示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="document"></param>
        /// <exceptions>
        ///    <exception name="PosIntegration client Exception" description="Any Exception coming from PosIntegration client"></exception>
        ///    <exception name="IndexOutOfRangeException" description="Set an invalid location"></exception>
        /// </exceptions>
        /// <returns></returns>
        protected void doSetCurrentLocationAtIndex(int inIndex, Boolean inCheckForSaved)
        {
            try
            {
                if (inIndex < _locations.Count)
                {
                    _currentLocIndex = inIndex;

                    if (this.currentLocation.Id > 0) // Not a just added and unsaved location
                    {
                        this.currentLocation.BackgroundImg = _posIntegrationClient.GetBackgroundImgDataForLocation(this.currentLocation.Id);
                    }

                    //MessageBox.Show(string.Format("Set Current Location: {0}, at Index\n\nWidth: {1}      Height: {2}", this.currentLocation.Name, this.currentLocation.Width, this.currentLocation.Height));

                    if (this.currentLocation.Height == 0)
                    {
                        this.currentLocation.Height = 800;
                    }

                    if (this.currentLocation.Width == 0)
                    {
                        this.currentLocation.Width = 600;
                    }
                }
            }
            catch (PosIntegrationException)
            {
                throw;
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inDTOLocation"></param>
        /// <returns></returns>
        public LocationInfo BuildLocationInfo(PosIntegrationClient inPosIntegrationClient, DTOLocation inDTOLocation)
        {
            LocationInfo result = new LocationInfo();

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

            result._new     = false;
            result._id      = inDTOLocation.Id;
            result.Location = inDTOLocation.Name;
            result.Width    = inDTOLocation.Width;
            result.Height   = inDTOLocation.Height;

            byte[] byteImg = inPosIntegrationClient.GetBackgroundImgDataForLocation(inDTOLocation.Id);
            //if(byteImg.Length > 0)
            if (byteImg != null)
            {
                Image img = Helper.byteArrayToImage(byteImg);

                result.BackImageOrientation = (img.Width > img.Height) ? ImageOrientation.Lanscape : ImageOrientation.Portrait;
                result.BackImage            = img;
            }

            result._modified = false;

            pAddTables(inPosIntegrationClient, result);

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

            return(result);
        }
示例#3
0
文件: Program.cs 项目: radtek/Pos
        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();
            }
        }