private void renterLibNumber_LostFocus(object sender, RoutedEventArgs e) { readDataFlag = false; Keyboard.RemoveKeyDownHandler(renterLibNumber, keyDownHandler); Keyboard.RemoveKeyUpHandler(renterLibNumber, keyUpHandler); if (cardDataReader.CardInfo == null) { return; } libNumber = cardDataReader.CardInfo.LibraryNumber; renter = renters.getRenterByLibraryNumber(libNumber); if (renter == null) { infoWindow = new InformationWindow("Unrecognized Library Number"); infoWindow.setInfoText("A renter with the library number:\n" + libNumber + "\nwas not found"); infoWindow.ShowDialog(); renterLibNumber.Text = libNumber; return; } renterName.Text = renter.FullName; renterLibNumber.Text = renter.LibraryNumber; renterEmail.Text = renter.CpEmail; }
private void renterEmail_LostFocus(object sender, RoutedEventArgs e) { TextBox sent = sender as TextBox; if (string.IsNullOrEmpty(sent.Text)) { return; } Renter renter = renters.getRenterByEmail(sent.Text); if (renter == null) { infoWindow = new InformationWindow("Unrecognized Cal Poly Email"); infoWindow.setInfoText("A renter with the email:\n" + libNumber + "\nwas not found"); infoWindow.ShowDialog(); return; } renterName.Text = renter.FullName; renterLibNumber.Text = renter.LibraryNumber; renterEmail.Text = renter.CpEmail; }
private void resourceId_LostFocus(object sender, RoutedEventArgs e) { TextBox sent = sender as TextBox; if (sent.Text == "") { return; } int id = 0; if (int.TryParse(sent.Text, out id)) { resource = resources.getById(id); } if (resource == null) { resourceType.Text = ""; infoWindow = new InformationWindow("Invalid Resource Id"); infoWindow.setInfoText("The resource with id " + resourceId.Text + " was not found"); infoWindow.ShowDialog(); return; } resourceType.Text = resource.Type == null ? "" : resource.Type.ResourceName; }