Exemplo n.º 1
0
        public void PrintEntruckOrderNew(DataRow item)
        {
            try
            {
                string HZOrderID    = item["HZOrderGID"].ToString();
                string carType      = item["CarType"].ToString();
                string ProductNo    = item["ProductNo"].ToString();
                string CreateTime   = item["CreateTime"].ToString();
                string CarModelName = item["CarModelName"].ToString();
                string Color        = item["Color"].ToString() + item["ColorCode"].ToString(); //第二行

                DataMatrix.net.DmtxImageEncoder dataMatix = new DataMatrix.net.DmtxImageEncoder();
                Bitmap dataMatixCode = dataMatix.EncodeImage(item["ProductNo"].ToString(), 15);

                PrintHZ p = new PrintHZ();
                p.PrintName = XML.XmlConfig.PrintName;
                p.Title     = carType + "座椅装箱单";
                p.ProductNo = ProductNo;
                p.PrintTime = CreateTime;
                p.Images    = dataMatixCode;
                p.CarType   = CarModelName;
                p.CarType1  = carType;
                p.Color     = Color;

                //p.YuLan();
                p.Start();
            }
            catch (Exception ex)
            {
            }
            finally
            {
                GC.Collect(); //强行销毁
            }
        }
Exemplo n.º 2
0
        public string PrintHZOrders(string productNo, string printNames)
        {
            try
            {
                string HZOrderID = "";
                //赋值
                BLL.T_Verifying       t_Verifying = new BLL.T_Verifying();
                System.Data.DataTable dt          = t_Verifying.GetHzOrderByNo(productNo);

                if (dt != null && dt.Rows.Count > 0)
                {
                    HZOrderID = dt.Rows[0]["HZOrderGID"].ToString();

                    string carType      = dt.Rows[0]["CarType"].ToString();
                    string ProductNo    = dt.Rows[0]["ProductNo"].ToString();
                    string CreateTime   = dt.Rows[0]["CreateTime"].ToString();
                    string CarModelName = dt.Rows[0]["CarModelName"].ToString();
                    string Color        = dt.Rows[0]["Color"].ToString() + dt.Rows[0]["ColorCode"].ToString(); //第二行

                    DataMatrix.net.DmtxImageEncoder dataMatix = new DataMatrix.net.DmtxImageEncoder();
                    Bitmap dataMatixCode = dataMatix.EncodeImage(dt.Rows[0]["ProductNo"].ToString(), 15);

                    PrintHZ p = new PrintHZ();
                    p.PrintName = printNames;
                    p.Title     = carType + "座椅装箱单";
                    p.ProductNo = ProductNo;
                    p.PrintTime = CreateTime;
                    p.Images    = dataMatixCode;
                    p.CarType   = CarModelName;
                    p.CarType1  = carType;
                    p.Color     = Color;

                    //p.YuLan();
                    p.Start();
                }
                return(HZOrderID);
            }
            catch (Exception ex)
            {
                //return ex.ToString();
                return("");
            }
            finally
            {
                GC.Collect(); //强行销毁
            }
        }