private void 输出小票信息ToolStripMenuItem_Click(object sender, EventArgs e) { if (this.listView_note.SelectedItems.Count == 0) { MessageBox.Show(this, "尚未选择备书单"); return; } ListViewItem viewItem = this.listView_note.SelectedItems[0]; string noteId = viewItem.SubItems[0].Text; Note note = DbManager.Instance.GetNote(noteId); string[] reasons = this._mainForm.GetSettings().ReasonArray; string reasonText = ""; foreach (string r in reasons) { if (reasonText != "") { reasonText += "\r\n"; } reasonText += "□ " + r; } if (reasonText != "") { reasonText = "未找到原因:\r\n" + reasonText; } StringBuilder sb = new StringBuilder(); // 备书单整体信息 sb.AppendLine("备书单号:" + noteId); //备书单id sb.AppendLine(note.PatronName); //读者姓名 sb.AppendLine(note.PatronTel); //读者电话 sb.AppendLine(note.PrintTime); //打印时间 sb.AppendLine("================="); //打印时间 // 预约记录详细信息 List <ReservationItem> items = DbManager.Instance.GetItemsByNoteId(noteId); foreach (ReservationItem item in items) { sb.AppendLine(item.ItemBarcode); sb.AppendLine(item.Title); sb.AppendLine(item.Location); sb.AppendLine(item.AccessNo); sb.AppendLine(item.ISBN); sb.AppendLine(item.Author); sb.AppendLine(item.RequestTime); sb.AppendLine(reasonText); sb.AppendLine("--------------------------"); } textForm dlg = new textForm(); dlg.StartPosition = FormStartPosition.CenterScreen; dlg.Info = sb.ToString(); dlg.ShowDialog(this); }
private void 查看备书结果ToolStripMenuItem_Click(object sender, EventArgs e) { ListViewItem viewItem = this.listView_note.SelectedItems[0]; string noteId = viewItem.SubItems[0].Text; Note note = DbManager.Instance.GetNote(noteId); if (note.Step != Note.C_Step_Check && note.Step != Note.C_Step_Notice && note.Step != Note.C_Step_Takeoff) { MessageBox.Show(this, "本单尚未备书完成,备书完成才能查看备书结果信息"); return; } string info = this.GetResultInfo(noteId); textForm dlg = new textForm(); dlg.StartPosition = FormStartPosition.CenterScreen; dlg.Info = info; dlg.ShowDialog(this); }