public override void PaintPrinter() { MessageBoxHelper.Show("请放入申请表正面进行打印! "); this.PrintExcelF6(); if (Vehicle.DyHtzbh.Length > 0) { MessageBoxHelper.Show("请放入抵押表进行打印! "); this.PrintExcelF7(); } MessageBoxHelper.Show("请放入申请表背面进行打印! "); BaseVehicleInfoPrinter printer = new F5Printer(this.Vehicle); CommonPrinter commonPrinter = new CommonPrinter(printer); //commonPrinter.ShowPreviewPrinter(); GlobalPrintSetting printSetting = StaticCacheManager.GetConfig <GlobalPrintSetting>(); if (printSetting.PrintModel == "直接打") { commonPrinter.Print(); } else if (printSetting.PrintModel == "选择打印机") { commonPrinter.ShowPreviewPrinter(); } else { commonPrinter.Preview(); } //todo,excelprinteer }
private void 打印二维条码F5ToolStripMenuItem_Click(object sender, EventArgs e) { if (this.IsChecked()) { int i = this.dataGridView1.SelectedRows[0].Index; VehicleInfo vehicle = this.pager.Lists[i] as VehicleInfo; F5Printer printer = new F5Printer(vehicle); this.Print(printer); } }
void dataGridView1_KeyDown(object sender, KeyEventArgs e) { if (this.dataGridView1.SelectedRows.Count > 0) { int i = this.dataGridView1.SelectedRows[0].Index; VehicleInfo vehicle = this.pager.Lists[i] as VehicleInfo; BaseVehicleInfoPrinter printer = null; if (e.KeyCode == Keys.F1) { printer = new F1Printer(vehicle); } else if (e.KeyCode == Keys.F2) { printer = new F2ExcelPrinter(vehicle); printer.PaintPrinter(); return; } else if (e.KeyCode == Keys.F3) { printer = new F3Printer(vehicle); } else if (e.KeyCode == Keys.F4) { printer = new F4Printer(vehicle); } else if (e.KeyCode == Keys.F5) { printer = new F5Printer(vehicle); //printer = new F5Printer(this.student); } else if (e.KeyCode == Keys.F6) { printer = new F6ExcelPrinter(vehicle); printer.PaintPrinter(); return; } else if (e.KeyCode == Keys.F7) { printer = new F7ExcelPrinter(vehicle); printer.PaintPrinter(); return; } if (printer != null) { this.Print(printer); //commonPrinter.ShowPreviewPrinter(); } } //throw new Exception("The method or operation is not implemented."); }