Пример #1
0
        /// <summary>
        /// 打印订单数据
        /// </summary>
        /// <param name="template"></param>
        /// <returns></returns>
        private string PrintOrderData(string OrderNo, template template)
        {
            string templatepath = Request.MapPath(string.Format(@"\portal\Print\template\{0}.html", template.ToString()));
            string templatehtml = ReadFileHelp.GetTemplet(Convert.ToInt32(template), templatepath);

            using (ProxyBE p = new ProxyBE())
            {
                SearchResult sr = p.Client.SearchPrintOrderData(null, OrderNo);
                if (sr.Total > 0)
                {
                    foreach (DataRow row in sr.DataSet.Tables[0].Rows)
                    {
                        string OutOrderNo   = GetDataRow(row, "OutOrderNo");
                        string OrderType    = GetDataRow(row, "OrderType");
                        string CabinetType  = GetDataRow(row, "CabinetType");
                        string BookingDate  = GetDataRow(row, "BookingDate");
                        string ShipDate     = GetDataRow(row, "ShipDate");
                        string CustomerName = GetDataRow(row, "CustomerName");
                        string PartnerName  = GetDataRow(row, "PartnerName");

                        templatehtml = templatehtml
                                       .Replace("{OutOrderNo}", OutOrderNo)
                                       .Replace("{OrderType}", OrderType)
                                       .Replace("{CabinetType}", CabinetType)
                                       .Replace("{BookingDate}", !string.IsNullOrEmpty(BookingDate) ? DateTime.Parse(BookingDate).ToString("yyyy-MM-dd") : string.Empty)
                                       .Replace("{ShipDate}", !string.IsNullOrEmpty(ShipDate) ? DateTime.Parse(ShipDate).ToString("yyyy-MM-dd") : string.Empty)
                                       .Replace("{BarcodeNo}", OutOrderNo)
                                       .Replace("{CustomerName}", GetPartnerName(PartnerName, CustomerName));
                    }
                }
            }

            return(templatehtml);
        }
Пример #2
0
        /// <summary>
        /// 打印包装数据
        /// </summary>
        /// <param name="Barcode"></param>
        /// <param name="WorkingID"></param>
        /// <returns></returns>
        private string PrintPackageData(string Barcode, string WorkingID, template template)
        {
            string templatepath = Request.MapPath(string.Format(@"\portal\Print\template\{0}.html", template.ToString()));
            string templatehtml = ReadFileHelp.GetTemplet(Convert.ToInt32(template), templatepath);

            using (ProxyBE p = new ProxyBE())
            {
                SearchResult sr = p.Client.SearchPrintCabinetData(null, Barcode);
                if (sr.Total > 0)
                {
                    foreach (DataRow row in sr.DataSet.Tables[0].Rows)
                    {
                        string OrderNo       = GetDataRow(row, "OrderNo");
                        string CabinetName   = GetDataRow(row, "CabinetName");
                        string MaterialStyle = GetDataRow(row, "MaterialStyle");
                        string Color         = GetDataRow(row, "Color");
                        string Size          = GetDataRow(row, "Size");
                        string CustomerName  = GetDataRow(row, "CustomerName");
                        string PartnerName   = GetDataRow(row, "PartnerName");
                        string BarcodeNo     = GetDataRow(row, "BarcodeNo");
                        string OrderID       = GetDataRow(row, "OrderID");
                        string CabinetCode   = GetDataRow(row, "CabinetCode");
                        string GroupNumber   = GetDataRow(row, "GroupNumber");

                        templatehtml = templatehtml
                                       .Replace("{OrderNo}", OrderNo)
                                       .Replace("{CabinetName}", CabinetName)
                                       .Replace("{MaterialStyle}", MaterialStyle)
                                       .Replace("{Color}", Color)
                                       .Replace("{Size}", Size)
                                       .Replace("{GroupNumber}", GroupNumber)
                                       .Replace("{CabinetCode}", CabinetCode)
                                       .Replace("{BarcodeNo}", BarcodeNo)
                                       .Replace("{CustomerName}", GetPartnerName(PartnerName, CustomerName));

                        //更新打印记录
                        //if (!string.IsNullOrEmpty(Request["isconfig"]))
                        p.Client.UpdateOrderWorkFlowByPrintCount(null, new Guid(WorkingID), new Guid(OrderID));
                    }
                }
            }

            return(templatehtml);
        }