Пример #1
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            if (!isSave)
            {
                MessageBox.Show("请先保存!");
                return;
            }
            string num = Interaction.InputBox("请输入打印份数", "输入", "1");

            if (num == "")
            {
                return;
            }
            if (Convert.ToInt16(num) > 0)
            {
                cp.setCopies(Convert.ToInt16(num));
                printModel tm;
                m.TableData = new List <object>();

                for (int i = 0; i < this.dataGridView1.RowCount; i++)
                {
                    tm = new printModel(this.dataGridView1.Rows[i]);
                    m.TableData.Add(tm);
                }

                m.TitleData = new List <string> {
                    "编号:" + label10.Text,
                    "日期:" + dateTimePicker1.Value.ToString("yyyy-MM-dd"),
                    "供应商:" + textBox2.Text,
                    "交货日期:" + dateTimePicker2.Value.ToString("yyyy-MM-dd"),
                    "制单人:" + label7.Text,
                    "备注:" + textBox1.Text
                };

                try
                {
                    cp.reset();
                    cp.PrintPriview();
                }
                catch (Exception)
                {
                    throw;
                }
            }

            //this.printPreviewDialog1.ShowDialog();
        }
Пример #2
0
        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            cp.reset();
            printCallSlipModel tm;

            m.TableData = new List <object>();
            for (int i = 0; i < this.dataGridView1.RowCount; i++)
            {
                tm = new printCallSlipModel(this.dataGridView1.Rows[i]);
                m.TableData.Add(tm);
            }
            //m.EndData = new List<string> { "jj", "tt" };
            try
            {
                //cp = new CommonPrintTools<object>(list);
                cp.PrintPriview();
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #3
0
        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            string num = Interaction.InputBox("请输入打印份数", "输入", "1");

            if (num != "")
            {
                cp.setCopies(Convert.ToInt16(num));
                printModel tm;
                m.TableData = new List <object>();

                for (int i = 0; i < this.dataGridView1.RowCount; i++)
                {
                    tm = new printModel(this.dataGridView1.Rows[i]);
                    m.TableData.Add(tm);
                }

                m.TitleData = new List <string> {
                    "订单编号:" + label13.Text,
                    "日期:" + label7.Text,
                    "供应商:" + label10.Text,
                    "交货日期:" + label8.Text,
                    "制单人:" + label11.Text,
                    "",
                    "摘要:" + textBox1.Text
                    //"制单人:" +label11.Text
                };

                try
                {
                    cp.reset();
                    cp.PrintPriview();
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }