private void tsmiPrint_Click(object sender, EventArgs e) { try { if (!MyLove.PermissionsBalidation(this.Text, "07")) { return; } GetPrintTb(); Model.sys_t_print_style_default styleDefault; if (PrintForm.PrintHelper.myDefault.TryGetValue(method_id, out styleDefault)) { string style_data = PrintForm.PrintHelper.myStyle[styleDefault.style_id].style_data; global::PrintHelper.IBLL.IPrint print = new global::PrintHelper.BLL.PrintP(); print.Print(style_data, PrintForm.PrintHelper.GetStyle(style_data), PrintForm.PrintHelper.tb_main, PrintForm.PrintHelper.tb_detail); } else { MsgForm.ShowFrom("请选择默认打印样式!"); PrintForm.frmPrintManager frm = new PrintForm.frmPrintManager(); frm.PrintStyle(method_id); } } catch (Exception exception) { MsgForm.ShowFrom(exception); } }
public static void PrintStyle(string path, DataTable tb_main, DataTable tb_detail) { try { string style = ""; using (StreamReader sr = new StreamReader(path, Encoding.UTF8)) { style = sr.ReadToEnd(); } global::PrintHelper.IBLL.IPrint print = new global::PrintHelper.BLL.PrintP(); print.Print(new Guid().ToString(), style, tb_main, tb_detail); } catch (Exception) { throw; } }
private void btnPrint_Click(object sender, EventArgs e) { try { if (this.dataGrid1.CurrentRow() == null) { return; } global::PrintHelper.IBLL.IPrint print = new global::PrintHelper.BLL.PrintP(); print.Print(this.dataGrid1.CurrentRow()["style_data"].ToString(), PrintHelper.GetStyle(this.dataGrid1.CurrentRow()["style_data"].ToString()), PrintHelper.tb_main, PrintHelper.tb_detail); } catch (Exception exception) { MsgForm.ShowFrom(exception); } }