コード例 #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);
        }
コード例 #2
0
ファイル: Order.cs プロジェクト: kaveh981/sampleIOC
        public PrintOrder getOrdeForPrint(int id)
        {
            var order = genericUnitOfWork.Repository<Mapi.Models.Order>().GetById(o => o.Id == id, p => p.OrderDetails, p => p.OrderDetails.Select(s => s.Item), p => p.OrderDetails.Select(s => s.Item.ItemCategory));
            PrintOrder printOrder = new PrintOrder();
            decimal totalSaleTax = 0;
            decimal totalImportedSaleTax = 0;
            decimal totalPrice = 0;
            List<PrintOrderDetail> PrintOrderDetails = new List<PrintOrderDetail>();
            foreach (var orderDetail in order.OrderDetails)
            {
                var saleTax = calculateTax(orderDetail.price, orderDetail.saleTax);
                var importingSaleTax = calculateTax(orderDetail.price, orderDetail.importedSaleTax);
                PrintOrderDetail printOrderDetail = new PrintOrderDetail();
                printOrderDetail.importedSaleTax = importingSaleTax;
                printOrderDetail.saleTax = saleTax;
                printOrderDetail.price = orderDetail.price;
                printOrderDetail.name = orderDetail.Item.ItemName;
                PrintOrderDetails.Add(printOrderDetail);

                totalImportedSaleTax += importingSaleTax;
                totalSaleTax += saleTax;
                totalPrice += orderDetail.price;
            }
            printOrder.printOrderDetails = PrintOrderDetails;
            printOrder.total = totalPrice;
            printOrder.totalImportedSaleTax = totalImportedSaleTax;
            printOrder.totalSaleTax = totalSaleTax;
            return printOrder;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: adir-ch/PhotoStudio
        public void SubmitPrintOrder(string customerName, List <Photo> selectedPhotos)
        {
            PrintOrder order = new PrintOrder();

            order.CustomerName = customerName;
            order.OrderItems   = selectedPhotos;
            _proxy.SubmitPrintOrder(order);
        }
コード例 #4
0
        public ActionResult Delete(int orderId)
        {
            PrintOrder po = new PrintOrder();

            po.OrderId = orderId;
            po.Delete();
            return(RedirectToAction("ShowAll"));
        }
コード例 #5
0
        public ActionResult Update(int OrderId)
        {
            PrintOrder po = new PrintOrder();

            po.OrderId = OrderId;
            PrintOrder search_book = po.Search();

            return(View(search_book));
        }
コード例 #6
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);
        }
コード例 #7
0
        public void ThreeTwoOne()
        {
            var printer = new PrintOrder();
            var thread1 = new Thread(() => printer.First());
            var thread2 = new Thread(() => printer.Second());
            var thread3 = new Thread(() => printer.Third());

            thread3.Start();
            thread2.Start();
            thread1.Start();

            thread1.Join();
            thread2.Join();
            thread3.Join();

            Assert.Equal("firstsecondthird", printer.GetOutput());
        }
コード例 #8
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);
        }
コード例 #9
0
        public IHttpActionResult SetOrder([FromUri] string items, [FromUri] int tot, [FromUri] int dis,
                                          [FromUri] int rcv)
        {
            String[] list = items.Split(',');
            ids      = new int[list.Length];
            names    = new String[list.Length];
            unit     = new int[list.Length];
            qnty     = new int[list.Length];
            total    = new int[list.Length];
            sale     = tot;
            this.rcv = rcv;
            blnc     = rcv - tot;
            for (int i = 0; i < list.Length; i++)
            {
                String[] temp = list[i].Split('|');
                ids[i]   = Int32.Parse(temp[0]);
                names[i] = temp[1].Trim();
                unit[i]  = Int32.Parse(temp[2]);
                qnty[i]  = Int32.Parse(temp[3]);
                total[i] = Int32.Parse(temp[4]);
            }
            if (saveData())
            {
                try
                {
                    PrintOrder po = new PrintOrder();
                    po.SetParameterValue("OID", ordernumber);
                    po.SetParameterValue("order", localorder);
                    po.PrintToPrinter(1, false, 0, 0);
                    subPrintOrder spo = new subPrintOrder();
                    spo.SetParameterValue("o", ordernumber);
                    spo.SetParameterValue("lo", localorder);
                    spo.PrintToPrinter(1, false, 0, 0);
                    localorder++;
                    return(Ok());
                }
                catch
                {
                    return(BadRequest("Problem With the printer."));
                }
            }

            return(BadRequest("Item is Ended. or the quantity is not good entered..."));
        }
コード例 #10
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);
        }
コード例 #11
0
        public void Print(PrintOrder printOrder)
        {
            this.printOrder = printOrder;
            switch (printOrder)
            {
            case PrintOrder.InOrder:
                Console.WriteLine("InOrder");
                rootNode.PrintInOrder();
                break;

            case PrintOrder.PreOrder:
                Console.WriteLine("\tPreOrder");
                rootNode.PrintPreOrder();
                break;

            case PrintOrder.PostOrder:
                Console.WriteLine("\t\tPostOrder");
                rootNode.PrintPostOrder();
                break;

            default:
                break;
            }
        }
コード例 #12
0
        private static void PrintSeriesMatrix2D(int x, int y, PrintOrder order = PrintOrder.normal)
        {
            if (order == PrintOrder.normal)
            {
                for (int currX = 0, currY = 0, c = 1; currY < y; currX = 0, currY++)
                {
                    for (; currX < x; currX++, c++)
                    {
                        Console.Write("{0, 3}", c);
                    }
                    Console.WriteLine();
                }
            }

            if (order == PrintOrder.descendingColumns)
            {
                for (int currY = 0, currX = 0, c = 1; currY < y; currY++, currX = 0, c = (c - (x * y)) + 1)
                {
                    for (; currX < x; currX++, c = c + y)
                    {
                        Console.Write("{0, 3}", c);
                    }
                    Console.WriteLine();
                }
            }

            if (order == PrintOrder.alternate)
            {
                for (int currX = 0, currY = 0, c = 1; currY < y; currY++, currX = 0, c = currY + 1)
                {
                    for (; currX < x; currX++)
                    {
                        Console.Write("{0,3}", c);
                        if (currX % 2 == 0)
                        {
                            c += (y - currY) * 2 - 1;
                        }
                        else
                        {
                            c += currY * 2 + 1;
                        }
                    }
                    Console.WriteLine();
                }
            }

            if (order == PrintOrder.diagonalAscending)
            {
                int[,] matrix = new int[x, y];

                for (int c = 1, currX = 0, currY = y - 1; c <= x * y; c++)
                {
                    matrix[currX, currY] = c;
                    if (currX + 1 < x && currY + 1 < y)
                    {
                        currX++;
                        currY++;
                    }
                    else
                    {
                        int diffY = currY;
                        currY = Math.Max(0, currY - currX - 1);
                        currX = Math.Max(0, currX - diffY + 1);
                    }
                }

                for (int currX = 0, currY = 0; currY < y; currY++, currX = 0)
                {
                    for (; currX < x; currX++)
                    {
                        Console.Write("{0, 3}", matrix[currX, currY]);
                    }
                    Console.WriteLine();
                }
            }

            if (order == PrintOrder.spiral)
            {
                int[,] matrix = new int[x, y];
                int[] vector = new int[] { -1, 0 };

                for (int currX = 0, currY = 0, c = 1, offset = 0; c <= x * y; c++, currX += vector[0], currY += vector[1])
                {
                    matrix[currX, currY] = c;
                    if (currX == 0 + offset)
                    {
                        if (currY == 0 + offset || currY == offset - 1)
                        {
                            vector[0] = 0;
                            vector[1] = 1;
                        }
                        else if (currY == y - 1 - offset)
                        {
                            vector[0] = 1;
                            vector[1] = 0;
                        }
                    }
                    else if (currX == x - 1 - offset)
                    {
                        if (currY == y - 1 - offset)
                        {
                            vector[0] = 0;
                            vector[1] = -1;
                        }
                        else if (currY == 0 + offset)
                        {
                            vector[0] = -1;
                            vector[1] = 0;
                            offset++;
                        }
                    }
                }

                for (int currX = 0, currY = 0; currY < y; currX = 0, currY++)
                {
                    for (; currX < x; currX++)
                    {
                        Console.Write("{0, 3}", matrix[currX, currY]);
                    }
                    Console.WriteLine();
                }
            }
        }
コード例 #13
0
ファイル: Print.aspx.cs プロジェクト: songfang/Wms
        private void CreateHtml(string key, Guid Id)
        {
            var            sbCargoListHtml = new StringBuilder();
            var            po     = new PrintOrder();
            PrintOrderInfo poInfo = null;
            var            index  = 0;

            switch (key)
            {
            case "PreOrderReceipt":
                poInfo = po.GetPrintPreOrderReceipt(Id);
                sbCargoListHtml.Append("<tr><th>序号</th><th>货品</th><th>货品名称</th><th>包装</th><th>单位</th><th>预期量</th></tr>");
                if (poInfo.CargoList != null && poInfo.CargoList.Count > 0)
                {
                    foreach (var item in poInfo.CargoList)
                    {
                        index++;
                        sbCargoListHtml.Append(@"<tr><td>" + index + "</td><td>" + item.ProductCode + "</td><td>" + item.ProductName + "</td><td>" + item.PackageCode + "</td><td>" + item.UnitName + "</td><td>" + item.Qty + "</td></tr>");
                    }
                }
                break;

            case "OrderReceipt":
                poInfo = po.GetPrintOrderReceipt(Id);
                sbCargoListHtml.Append("<tr><th>序号</th><th>货品</th><th>货品名称</th><th>包装</th><th>单位</th><th>已收货量</th></tr>");
                if (poInfo.CargoList != null && poInfo.CargoList.Count > 0)
                {
                    foreach (var item in poInfo.CargoList)
                    {
                        index++;
                        sbCargoListHtml.Append(@"<tr><td>" + index + "</td><td>" + item.ProductCode + "</td><td>" + item.ProductName + "</td><td>" + item.PackageCode + "</td><td>" + item.UnitName + "</td><td>" + item.Qty + "</td></tr>");
                    }
                }
                break;

            case "shelve":
                poInfo = po.GetPrintShelfMission(Id);
                sbCargoListHtml.Append("<tr><th>序号</th><th>货品</th><th>货品名称</th><th>收货单号</th><th>待上架量</th><th>已上架量</th></tr>");
                if (poInfo.CargoList != null && poInfo.CargoList.Count > 0)
                {
                    foreach (var item in poInfo.CargoList)
                    {
                        index++;
                        sbCargoListHtml.Append(@"<tr><td>" + index + "</td><td>" + item.ProductCode + "</td><td>" + item.ProductName + "</td><td>" + item.OrderCode + "</td><td>" + item.StayQty + "</td><td>" + item.Qty + "</td></tr>");
                    }
                }
                break;

            case "OrderSend":
                poInfo = po.GetPrintOrderSend(Id);
                sbCargoListHtml.Append("<tr><th>序号</th><th>货品</th><th>货品名称</th><th>客户代码</th><th>客户名称</th><th>数量</th></tr>");
                if (poInfo.CargoList != null && poInfo.CargoList.Count > 0)
                {
                    foreach (var item in poInfo.CargoList)
                    {
                        index++;
                        sbCargoListHtml.Append(@"<tr><td>" + index + "</td><td>" + item.ProductCode + "</td><td>" + item.ProductName + "</td><td>" + item.CustomerCode + "</td><td>" + item.CustomerName + "</td><td>" + item.Qty + "</td></tr>");
                    }
                }
                break;

            case "OrderPick":
                poInfo = po.GetPrintOrderPick(Id);
                sbCargoListHtml.Append("<tr><th>序号</th><th>货品</th><th>货品名称</th><th>客户代码</th><th>客户名称</th><th>待拣量</th><th>已拣量</th></tr>");
                if (poInfo.CargoList != null && poInfo.CargoList.Count > 0)
                {
                    foreach (var item in poInfo.CargoList)
                    {
                        index++;
                        sbCargoListHtml.Append(@"<tr><td>" + index + "</td><td>" + item.ProductCode + "</td><td>" + item.ProductName + "</td><td>" + item.CustomerCode + "</td><td>" + item.CustomerName + "</td><td>" + item.StayQty + "</td><td>" + item.Qty + "</td></tr>");
                    }
                }
                break;

            default:
                break;
            }
            imgBarcode.Src                = poInfo.BarcodeImageUri;
            lbTitle.InnerText             = poInfo.Title;
            lbPrintDate.InnerText         = poInfo.SPrintDate;
            lbPurchaseOrderCode.InnerText = poInfo.PurchaseOrderCode;
            lbSupplierName.InnerText      = poInfo.SupplierName;
            lbPlanArrivalTime.InnerText   = poInfo.SPlanArrivalTime;
            lbActualArrivalTime.InnerText = poInfo.SActualArrivalTime;

            ltrCargoList.Text = string.Format(@"<table id=""dgCargo"" class=""dgPrint"">{0}</table>", sbCargoListHtml.ToString());
        }
コード例 #14
0
 public void Print(PrintOrder order)
 {
     order(this);
 }
コード例 #15
0
 public ActionResult Update(PrintOrder po)
 {
     po.Update();
     return(RedirectToAction("ShowAll"));
 }
コード例 #16
0
 public ActionResult Add(PrintOrder po)
 {
     po.Add();
     return(View());
 }