예제 #1
0
 public TableItemModel(string _id, string _name, double _totalPrice, TableStatus _status)
 {
     this.Id = _id;
     this.Name = _name;
     this.Money = _totalPrice;
     this.Status = _status;
 }
예제 #2
0
 public TableItemModel(string _id, string _name, double _totalPrice, TableStatus _status, int _defaultSeats, int _diningNumber,bool _locked)
 {
     this.Id = _id;
     this.Name = _name;
     this.Money = _totalPrice;
     this.Status = _status;
     this.DefaultSeats = _defaultSeats;
     this.DiningNumber = _diningNumber;
     this.StartTime = DateTime.Now;
     this.Locked=_locked;
 }
예제 #3
0
        public static TableStatus[] GetAllTableStatus()
        {
            int NumTables;

            List<PoolTable> Tables = TablesDB.DataContext.PoolTables.ToList();
            NumTables = Tables.Count;
            TableStatus[] allTableStatus = new TableStatus[NumTables + 1];

            foreach (PoolTable table in Tables)
            {
                allTableStatus[table.TableNum] = table.Status;
            }

            return allTableStatus;
        }
예제 #4
0
 public void UpdateStatus(TableStatus status)
 {
     // Cap nhat status ban choi
     // Trong, dang doi, full
     _status = status;
     if (status == TableStatus.kStatusNone) {
         lblStatus.text = @"Trống";
     }
     else if (status == TableStatus.kStatusWait) {
         lblStatus.text = @"Đang đợi";
     }
     else if (status == TableStatus.kStatusFull) {
         lblStatus.text = @"Đầy";
     }
     else{
         Debug.LogError("Cap nhat sai gia tri status");
     }
 }
예제 #5
0
        public override bool IsDuplicated(string strTableName, string[] strFieldName, string[] strFieldValue, string[] strTextValue, TableStatus tsTableStatus)
        {
            DataTable dtDataTable = new DataTable();
            string    strSQL      = "SELECT * FROM " + strTableName + " WHERE " + strFieldName[0] + " = " + strTextValue[0];

            for (int intIndex = 1; (intIndex < strFieldName.Length); intIndex++)
            {
                strSQL = strSQL + " AND " + strFieldName[intIndex] + " = " + strTextValue[intIndex];
            }
            try
            {
                SqlException eSqlException = pDAL.GetDataTable(ref dtDataTable, strSQL);
                if (eSqlException != null)
                {
                    return(true);
                }
            }
            catch
            {
                return(true);
            }
            if (dtDataTable.Rows.Count > 0)
            {
                Boolean strEditCriteria = false;
                if (tsTableStatus == TableStatus.tsEdit)
                {
                    for (int intIndex = 0; (intIndex < strFieldName.Length); intIndex++)
                    {
                        strEditCriteria = strEditCriteria || (strFieldValue[intIndex] != strTextValue[intIndex]);
                    }
                }
                if ((tsTableStatus == TableStatus.tsInsert) || ((tsTableStatus == TableStatus.tsEdit) && strEditCriteria))
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #6
0
        /// <summary>
        /// Creates all samples defined in SampleTables map
        /// </summary>
        /// <param name="client"></param>
        public static void CreateSampleTables(AmazonDynamoDBClient client)
        {
            Console.WriteLine("Getting list of tables");
            List <string> currentTables = client.ListTables().TableNames;

            Console.WriteLine("Number of tables: " + currentTables.Count);

            bool tablesAdded = false;

            if (!currentTables.Contains("Actors"))
            {
                Console.WriteLine("Table Actors does not exist, creating");
                client.CreateTable(new CreateTableRequest
                {
                    TableName             = "Actors",
                    ProvisionedThroughput = new ProvisionedThroughput {
                        ReadCapacityUnits = 3, WriteCapacityUnits = 1
                    },
                    KeySchema = new List <KeySchemaElement>
                    {
                        new KeySchemaElement
                        {
                            AttributeName = "Name",
                            KeyType       = KeyType.HASH
                        }
                    },
                    AttributeDefinitions = new List <AttributeDefinition>
                    {
                        new AttributeDefinition {
                            AttributeName = "Name", AttributeType = ScalarAttributeType.S
                        }
                    }
                });
                tablesAdded = true;
            }

            if (!currentTables.Contains("Movies"))
            {
                Console.WriteLine("Table Movies does not exist, creating");
                client.CreateTable(new CreateTableRequest
                {
                    TableName             = "Movies",
                    ProvisionedThroughput = new ProvisionedThroughput {
                        ReadCapacityUnits = 3, WriteCapacityUnits = 1
                    },
                    KeySchema = new List <KeySchemaElement>
                    {
                        new KeySchemaElement
                        {
                            AttributeName = "Title",
                            KeyType       = KeyType.HASH
                        },
                        new KeySchemaElement
                        {
                            AttributeName = "Released",
                            KeyType       = KeyType.RANGE
                        }
                    },
                    AttributeDefinitions = new List <AttributeDefinition>
                    {
                        new AttributeDefinition {
                            AttributeName = "Title", AttributeType = ScalarAttributeType.S
                        },
                        new AttributeDefinition {
                            AttributeName = "Released", AttributeType = ScalarAttributeType.S
                        }
                    }
                });
                tablesAdded = true;
            }

            if (tablesAdded)
            {
                bool allActive;
                do
                {
                    allActive = true;
                    Console.WriteLine("While tables are still being created, sleeping for 5 seconds...");
                    Thread.Sleep(TimeSpan.FromSeconds(5));

                    foreach (var tableName in SAMPLE_TABLE_NAMES)
                    {
                        TableStatus tableStatus = GetTableStatus(client, tableName);
                        if (!object.Equals(tableStatus, TableStatus.ACTIVE))
                        {
                            allActive = false;
                        }
                    }
                } while (!allActive);
            }

            Console.WriteLine("All sample tables created");
        }
예제 #7
0
        public void InitObject(String pName, Color pColor, String pLabelText, String pFont, TableStatus pTableStatus, decimal pTotal, DateTime pDateOpen, DateTime pDateClosed)
        {
            //Init Parameters
            _buttonColor = pColor;
            _tableStatus = pTableStatus;

            //Settings
            _colorPosTablePadTableTableStatusOpenButtonBackground     = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosTablePadTableTableStatusOpenButtonBackground"]);
            _colorPosTablePadTableTableStatusReservedButtonBackground = FrameworkUtils.StringToColor(GlobalFramework.Settings["colorPosTablePadTableTableStatusReservedButtonBackground"]);

            //Initialize UI Components
            VBox vbox = new VBox(true, 5)
            {
                BorderWidth = 5
            };

            //Button base Label
            _label = new Label(pLabelText);
            SetFont(string.Format("Bold {0}", pFont));
            //Label for Date
            Label labelDateTableOpenOrClosed = new Label(string.Empty);

            Pango.FontDescription fontDescDateTableOpenOrClosed = Pango.FontDescription.FromString("7");
            labelDateTableOpenOrClosed.ModifyFont(fontDescDateTableOpenOrClosed);
            //Label for Total or Status
            _labelTotalOrStatus    = new Label(string.Empty);
            _eventBoxTotalOrStatus = new EventBox();
            _eventBoxTotalOrStatus.Add(_labelTotalOrStatus);
            //_eventBoxTotalOrStatus.CanFocus = false;
            //If click in EventBox call button Click Event
            _eventBoxTotalOrStatus.ButtonPressEvent += delegate { Click(); };

            //Pack VBox
            vbox.PackStart(_label);
            vbox.PackStart(labelDateTableOpenOrClosed);
            vbox.PackStart(_eventBoxTotalOrStatus);
            //Pack Final Widget
            _widget = vbox;

            //_log.Debug(string.Format("pLabelText:[{0}], _tableStatus: [{1}]", pLabelText, _tableStatus));
            switch (_tableStatus)
            {
            case TableStatus.Free:
                SetBackgroundColor(_buttonColor, _eventBoxTotalOrStatus);
                break;

            case TableStatus.Open:
                _labelTotalOrStatus.Text = FrameworkUtils.DecimalToStringCurrency(pTotal);
                if (pDateOpen != null)
                {
                    labelDateTableOpenOrClosed.Text = string.Format(resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "pos_button_label_table_open_at"), pDateOpen.ToString(SettingsApp.DateTimeFormatHour));
                }
                SetBackgroundColor(_colorPosTablePadTableTableStatusOpenButtonBackground, _eventBoxTotalOrStatus);
                break;

            case TableStatus.Reserved:
                _labelTotalOrStatus.Text = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_reserved_table");
                SetBackgroundColor(_colorPosTablePadTableTableStatusReservedButtonBackground, _eventBoxTotalOrStatus);
                break;

            default:
                break;
            }
        }
예제 #8
0
 public TableItemModel(string _id, string _name, TableStatus _status)
 {
     this.Id = _id;
     this.Name = _name;
     this.Status = _status;
 }
        /// <summary>
        /// This method is used to Abort Rops for a table
        /// </summary>
        /// <param name="tableStatus">Identify the table status</param>
        /// <returns>Table ROP return value</returns>
        public TableRopReturnValues RopAbort(out TableStatus tableStatus)
        {
            RopAbortRequest abortRequest;
            RopAbortResponse abortResponse;

            abortRequest.RopId = 0x38;
            abortRequest.LogonId = 0x00;
            abortRequest.InputHandleIndex = 0x00;

            this.DoSingleCallROP(abortRequest, this.tableHandle, ref this.response, ref this.rawData);
            abortResponse = (RopAbortResponse)this.response;

            tableStatus = (TableStatus)abortResponse.TableStatus;

            return (TableRopReturnValues)abortResponse.ReturnValue;
        }
예제 #10
0
 public Task WaitForTableStatus(string tableName, TableStatus status)
 {
     return(WaitForTableStatus(new string[] { tableName }, status));
 }
예제 #11
0
 public TableItemModel(string _id, string _name, TableStatus _status)
 {
     this.Id     = _id;
     this.Name   = _name;
     this.Status = _status;
 }
예제 #12
0
        public static void WaitForTableStatus(AmazonDynamoDBClient client, IEnumerable <string> tableNames, TableStatus status)
        {
            Console.WriteLine("Waiting for tables [{0}] to reach status {1}",
                              string.Join(", ", tableNames.ToArray()), status);
            var tablesList = new List <string>(tableNames);

            Func <bool> testFunction = () =>
            {
                bool allReady = true;
                foreach (var tableName in tablesList.ToArray())
                {
                    var tableStatus = GetStatus(client, tableName);
                    allReady &= (tableStatus == status);
                    if (allReady)
                    {
                        tablesList.Remove(tableName);
                    }

                    if (!allReady)
                    {
                        break;
                    }
                }

                return(allReady);
            };

            WaitUntil(testFunction, 5, 600);

            Console.WriteLine("All tables ready");
        }
예제 #13
0
 private void AllBooksButton_Click(object sender, EventArgs e)
 {
     tableStatus = TableStatus.All;
     ClearLabels();
     DisplayBooks();
 }
예제 #14
0
        public ActionResult OKButtonClick(int tabletDeviceNumber, int newRoundNumber)
        {
            TabletDeviceStatus tabletDeviceStatus = AppData.TabletDeviceStatusList[tabletDeviceNumber];
            Section            section            = AppData.SectionsList.Find(x => x.SectionID == tabletDeviceStatus.SectionID);

            if (section.TabletDevicesPerTable > 1)  // Tablet devices are moving, so need to check if new table is ready
            {
                // Get the move for this tablet device
                RoundsList roundsList = new RoundsList(tabletDeviceStatus.SectionID, newRoundNumber);
                Move       move       = roundsList.GetMove(tabletDeviceStatus.TableNumber, tabletDeviceStatus.PairNumber, tabletDeviceStatus.Direction);

                if (move.NewTableNumber == 0)  // Move is to phantom table, so go straight to RoundInfo
                {
                    tabletDeviceStatus.Update(0, Direction.Sitout, newRoundNumber);
                    return(RedirectToAction("Index", "ShowRoundInfo", new { tabletDeviceNumber }));
                }

                // Check if the new table (the one we're trying to move to) is ready.  Expanded code here to make it easier to understand
                bool        newTableReady;
                TableStatus newTableStatus = AppData.TableStatusList.Find(x => x.SectionID == section.SectionID && x.TableNumber == move.NewTableNumber);
                if (newTableStatus == null)
                {
                    newTableReady = false;  // New table not yet registered (unlikely but possible)
                }
                else if (newTableStatus.RoundNumber == newRoundNumber)
                {
                    newTableReady = true;  // New table has already been advanced to next round by another tablet device, so is ready
                }
                else if (newTableStatus.RoundNumber < newRoundNumber - 1)
                {
                    newTableReady = false;  // New table hasn't yet reached the previous round (unlikely but possible)
                }
                else
                {
                    // New table is on the previous round
                    // It is ready for the move if all tablet device locations are ready.  Sitout locations were set to 'ready' previously
                    if (section.TabletDevicesPerTable == 2 && newTableStatus.ReadyForNextRoundNorth && newTableStatus.ReadyForNextRoundEast)
                    {
                        newTableReady = true;
                    }
                    else if (section.TabletDevicesPerTable == 4 && newTableStatus.ReadyForNextRoundNorth && newTableStatus.ReadyForNextRoundSouth && newTableStatus.ReadyForNextRoundEast && newTableStatus.ReadyForNextRoundWest)
                    {
                        newTableReady = true;
                    }
                    else
                    {
                        newTableReady = false;
                    }
                }

                if (newTableReady)  // Reset tablet device and table statuses for new round
                {
                    tabletDeviceStatus.Update(move.NewTableNumber, move.NewDirection, newRoundNumber);
                    newTableStatus.Update(move.NewTableNumber, newRoundNumber);
                }
                else  // Go back and wait
                {
                    return(RedirectToAction("Index", "ShowMove", new { tabletDeviceNumber, newRoundNumber, tableNotReadyNumber = move.NewTableNumber }));
                }
            }
            else  // Tablet device not moving and is the only tablet device at this table
            {
                tabletDeviceStatus.RoundNumber = newRoundNumber;
                TableStatus newTableStatus = AppData.TableStatusList.Find(x => x.SectionID == tabletDeviceStatus.SectionID && x.TableNumber == tabletDeviceStatus.TableNumber);
                newTableStatus.Update(tabletDeviceStatus.TableNumber, newRoundNumber);
            }

            // Refresh settings and hand records for the start of the round
            Settings.Refresh();
            if (Settings.ShowHandRecord || Settings.ValidateLeadCard)
            {
                HandRecords.Refresh();
            }
            return(RedirectToAction("Index", "ShowPlayerNumbers", new { tabletDeviceNumber }));
        }
예제 #15
0
 private void ReservedBooksButton_Click(object sender, EventArgs e)
 {
     tableStatus = TableStatus.Reserved;
     ClearLabels();
     DisplayBooks();
 }
예제 #16
0
 public static bool IsValid(this TableStatus status)
 {
     return(Enum.IsDefined(typeof(TableStatus), status));
 }
        /// <summary>
        /// This method is used to get the status for a table
        /// </summary>
        /// <param name="tableStatus">Identify the table status</param>
        /// <returns>Table ROP return value</returns>
        public TableRopReturnValues RopGetStatus(out TableStatus tableStatus)
        {
            RopGetStatusRequest getStatusRequest;
            RopGetStatusResponse getStatusResponse;

            getStatusRequest.RopId = 0x16;
            getStatusRequest.LogonId = 0x00;
            getStatusRequest.InputHandleIndex = 0x00;

            this.DoSingleCallROP(getStatusRequest, this.tableHandle, ref this.response, ref this.rawData);
            getStatusResponse = (RopGetStatusResponse)this.response;

            tableStatus = (TableStatus)getStatusResponse.TableStatus;

            return (TableRopReturnValues)getStatusResponse.ReturnValue;
        }
예제 #18
0
        private async Task <TableDescription> TableWaitOnStatusAsync(string tableName, TableStatus whileStatus, TableStatus desiredStatus, int delay = 2000)
        {
            TableDescription ret = null;

            do
            {
                if (ret != null)
                {
                    await Task.Delay(delay);
                }

                ret = await GetTableDescription(tableName);
            } while (ret.TableStatus == whileStatus);

            if (ret.TableStatus != desiredStatus)
            {
                throw new InvalidOperationException($"Table {tableName} has failed to reach the desired status of {desiredStatus}");
            }

            return(ret);
        }
예제 #19
0
        public static TableRopReturnValues RopAbort(out TableStatus tableStatus)
        {
            tableStatus = TableStatus.TblstatComplete;

            if (requirementContainer[791])
            {
                // The ROP is valid only on contents table and hierarchy table
                if (globleTableType == TableType.RULES_TABLE || globleTableType == TableType.ATTACHMENTS_TABLE || globleTableType == TableType.PERMISSIONS_TABLE)
                {
                    ModelHelper.CaptureRequirement(486, @"[In Processing RopAbort] The error code ecNotSupported will be returned with value 0x80040102,%x02.01.04.80, if the object on which this ROP was sent is not a contents table or a hierarchy table.");
                    return TableRopReturnValues.ecNotSupported;
                }
                else if (globleTableType == TableType.CONTENT_TABLE)
                {
                    ModelHelper.CaptureRequirement(483, @"[In Processing RopAbort] The RopAbort ROP MUST be supported for contents tables.");
                }
                else if (globleTableType == TableType.HIERARCHY_TABLE)
                {
                    ModelHelper.CaptureRequirement(839, @"[In Processing RopAbort] The RopAbort ROP MUST be supported for hierarchy tables.");
                }
                else
                {
                    // If the table type is invalid, ecNotSupported will be returned, in this test suite, invalid table
                    // is referred as a folderId, for details, see the table initial method in adapter project
                    ModelHelper.CaptureRequirement(124, @"[In RopAbort ROP] This ROP is valid only on Table objects.");
                    return TableRopReturnValues.ecNotSupported;
                }

                if (tableStatus == TableStatus.TblstatComplete)
                {
                    return TableRopReturnValues.ecUnableToAbort;
                }
            }
            else
            {
                return TableRopReturnValues.NotImplemented;
            }

            return TableRopReturnValues.success;
        }
예제 #20
0
파일: TableLink.cs 프로젝트: trygu/PxWeb
 public TableLink(string text, string textShort, string sortCode, string menu, string selection, string description, LinkType type, TableStatus status, DateTime?published, string startTime, string endTime, string tableId, PresCategory category)
     : this(text, textShort, sortCode, menu, selection, description, type, status, published, null, startTime, endTime, tableId, category)
 {
 }
예제 #21
0
 public override Boolean IsDuplicate(string strTableName, string[] strFieldName, string[] strFieldValue, string[] strTextValue, TableStatus tsTableStatus)
 {
     return(pBRL.IsDuplicated(strTableName, strFieldName, strFieldValue, strTextValue, tsTableStatus));
 }
예제 #22
0
 public static void WaitForTableStatus(AmazonDynamoDBClient client, string tableName, TableStatus status)
 {
     WaitForTableStatus(client, new string[] { tableName }, status);
 }
예제 #23
0
파일: TableLink.cs 프로젝트: trygu/PxWeb
 /// <summary>
 /// Create instance with data
 /// </summary>
 /// <param name="text">Presentation text</param>
 /// <param name="textShort">Short presentation text</param>
 /// <param name="sortCode">Sort code</param>
 /// <param name="menu">Menu code</param>
 /// <param name="selection">Selection code</param>
 /// <param name="description">Description of the table</param>
 /// <param name="type">Type of link</param>
 /// <param name="status">Table status</param>
 /// <param name="published">Date published</param>
 /// <param name="lastUpdated">Date last updated</param>
 /// <param name="startTime">Data from period</param>
 /// <param name="endTime">Data to period</param>
 /// <param name="tableId">Table ID</param>
 /// <param name="category">Presentation category</param>
 public TableLink(string text, string textShort, string sortCode, string menu, string selection, string description, LinkType type, TableStatus status, DateTime?published, DateTime?lastUpdated, string startTime, string endTime, string tableId, PresCategory category)
     : base(text, textShort, sortCode, menu, selection, description, type, category)
 {
     Status      = status;
     Published   = published;
     LastUpdated = lastUpdated;
     StartTime   = startTime;
     EndTime     = endTime;
     TableId     = tableId;
 }
예제 #24
0
 public static void WaitForTableStatus(string tableName, TableStatus status)
 {
     WaitForTableStatus(new string[] { tableName }, status);
 }
예제 #25
0
 public IEnumerable <Table> GetByTableStatus(TableStatus tableStatus)
 {
     return(tableService.GetByTableStatus(tableStatus));
 }
예제 #26
0
        public static TableRopReturnValues RopGetStatus(out TableStatus tableStatus)
        {
            tableStatus = TableStatus.TblstatComplete;

            if (requirementContainer[792])
            {
                // If the table type is invalid, ecNotSupported will be returned, in this test suite, invalid table
                // is referred as a folderId, for details, see the table initial method in adapter project
                if (globleTableType == TableType.INVALID_TABLE)
                {
                    ModelHelper.CaptureRequirement(490, @"[In Processing RopGetStatus] The error code ecNotSupported will be returned with value 0x80040102,%x02.01.04.80, if the object on which this ROP was sent is not of type table.");
                    ModelHelper.CaptureRequirement(129, @"[In RopGetStatus ROP] This ROP is valid only on Table objects.");
                    return TableRopReturnValues.ecNotSupported;
                }

                // The ROP is valid only on contents table, hierarchy table and attachments tables
                if (globleTableType == TableType.CONTENT_TABLE)
                {
                    ModelHelper.CaptureRequirement(842, @"[In Processing RopGetStatus] The RopGetStatus ROP MUST be supported for contents tables.");
                }
                else if (globleTableType == TableType.HIERARCHY_TABLE)
                {
                    ModelHelper.CaptureRequirement(840, @"[In Processing RopGetStatus] The RopGetStatus ROP MUST be supported for hierarchy tables.");
                }
                else if (globleTableType == TableType.RULES_TABLE)
                {
                    ModelHelper.CaptureRequirement(841, @"[In Processing RopGetStatus] The RopGetStatus ROP MUST be supported for rules tables.");
                }
            }
            else
            {
                return TableRopReturnValues.NotImplemented;
            }

            return TableRopReturnValues.success;
        }
예제 #27
0
 public DiningTable(int id, TableStatus status)
 {
     Id     = id;
     Status = status;
 }
예제 #28
0
 public void ChangeGameStatus(TableStatus newStatus)
 {
     GameStatus = newStatus;
 }
 public async Task WaitTillTableIsStatus(TableStatus tableStatus)
 {
     await BuilderDescribeTableRequest.BuildWaitTillMatchingStatus(tableStatus, tableName, dynamodbClient);
 }
 public TableStatusItem(string id, string name, int seats, double total,TableStatus status)
 {
     this.Id = id;
     this.Name = name;
     this.Seats = seats;
     this.Total = total;
     this.Status = status;
 }
 public async Task <bool> TableIsStatus(TableStatus tableStatus)
 {
     return(await BuilderDescribeTableRequest.BuildMatchingStatus(tableStatus, tableName, dynamodbClient));
 }
예제 #32
0
 // Use this for initialization
 void Start()
 {
     _status = TableStatus.kStatusNone;
 }
예제 #33
0
 public TouchButtonTable(String pName, Color pColor, String pLabelText, String pFont, int pWidth, int pHeight, TableStatus pTableStatus, decimal pTotal, DateTime pDateOpen, DateTime pDateClosed)
     : base(pName)
 {
     InitObject(pName, pColor, pLabelText, pFont, pTableStatus, pTotal, pDateOpen, pDateClosed);
     base.InitObject(pName, pColor, _widget, pWidth, pHeight);
 }