private void proccessData(string data) { string FromPort = data; FromPort = FromPort.Trim(); //if (!BarScanner.CheckScanData(FromPort)) //{ // MessageBox.Show("Считанный штрихкод не является штрихкодом книги! Если вы уверены, что штрихкод правильный, попробуйте считать его еще раз"); // return; //} Book bookg = new Book(); try { switch (bookbll.ISBJVVV(FromPort)) { case 1: BooksView book = new BooksView(); book = bookbll.GetBookByBar(FromPort); bookg = new Book(book); FillGrid(bookg); break; case 2: BooksViewRED bookred = new BooksViewRED(); bookred = bookbll.GetBookByBarRED(FromPort); bookg = new Book(bookred); FillGrid(bookg); break; case 3: BooksViewFCC bookFCC = new BooksViewFCC(); bookFCC = bookbll.GetBookByBarFCC(FromPort); bookg = new Book(bookFCC); FillGrid(bookg); break; case -1: MessageBox.Show("Книга не найдена в базе!"); return; } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } bookg.idm = bl.Count + 1; bl.Add(new BookForRep(bookg)); }
public Book(BooksViewRED b) { this.author = b.author; this.bar = b.bar; this.cdc = b.cdc; this.dpublish = b.dpublish; this.id = b.id; this.idm = b.idm; this.illustrs = b.illustrs; this.inv = b.inv; this.note = b.note; this.notesp = b.notesp; this.placepub = b.placepub; this.pubhouse = b.pubhouse; this.size = b.size; this.title = b.title; this.volume = b.volume; }