} // gets TicketID, Name, AccountId and campspotID private void tbRfidTag_TextChanged(object sender, TextChangedEventArgs e) { string rfidTag = tbRfidTag.Text; int ticketId = connection.GetTicketIdFromRfid(rfidTag); if (tbRfidTag.Text != "") { fillTextBoxInfo(rfidTag); if (connection.IsCamper(ticketId)) { if (connection.GetTicketStatus(rfidTag) == 3) { connection.SetTicketStatusFestivalRfid(rfidTag); lbCampOutStatus.Content = "Success"; lbCampOutStatus.Background = Brushes.Green; } else if (connection.IsAlreadyCheckedFestival(rfidTag)) { lbCampOutStatus.Content = "Already checked out"; lbCampOutStatus.Background = Brushes.Red; } } else { lbCampOutStatus.Content = "No access to camping"; lbCampOutStatus.Background = Brushes.Red; } } else { lbCampOutStatus.Content = "Scan your bracelet."; lbCampOutStatus.Background = Brushes.Red; } }
private void tbRfidTag_TextChanged(object sender, TextChangedEventArgs e) { ShowInfo(); if (tbRfidTag.Text != "") { int ticketID = connection.GetTicketIdFromRfid(tbRfidTag.Text); string hasTicket = connection.VisitorHasRfidAssigned(ticketID); ObservableCollection <StoreRentItem> tempRentalReturnList = connection.ShowReturnItems(tbRfidTag.Text); if (tempRentalReturnList.Count == 0) { int ticketStatus = connection.GetTicketStatus(hasTicket); if (ticketStatus == 2) { connection.SetTicketStatusOutside(hasTicket); lbFestivalCheckOutStatus.Content = "You can leave"; lbFestivalCheckOutStatus.Background = Brushes.Green; } else if (ticketStatus == 3) { lbFestivalCheckOutStatus.Content = "Check out of the camping area first"; lbFestivalCheckOutStatus.Background = Brushes.Red; } else { lbFestivalCheckOutStatus.Content = "Already out"; lbFestivalCheckOutStatus.Background = Brushes.Red; } } else { foreach (var item in tempRentalReturnList) { //this.rentalReturnList.Add(item); rentalReturnList.Add(item); } lbFestivalCheckOutStatus.Content = "Return all loaned items!"; lbFestivalCheckOutStatus.Background = Brushes.Red; } } }