Commit 99e429bf authored by Alex Moore's avatar Alex Moore

updated book object

parent ed775511
......@@ -12,5 +12,5 @@
@property (strong, nonatomic) NSString *barcode;
@property (strong, nonatomic) NSString *callnum;
@property (strong, nonatomic) NSString *title;
@property (strong, nonatomic) NSString *errorMsg;
@property (strong, nonatomic) NSString *error;
@end
......@@ -19,7 +19,7 @@
[copy setBarcode:[self.barcode copyWithZone:zone]];
[copy setCallnum:[self.callnum copyWithZone:zone]];
[copy setTitle:[self.title copyWithZone:zone]];
[copy setErrorMsg:[self.errorMsg copyWithZone:zone]];
[copy setError:[self.error copyWithZone:zone]];
}
return copy;
......
......@@ -20,7 +20,7 @@
@property (weak, nonatomic) IBOutlet UITableView *scannedBookTableView;
@property (weak, nonatomic) IBOutlet UILabel *lblSection;
@property NSMutableArray *scannedBookList;
@property NSArray *scannedBookList;
@property NSString *lastErrorReceived;
- (IBAction)txtChange:(id)sender;
......
......@@ -79,7 +79,7 @@ static int BOOK_ID_LENGTH = 14;
// Configure the cell...
Book *book = [self.scannedBookList objectAtIndex:indexPath.row];
cell.textLabel.text = book.title;
if (book.errorMsg != nil) {
if (book.error != nil) {
cell.contentView.backgroundColor = [UIColor redColor];
cell.textLabel.backgroundColor = [UIColor redColor];
}
......@@ -96,7 +96,7 @@ static int BOOK_ID_LENGTH = 14;
NSString *bookID = book.barcode;
NSString *callNum = [book.callnum stringByReplacingOccurrencesOfString:@" " withString:@" "];
NSString *title = book.title;
NSString *errorMsg = book.errorMsg;
NSString *errorMsg = book.error;
NSString *message;
if (errorMsg != nil) {
message = [NSString stringWithFormat:@"Book ID: %@\nCall Number: %@\nTitle: %@\nError: %@", bookID, callNum, title, errorMsg];
......@@ -271,9 +271,9 @@ static int BOOK_ID_LENGTH = 14;
- (void)updateScanHistory:(BOOL) updateOnError {
//If RTI error triggered, pop top book off list
if (updateOnError && [self.scannedBookList count] > 0) {
[self.scannedBookList removeObjectAtIndex:0];
}
//if (updateOnError && [self.scannedBookList count] > 0) {
// self.scannedBookList = [NSArray alloc]
//}
// Get scanned codes - Testing GetScanned
NSString *getScanPath =
......@@ -313,12 +313,13 @@ static int BOOK_ID_LENGTH = 14;
book.title = [book.title stringByReplacingOccurrencesOfString:@" " withString:@" "];
//Add top book to list
[self.scannedBookList insertObject:book atIndex:0];
//[self.scannedBookList insertObject:book atIndex:0];
self.scannedBookList = books;
//Check if last book had error
if (bookError) {
Book *book = [self.scannedBookList objectAtIndex:0];
book.errorMsg = lastErrorReceived;
book.error = lastErrorReceived;
lastErrorReceived = nil;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment