/// <summary> /// /// </summary> /// <param name="document"></param> /// <exceptions> /// <exception name="PosIntegration client Exception" description="Any Exception coming from PosIntegration client"></exception> /// <exception name="NoCurrentLocationException" description="Could not Reset current location's tables as no current location has been set"></exception> /// </exceptions> /// <returns></returns> public virtual void refreshTablesInLocation() { try { _tablesInLocation.Clear(); if (this.currentLocation.Id > 0) // Not a just added and unsaved location { DTOReservable[] tablesInLocation = _posIntegrationClient.GetTablesForLocation(this.currentLocation.Id); foreach (DTOReservable table in tablesInLocation) { _tablesInLocation.Add(table); } } } catch (NoCurrentLocationException) { throw; } catch (Exception exc) // Pos Integration Exception { _posIntegrationFailed = true; throw new PosIntegrationException(exc.Message); } }
/// <summary> /// /// </summary> /// <param name="?"></param> /// <param name="?"></param> private void pAddTables(PosIntegrationClient inPosIntegrationClient, LocationInfo inLocation) { DTOReservable[] dtoReservableTables = inPosIntegrationClient.GetTablesForLocation(inLocation._id); foreach (DTOReservable reservableTable in dtoReservableTables) { inLocation.AddTable(TableInfoBuilder.Instance.BuildTableInfo(reservableTable)); } }
/// <summary> /// /// </summary> /// <param name="inID"></param> /// <returns></returns> private DTOReservable pDTOTableWithID(int inID) { DTOReservable result = null; //::::::::::::::::::::::::::::::::: DTOReservable[] dtoTables = _posIntegrationClient.GetTablesForLocation(LocationInUse.ID); foreach (DTOReservable dtoTable in dtoTables) { if (dtoTable.Id == inID) { result = dtoTable; break; } } //::::::::::::::::::::::::::::::::: return(result); }
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(); } }