예제 #1
0
        private void PrintCheque()
        {
            CustomPrinter printer = new CustomPrinter();

            printer.AddLine("     SmartSchool", new Font("Courier New", 14, System.Drawing.FontStyle.Bold));
            printer.AddLine("       Столовая", new Font("Courier New", 14, System.Drawing.FontStyle.Bold));
            printer.AddBlankLine();
            printer.AddSeparateLine("Номер заказа:", response.Id, new Font("Courier New", 10, System.Drawing.FontStyle.Bold));
            printer.AddSeparateLine("ФИО:", response.Name, new Font("Courier New", 10, System.Drawing.FontStyle.Bold));
            printer.AddSeparateLine("Школа:", response.School, new Font("Courier New", 10, System.Drawing.FontStyle.Bold));
            printer.AddSeparateLine("Класс:", response.Klass, new Font("Courier New", 10, System.Drawing.FontStyle.Bold));
            printer.AddBlankLine();
            foreach (MenuItems item in verificationOrder.Orders)
            {
                printer.AddLine(item.Name, new Font("Courier New", 10, System.Drawing.FontStyle.Bold));
                printer.AddLineEnd(" =" + item.Price.ToString() + " тг.", new Font("Courier New", 10, System.Drawing.FontStyle.Bold));
                printer.AddSeparateLine("x" + item.Quantity, " =" + (item.Price * item.Quantity).ToString() + " тг.", new Font("Courier New", 10, System.Drawing.FontStyle.Bold));
            }

            printer.AddBlankLine();
            printer.AddCenteredLine("СПАСИБО ЗА ЗАКАЗ!", new Font("Courier New", 10, System.Drawing.FontStyle.Bold));
            printer.AddBlankLine();
            printer.Print();

            this.Dispatcher.Invoke(new Action(() => this.verificationOrder.Clear()));
        }