Ejemplo n.º 1
0
        public string GetPrtStrCashBilingual(List <TAOrderItemInfo> lstOI, Hashtable ht)
        {
            StringBuilder sb = new StringBuilder();
            string        L  = PrtCommon.GetSplit();
            string        L1 = PrtCommon.GetRestName();
            string        L2 = PrtCommon.GetRestAddr();
            string        L3 = PrtCommon.GetRestTel();
            string        L4 = PrtCommon.GetRestVATNo();
            string        L5 = PrtCommon.GetPrtTime();
            string        L6 = PrtCommon.GetPrtDateTime();
            string        L7 = (string)ht["Staff"];

            //餐厅名称
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L1.Length) / 2) + L1);
            sb.Append(Environment.NewLine);

            //餐厅地址
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L2.Length) / 2) + L2);
            sb.Append(Environment.NewLine);

            //Tel
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L3.Length) / 2) + L3);
            sb.Append(Environment.NewLine);

            //VAT
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L4.Length) / 2) + L4);
            sb.Append(Environment.NewLine);

            //分隔行
            sb.Append(L);
            sb.Append(Environment.NewLine);

            //时间
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L5.Length) / 2) + L5);
            sb.Append(Environment.NewLine);

            //分隔行
            sb.Append(L);
            sb.Append(Environment.NewLine);

            sb.Append(PrtCommon.GetSpace(6) + L6);
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetSpace(6) + L7);
            sb.Append(Environment.NewLine);
            sb.Append(L);
            sb.Append(Environment.NewLine);

            sb.Append("Code" + PrtCommon.GetSpace(2) + "Qty" + PrtCommon.GetSpace(2) + "Name" + PrtCommon.GetSpace(17) + "Price" + PrtCommon.GetSpace(2));
            sb.Append(Environment.NewLine);

            foreach (var taOrderItemInfo in lstOI)
            {
                sb.Append(PrtCommon.GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty,
                                           taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice));
                sb.Append(Environment.NewLine);
            }

            sb.Append(L);
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetItemTotal((string)ht["ItemQty"], (string)ht["SubTotal"]));
            sb.Append(Environment.NewLine);
            sb.Append(L);
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetTotal((string)ht["Total"]));
            sb.Append(Environment.NewLine);
            sb.Append(L);
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetPay((string)ht["PayType"]));
            sb.Append(Environment.NewLine);
            sb.Append(L);
            sb.Append(Environment.NewLine);
            sb.Append(PrtStatic.PRT_COMP_NAME);
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetSpace(8) + PrtStatic.PRT_COMP_WEBSITE);
            sb.Append(Environment.NewLine);

            return(sb.ToString());
        }
Ejemplo n.º 2
0
        public static string GetPrtStrBillBilingual(List <TAOrderItemInfo> lstOI, Hashtable ht)
        {
            StringBuilder sb = new StringBuilder();
            string        L  = PrtCommon.GetSplit();
            string        L1 = PrtCommon.GetRestName();
            string        L2 = PrtCommon.GetRestAddr();
            string        L3 = PrtCommon.GetRestTel();
            string        L4 = PrtCommon.GetRestVATNo();
            string        L5 = PrtCommon.GetPrtTime();
            string        L6 = PrtCommon.GetPrtDateTime();
            string        L7 = "Staff:" + (ht["Staff"]).ToString() + "   " + @"Order No:" + (ht["OrderNo"]).ToString();

            //餐厅名称
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L1.Length) / 2) + L1);
            sb.Append(Environment.NewLine);

            //餐厅地址
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L2.Length) / 2) + L2);
            sb.Append(Environment.NewLine);

            //Tel
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L3.Length) / 2) + L3);
            sb.Append(Environment.NewLine);

            //VAT
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE - L4.Length) / 2) + L4);
            sb.Append(Environment.NewLine);

            //分隔行
            sb.Append(L);
            sb.Append(Environment.NewLine);

            //时间
            sb.Append(PrtCommon.GetSpace((PrtStatic.PRT_LINE_SIZE_20 - L5.Length) / 2) + L5);
            sb.Append(Environment.NewLine);

            //分隔行
            sb.Append(L);
            sb.Append(Environment.NewLine);

            //sb.Append(PrtCommon.GetSpace(6) + L6);
            sb.Append(L6);
            sb.Append(Environment.NewLine);
            //sb.Append(PrtCommon.GetSpace(6) + L7);
            sb.Append(L7);
            sb.Append(Environment.NewLine);
            sb.Append(L);
            sb.Append(Environment.NewLine);

            sb.Append("Code" + PrtCommon.GetSpace(2) + "Qty" + PrtCommon.GetSpace(2) + "Name" + PrtCommon.GetSpace(17) + "Price" + PrtCommon.GetSpace(2));
            sb.Append(Environment.NewLine);

            PRT_BILL_SHUANGYU_ROW_COUNT = lstOI.Count * 2;

            foreach (var taOrderItemInfo in lstOI)
            {
                //涉及到多行需要计算行数
                //sb.Append(PrtCommon.GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty,
                //    taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice));
                sb.Append(GetTab(taOrderItemInfo.ItemCode, taOrderItemInfo.ItemQty,
                                 taOrderItemInfo.ItemDishName, taOrderItemInfo.ItemTotalPrice));
                sb.Append(Environment.NewLine);
                var CNameList = CommonData.TaMenuItemList.Where(s => s.DishCode.Equals(taOrderItemInfo.ItemCode));
                if (CNameList.Any())
                {
                    sb.Append(PrtCommon.GetHanZiTab(CNameList.FirstOrDefault().OtherName));
                    sb.Append(Environment.NewLine);
                }
            }

            sb.Append(L);
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetItemTotal((ht["ItemQty"]).ToString(), (ht["SubTotal"]).ToString()));
            sb.Append(Environment.NewLine);
            sb.Append(L);
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetTotal((ht["Total"]).ToString()));
            sb.Append(Environment.NewLine);
            sb.Append(L);
            sb.Append(Environment.NewLine);

            sb.Append(PrtCommon.GetText("Tendered:", (ht["Tendered"]).ToString()));
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetText("Change:", (ht["Change"]).ToString()));
            sb.Append(Environment.NewLine);
            sb.Append(L);

            sb.Append(PrtCommon.GetPay((ht["PayType"]).ToString()));
            sb.Append(Environment.NewLine);
            sb.Append(L);
            sb.Append(Environment.NewLine);
            sb.Append(PrtStatic.PRT_COMP_NAME);
            sb.Append(Environment.NewLine);
            sb.Append(PrtCommon.GetSpace(8) + PrtStatic.PRT_COMP_WEBSITE);
            sb.Append(Environment.NewLine);

            return(sb.ToString());
        }