Exemplo n.º 1
0
        private void PrintDocument(Guid PackageID)
        {
            //if (this.CurrentOrder == null) return;
            //if (this.CurrentPackage == null) return;
            using (ProxyBE p = new ProxyBE())
            {
                //打印标签
                SearchPackageArgs args = new SearchPackageArgs();
                args.OrderBy = "[PackageNum] asc";
                //args.OrderID = this.CurrentOrder.OrderID;
                args.PackageID = PackageID;// CurrentPackage.PackageID;
                SearchResult sr = p.Client.SearchPackage(CGlobal.SenderUser, args);

                if (sr.Total == 0)
                {
                    throw new Exception("此订单未设置包装数据。");
                }

                ReportPrint rpt = new ReportPrint();
                rpt.CopyQty  = (short)this.PrintQty;
                rpt.LogoFile = this.LogoFile;
                rpt.DocumentPrint(sr);
                //重置数据
                this.CurrentPackage = null;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 补打标签
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnRePrint_Click(object sender, EventArgs e)
        {
            try
            {
                SearchPackageArgs args = new SearchPackageArgs();
                //打印标签
                TreeNode tn = tvPackage.SelectedNode;
                if (tn != null)
                {
                    if (tn.Tag.ToString().Split(',')[0] == "B")
                    {
                        args.PackageID = new Guid(tn.Parent.Tag.ToString().Split(',')[1]);
                    }
                    else
                    {
                        args.PackageID = new Guid(tn.Tag.ToString().Split(',')[1]);
                    }
                }
                else
                {
                    throw new Exception("请选择需要补打的标签的包号。");
                }

                using (ProxyBE p = new ProxyBE())
                {
                    SearchResult sr = p.Client.SearchPackage(CGlobal.SenderUser, args);
                    if (sr.Total == 0)
                    {
                        throw new Exception("没有数据。");
                    }

                    ReportPrint rpt = new ReportPrint();
                    rpt.CopyQty  = (short)this.PrintQty;
                    rpt.LogoFile = this.LogoFile;
                    rpt.DocumentPrint(sr);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }