/// <summary>
        /// 打印账单
        /// </summary>
        private void Print_the_bill()
        {
            List <Consumer> consumers = new List <Consumer>();

            consumers = con;

            PrintfData pd = new PrintfData();

            pd.krxm        = m.SYS_Guest.Where(c => c.ID_Guest == ID_Guest).Single().MC_Guest.Trim();
            pd.zfth        = Tb_The_main_room_number.Text.Trim().ToString();
            pd.ftmc        = Tb_Room_table_name.Text.Trim().ToString();
            pd.ktsj        = Tb_Founding_time.Text.Trim().ToString();
            pd.mdsj        = Tb_The_check_time.Text.Trim().ToString();
            pd.sc          = Tb_duration.Text.Trim().ToString();
            pd.zhekou      = Tb_discount.Text.Trim().ToString();
            pd.beizhu      = Tb_postscript.Text.Trim().ToString();
            pd.leijijine   = Tb_accruing_amounts.Text.Trim().ToString();
            pd.yishoudingj = Tb_received_the_deposit.Text.Trim().ToString();
            pd.yve         = Tb_balance.Text.Trim().ToString();
            pd.bkzf        = Tb_guests_pay.Text.Trim().ToString();
            pd.dfje        = Tb_to_pay_the_balance.Text.Trim().ToString();
            pd.jzfs        = Cb_payment_method.Text.Trim().ToString();
            pd.jzbz        = Tb_comment.Text.Trim().ToString();
            pd.ftdh        = Tb_Room_with_a_single_number.Text.Trim().ToString();


            foreach (var item in consumers)
            {
                pd.LPDD.Add(new PrintfDataDetail
                {
                    fth  = item.Number_RoomStage,
                    xmmc = item.MC_Project,
                    dw   = item.Unit,
                    dj   = item.Price.ToString(),
                    sl   = item.Mun,
                    zk   = item.Discount.ToString(),
                    je   = item.Price.ToString(),
                    zffs = item.MethodOfPayment == null ? "*" : item.MethodOfPayment,
                });
            }

            List <PrintfData> prd = new List <PrintfData>();

            prd.Add(pd);



            //FABM_printer printer = new FABM_printer(prd,consumers);   printer.ShowDialog();


            WPF_MvvMTest.View.Windows.W_Print_DataDetail w = new View.Windows.W_Print_DataDetail("FlowDocument.xaml", pd, new OrderDocumentRenderer());

            w.Owner  = this;
            w.Width  = 1000;
            w.Height = 800;
            w.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            w.ShowInTaskbar         = false;
            w.ShowDialog();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 打印
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtPrint_Click(object sender, RoutedEventArgs e)
        {
            // 客名    房号    房名    房单    开时    买时    时长
            PrintfData pd = new PrintfData();

            pd.krxm       = tuples.Item1;
            pd.zfth       = tuples.Item2;
            pd.ftmc       = tuples.Item3;
            pd.ftdh       = tuples.Item4;
            pd.ktsj       = tuples.Item5;
            pd.mdsj       = tuples.Item6;
            pd.TotalPrice = tuples.Rest.Item1;
            foreach (var item in cos)
            {
                pd.LPDD.Add(new PrintfDataDetail
                {
                    fth  = item.Number_RoomStage,
                    xmmc = item.MC_Project,
                    dw   = item.Unit,
                    dj   = item.Price.ToString(),
                    sl   = item.Mun,
                    zk   = item.Discount.ToString(),
                    je   = item.Price.ToString(),
                    zffs = item.MethodOfPayment == null?"*": item.MethodOfPayment,
                });
            }

            WPF_MvvMTest.View.Windows.W_Print_DataDetail w =
                new Windows.W_Print_DataDetail("FlowDocument.xaml", pd, new OrderDocumentRenderer());
            w.Owner  = this;
            w.Width  = 1000;
            w.Height = 800;
            w.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            w.ShowInTaskbar         = false;
            w.ShowDialog();
        }