Exemplo n.º 1
0
        public void print3(string orderNumber, string realPayAmount, string discountAmount, string orderAmount, string type, string status, string terminal, string userName, string storeName, string payTime, string print)
        {
            row0  = new PrintRow(150, "      " + storeName, new Font("宋体", 14, FontStyle.Bold), Brushes.Blue, 0);
            row1  = new PrintRow(150, "********付款凭证********", new Font("宋体", 10), Brushes.Blue, 40);
            row2  = new PrintRow(150, "门店名称:" + storeName, new Font("宋体", 10), Brushes.Black, 70);
            row3  = new PrintRow(150, "收银员:" + userName, new Font("宋体", 10), Brushes.Black, 100);
            row4  = new PrintRow(150, "订单编号:" + orderNumber.Substring(0, 17), new Font("宋体", 10), Brushes.Black, 130);
            row5  = new PrintRow(150, "          " + orderNumber.Substring(17, 7), new Font("宋体", 10), Brushes.Black, 150);
            row6  = new PrintRow(150, "支付方式:" + type, new Font("宋体", 10), Brushes.Black, 170);
            row7  = new PrintRow(150, "支付状态:" + status, new Font("宋体", 10), Brushes.Black, 200);
            row8  = new PrintRow(150, "支付终端:" + terminal, new Font("宋体", 10), Brushes.Black, 230);
            row9  = new PrintRow(150, "支付时间:" + payTime, new Font("宋体", 10), Brushes.Black, 260);
            row10 = new PrintRow(150, "订单金额:" + orderAmount, new Font("宋体", 10), Brushes.Black, 290);
            row11 = new PrintRow(150, "优惠金额:" + discountAmount, new Font("宋体", 10), Brushes.Black, 320);
            row12 = new PrintRow(150, "顾客实付:", new Font("宋体", 10, FontStyle.Bold), Brushes.Black, 350);
            row13 = new PrintRow(150, "RMB:" + realPayAmount, new Font("宋体", 20, FontStyle.Bold), Brushes.Black, 390);
            row14 = new PrintRow(150, "签    名:___________", new Font("宋体", 10), Brushes.Blue, 420);
            row15 = new PrintRow(150, "备    注:", new Font("宋体", 10), Brushes.Blue, 450);
            Order tempOrder = new Order(new List <PrintRow>()
            {
                row0, row1, row2, row3, row4, row5, row6, row7, row8, row9, row10, row11, row12, row13, row14, row15
            });

            PrintOrder.Print(print, tempOrder);
        }
Exemplo n.º 2
0
        public void print6(string OrderBH, string print)
        {
            row0  = new PrintRow(150, "      " + dt.Rows[0][0].ToString(), new Font("宋体", 14, FontStyle.Bold), Brushes.Blue, 0);
            row1  = new PrintRow(150, "********付款凭证********", new Font("宋体", 10), Brushes.Blue, 40);
            row2  = new PrintRow(150, "门店名称:" + dt.Rows[0][0].ToString(), new Font("宋体", 10), Brushes.Black, 70);
            row3  = new PrintRow(150, "收银员:" + dt.Rows[0][1].ToString(), new Font("宋体", 10), Brushes.Black, 100);
            row8  = new PrintRow(150, "支付终端:" + dt.Rows[0][5].ToString(), new Font("宋体", 10), Brushes.Black, 130);
            row12 = new PrintRow(150, "顾客实付:", new Font("宋体", 10, FontStyle.Bold), Brushes.Black, 160);
            row13 = new PrintRow(150, "RMB:" + (decimal.Parse(dt.Rows[0][7].ToString()) - decimal.Parse(dt.Rows[0][8].ToString())).ToString(), new Font("宋体", 20, FontStyle.Bold), Brushes.Black, 190);
            Order tempOrder = new Order(new List <PrintRow>()
            {
                row1, row0, row2, row3, row8, row12, row13
            });

            PrintOrder.Print(print, tempOrder);
        }
Exemplo n.º 3
0
        public void print5(string print, string storeName, string userName, string terminal, string realPayAmount)
        {
            row0  = new PrintRow(150, "      " + storeName, new Font("宋体", 14, FontStyle.Bold), Brushes.Blue, 0);
            row1  = new PrintRow(150, "********付款凭证********", new Font("宋体", 10), Brushes.Blue, 40);
            row2  = new PrintRow(150, "门店名称:" + storeName, new Font("宋体", 10), Brushes.Black, 70);
            row3  = new PrintRow(150, "收银员:" + userName, new Font("宋体", 10), Brushes.Black, 100);
            row8  = new PrintRow(150, "支付终端:" + terminal, new Font("宋体", 10), Brushes.Black, 130);
            row12 = new PrintRow(150, "顾客实付:", new Font("宋体", 10, FontStyle.Bold), Brushes.Black, 160);
            row13 = new PrintRow(150, "RMB:" + realPayAmount, new Font("宋体", 20, FontStyle.Bold), Brushes.Black, 190);
            row16 = new PrintRow(150, "*********付款码*********", new Font("宋体", 10), Brushes.Blue, 230);
            Order tempOrder = new Order(new List <PrintRow>()
            {
                row0, row1, row2, row3, row8, row12, row13, row16
            });

            PrintOrder.Print(print, tempOrder);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 绘制一行表格
        /// </summary>
        /// <param name="pixel_Y">起始高度</param>
        /// <param name="g">画板</param>
        /// <param name="row">表格数据</param>
        /// <returns></returns>
        private int DrawTiketTableRow(int pixel_Y, Graphics g, PrintRow row)
        {
            if (null != row)
            {
                //定义字体大小
                // float fontSize = 6.5F;
                //定义文字的对齐方式
                StringFormat sf = new StringFormat();
                if (row.TextAlign == 1)
                {
                    sf.Alignment = StringAlignment.Center;
                }
                else if (row.TextAlign == 0)
                {
                    sf.Alignment = StringAlignment.Near;
                }
                else
                {
                    sf.Alignment = StringAlignment.Far;
                }
                sf.LineAlignment = StringAlignment.Center;


                var cells      = row.Cells.OrderBy(q => q.Index);
                var page_width = this.Width;
                var rect_x     = 1;

                foreach (var item in cells)
                {
                    var rectWidth = Convert.ToInt32(Math.Ceiling(page_width * (item.Percent / 100.0)));
                    g.DrawString(item.Text, row.RowFont, new SolidBrush(Color.Black), new Rectangle(rect_x, pixel_Y, rectWidth, Convert.ToInt32(row.RowFont.GetHeight())), sf);
                    rect_x += rectWidth;
                }

                pixel_Y += Convert.ToInt32(row.RowFont.GetHeight()) + 10;
            }
            return(pixel_Y);
        }
Exemplo n.º 5
0
        public void print7(DateEdit dateEdit1, DateEdit dateEdit2, string UserId, string refundWxNum, string refundWxAmount, string NameStore, string totalPaidInOrder, string refundAliAmount, string refundAliNum, string wxTotalOrder, string refundTotalOrder, string refundTotalAmount, string wxTotalAmount, string aliTotalOrder, string aliTotalAmount, string totalOrder, string totalAmount, string totalPaidInAmount, string print)
        {
            row0 = new PrintRow(150, "        " + NameStore + "        ", new Font("宋体", 10, FontStyle.Bold), Brushes.Blue, 0);
            row1 = new PrintRow(150, "********流水凭证********", new Font("宋体", 10), Brushes.Blue, 40);
            row2 = new PrintRow(150, "打印人:" + UserId, new Font("宋体", 10), Brushes.Black, 70);
            row3 = new PrintRow(150, "起始时间:" + dateEdit1.Text, new Font("宋体", 10), Brushes.Black, 100);
            row4 = new PrintRow(150, "截止时间:" + dateEdit2.Text, new Font("宋体", 10), Brushes.Black, 130);
            row5 = new PrintRow(150, "-----------------------", new Font("宋体", 10, FontStyle.Bold), Brushes.Black, 160);
            row6 = new PrintRow(150, "订单统计:" + totalOrder + "笔   " + totalAmount + "元", new Font("宋体", 10), Brushes.Black, 190);
            row7 = new PrintRow(150, "商户实收:" + totalPaidInOrder + "笔   " + totalPaidInAmount + "元", new Font("宋体", 10), Brushes.Black, 220);
            row8 = new PrintRow(150, "支 付 宝:" + aliTotalOrder + "笔   " + aliTotalAmount + "元", new Font("宋体", 10), Brushes.Black, 220);
            row9 = new PrintRow(150, "微    信:" + wxTotalOrder + "笔   " + wxTotalAmount + "元", new Font("宋体", 10), Brushes.Black, 220);

            row10 = new PrintRow(150, "-----------------------", new Font("宋体", 10), Brushes.Black, 250);
            row11 = new PrintRow(150, "退款统计" + refundTotalOrder + "笔   " + refundTotalAmount + "元", new Font("宋体", 10), Brushes.Black, 280);
            row12 = new PrintRow(150, "支 付 宝" + refundAliNum + "笔   " + refundAliAmount + "元", new Font("宋体", 10), Brushes.Black, 310);
            row13 = new PrintRow(150, "微    信" + refundWxNum + "笔   " + refundWxAmount + "元", new Font("宋体", 10), Brushes.Black, 340);
            Order tempOrder = new Order(new List <PrintRow>()
            {
                row0, row1, row2, row3, row4, row5, row6, row7, row10, row11, row12, row13
            });

            PrintOrder.Print(print, tempOrder);
        }