| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.ComponentModel; | 
					
						
							|  |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | using System.Drawing; | 
					
						
							|  |  |  |  | using System.Text; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Windows.Forms; | 
					
						
							|  |  |  |  | using DevExpress.XtraBars; | 
					
						
							|  |  |  |  | //using DeiNiu.wms.Logical; | 
					
						
							|  |  |  |  | using Microsoft.Reporting.WinForms; | 
					
						
							|  |  |  |  | using DeiNiu.wms.win.ServiceReferenceStockLocation; | 
					
						
							|  |  |  |  | using DeiNiu.wms.win.ServiceReferenceStockOutPickRequest; | 
					
						
							|  |  |  |  | using DeiNiu.Utils; | 
					
						
							|  |  |  |  | using DeiNiu.wms.win.utils.print; | 
					
						
							|  |  |  |  | using System.Drawing.Printing; | 
					
						
							|  |  |  |  | using DeiNiu.wms.Data.Model; | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  | using System.IO; | 
					
						
							| 
									
										
										
										
											2024-03-06 20:48:05 +08:00
										 |  |  |  | using DeiNiu.wms.win.ServiceCustomer; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace DeiNiu.wms.win | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class ConfigPrint : BasicRibbonForm | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         StockLocationServiceClient client = new StockLocationServiceClient(); | 
					
						
							|  |  |  |  |         public ConfigPrint() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             InitializeComponent(); | 
					
						
							|  |  |  |  |             //testReportInA4(); | 
					
						
							|  |  |  |  |             loadPrinters(); | 
					
						
							|  |  |  |  |             loadDefaultPrinters(); | 
					
						
							|  |  |  |  |             //testLocation(); | 
					
						
							|  |  |  |  |             //testOutA4(); | 
					
						
							|  |  |  |  |             /* | 
					
						
							|  |  |  |  |           this.reportViewer1.LocalReport.ReportPath = "wms_in_code.rdlc";// "DeiNiu.wms.Logical.reports.code_print.rdlc"; | 
					
						
							|  |  |  |  |           reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |           DataTable dt = new DeiNiu.wms.Data.Model.WmsStock().getStockRecord("PDDHJO00000051"); | 
					
						
							|  |  |  |  |           int rowCnt = dt.Rows.Count; | 
					
						
							|  |  |  |  |           reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |           this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |           */ | 
					
						
							|  |  |  |  |   | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         void testLocation() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |             this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |             this.reportViewer1.LocalReport.ReportPath = "wmsLocationCode.rdlc";// "DeiNiu.wms.Logical.reports.code_print.rdlc"; | 
					
						
							|  |  |  |  |             reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |             // lWmslocation lgt = new lWmslocation(); | 
					
						
							|  |  |  |  |             string query = " channel>=#9;channel<=#10;shelf>=#1;shelf<=#5;layer>=#1;layer<=#5;col>=#1;col<=#5"; | 
					
						
							|  |  |  |  |             DataSet ds = client.QueryNodes(Park.getDictionary(false), query, 1, 100); | 
					
						
							|  |  |  |  |             DataTable dt = ds.Tables[0]; | 
					
						
							|  |  |  |  |             //lgt.printLocations(dt); | 
					
						
							|  |  |  |  |             int rowCnt = dt.Rows.Count; | 
					
						
							|  |  |  |  |             reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |             this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         void testOutA4() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |             this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |             this.reportViewer1.LocalReport.ReportPath = "utils\\reports\\pickOrderBatchOutA4.rdlc";// "DeiNiu.wms.Logical.reports.code_print.rdlc"; | 
					
						
							|  |  |  |  |             reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |             // lWmslocation lgt = new lWmslocation(); | 
					
						
							|  |  |  |  |             DataTable dt; | 
					
						
							|  |  |  |  |             using (WmsOutPickRequestClient client = new WmsOutPickRequestClient()) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 dt = client.getBatchOutPickOrderPickDetails("PICK050000002911"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             //lgt.printLocations(dt); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (!string.IsNullOrEmpty(dr["id128"].ToString())) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     continue; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 dr.BeginEdit(); | 
					
						
							|  |  |  |  |                 dr["id128"] = Util.getCode128(dr["id"].ToString()); | 
					
						
							|  |  |  |  |                 dr.EndEdit(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  |                 ReportParameter[] parameters = new ReportParameter[3]; | 
					
						
							|  |  |  |  |                 parameters[0] = new ReportParameter("rpHead", WmsConstants.CURRENT_USER_ORG + "整库拣货单"); | 
					
						
							|  |  |  |  |                 parameters[1] = new ReportParameter("operater", LoginInfo.Account); | 
					
						
							|  |  |  |  |                 parameters[2] = new ReportParameter("pickNo", Util.getCode128(dt.Rows[0]["pickOrderNo"].ToString())); | 
					
						
							|  |  |  |  |                   | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             int rowCnt = dt.Rows.Count; | 
					
						
							|  |  |  |  |             reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt));  | 
					
						
							|  |  |  |  |             reportViewer1.LocalReport.SetParameters(parameters);  | 
					
						
							|  |  |  |  |             this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         void testReportInA4() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |             this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |             this.reportViewer1.LocalReport.ReportPath = "utils\\reports\\wms_requestInA4New.rdlc";// "DeiNiu.wms.Logical.reports.code_print.rdlc"; | 
					
						
							|  |  |  |  |             reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |             // lWmslocation lgt = new lWmslocation(); | 
					
						
							|  |  |  |  |             DataTable dt; | 
					
						
							|  |  |  |  |             using (ServiceReferenceStockInRequest.WmsInRequestClient client = new ServiceReferenceStockInRequest.WmsInRequestClient()) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 dt = client.getRequestInStockDetail("PURTXAM00000163"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (!string.IsNullOrEmpty(dr["id128"].ToString())) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     continue; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 dr.BeginEdit(); | 
					
						
							|  |  |  |  |                 dr["id128"] = Util.getCode128(dr["id"].ToString()); | 
					
						
							|  |  |  |  |                 dr.EndEdit(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |            | 
					
						
							|  |  |  |  |             Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[2]; | 
					
						
							|  |  |  |  |             parameters[0] = new ReportParameter("rptTitle", WmsConstants.CURRENT_USER_ORG + "上架单"); | 
					
						
							|  |  |  |  |             parameters[1] = new ReportParameter("operater", LoginInfo.Account); | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             int rowCnt = dt.Rows.Count; | 
					
						
							|  |  |  |  |             reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |             reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |             this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  |             | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         private void reportViewer1_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         void loadPrinters() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             PrintDocument print = new PrintDocument(); | 
					
						
							|  |  |  |  |             string sDefault = print.PrinterSettings.PrinterName;//默认打印机名 | 
					
						
							|  |  |  |  |             foreach (string sPrint in PrinterSettings.InstalledPrinters)//获取所有打印机名称 | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 comPrinters.Properties.Items.Add(sPrint); | 
					
						
							|  |  |  |  |                 if (sPrint == sDefault) | 
					
						
							|  |  |  |  |                     comPrinters.SelectedIndex = comPrinters.Properties.Items.IndexOf(sPrint); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         private void btnTest_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             PrintDocument print = new PrintDocument(); | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnA4_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             writeConfig("A4Printer", comPrinters.Text);  | 
					
						
							|  |  |  |  |             loadDefaultPrinters();  | 
					
						
							|  |  |  |  |           //  MessageBox.Show("设置成功"); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void loadDefaultPrinters() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Park.loadPrinters(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |             lbA4.Text = String.IsNullOrEmpty(WmsConstants.PRINTER_NAME_A4)?"设置 A4 激光打印机": WmsConstants.PRINTER_NAME_A4; | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |             lbCode2.Text = String.IsNullOrEmpty(WmsConstants.PRINTER_NAME_CODE) ? "设置条码打印机" : WmsConstants.PRINTER_NAME_CODE;  | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |             lbPin.Text = String.IsNullOrEmpty(WmsConstants.PRINTER_NAME_PIN) ? "设置多联针式打印机" : WmsConstants.PRINTER_NAME_PIN;   | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnCode_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             writeConfig("CodePrinter", comPrinters.Text); | 
					
						
							|  |  |  |  |             loadDefaultPrinters(); | 
					
						
							|  |  |  |  |           // MessageBox.Show("设置成功"); | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnPin_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             writeConfig("PinPrinter", comPrinters.Text); | 
					
						
							|  |  |  |  |             loadDefaultPrinters(); | 
					
						
							|  |  |  |  |            // MessageBox.Show("设置成功"); | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnWave_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 // reqportPrint.printStockOutCode(client.getPickOrderTmsInfo("PICK060000026285")); | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |                 string  reportName="utils\\reports\\pickOutSeedsBulk.rdlc"; ; | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.ReportPath =reportName;  | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 DataTable dt; | 
					
						
							|  |  |  |  |                 string waveNo = txtWaveNo.Text; | 
					
						
							|  |  |  |  |                 string  jobNo, locationId; | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 using (ServiceReferenceStockOutPickRequest.WmsOutPickRequestClient client = | 
					
						
							|  |  |  |  |                   new WmsOutPickRequestClient("BasicHttpBinding_IWmsOutPickRequest", | 
					
						
							|  |  |  |  |                            buildSvrAddress("WmsOutPickRequestService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dt = client.getPickSummary(waveNo,0);// client.getPickInfo(waveNo); | 
					
						
							|  |  |  |  |                   | 
					
						
							|  |  |  |  |                 }   | 
					
						
							|  |  |  |  |                  DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                     int volType = Convert.ToInt32(dr["volType"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |                     if (volType == 0) //bulk pick | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                        reportName = "utils\\reports\\pickOutSeedsBulk.rdlc"; | 
					
						
							|  |  |  |  |                       // reportName = "pickOutSeedsBulk.rdlc"; | 
					
						
							|  |  |  |  |                         this.reportViewer1.LocalReport.ReportPath = reportName; | 
					
						
							|  |  |  |  |                         jobNo = dr["jobNo"].ToString(); | 
					
						
							|  |  |  |  |                         parameters[0] = new ReportParameter("job128", Util.getCode128(jobNo)); | 
					
						
							|  |  |  |  |                         reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                         dv.RowFilter = string.Format("waveOrder= '{0}' and jobNo ='{1}'", waveNo, jobNo); | 
					
						
							|  |  |  |  |                         foreach (DataRowView drv in dv) | 
					
						
							|  |  |  |  |                         {  | 
					
						
							|  |  |  |  |                             drv.Row["tranAreaName"] = "分播区1"; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     else //batch pick | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         reportName = "utils\\reports\\pickOutSeedsBatch.rdlc"; | 
					
						
							|  |  |  |  |                         this.reportViewer1.LocalReport.ReportPath = reportName; | 
					
						
							|  |  |  |  |                           locationId = dr["locationId"].ToString(); | 
					
						
							|  |  |  |  |                         //    dr["barcode"] =Util.getCode128(dr["barcode"].ToString()); | 
					
						
							|  |  |  |  |                         //    dnew.Rows.Add(dr);  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                         dv.RowFilter = string.Format("waveOrder= '{0}' and locationId ='{1}'", waveNo, locationId); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                         foreach (DataRowView drv in dv) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             drv.Row["ownerName"] = Util.getCode128(drv.Row["barcode"].ToString()); | 
					
						
							|  |  |  |  |                             drv.Row["tranAreaName"] = "分播区1"; | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                         //   Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[0]; | 
					
						
							|  |  |  |  |                         //  parameters[0] = new ReportParameter("pickNo", Util.getCode128(dt.Rows[0]["pickOrderNo"].ToString())); | 
					
						
							|  |  |  |  |                         //  BillPrint.Run(dv.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                       | 
					
						
							|  |  |  |  |                  | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 | 
					
						
							|  |  |  |  |                      int rowCnt = dt.Rows.Count; | 
					
						
							|  |  |  |  |                      if (rowCnt == 0) | 
					
						
							|  |  |  |  |                      { | 
					
						
							|  |  |  |  |                          showErrorMsg("没有记录"); | 
					
						
							|  |  |  |  |                      } | 
					
						
							|  |  |  |  |                      reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                  this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                  | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 showErrorMsg(er, er.Message); | 
					
						
							|  |  |  |  |                 client.Close(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnBatch_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 // reqportPrint.printStockOutCode(client.getPickOrderTmsInfo("PICK060000026285")); | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 //   this.reportViewer1.LocalReport.ReportPath = "wms_in_code.rdlc";// "DeiNiu.wms.Logical.reports.code_print.rdlc"; | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 DataTable dt; | 
					
						
							|  |  |  |  |                 string waveNo = txtWaveNo.Text; | 
					
						
							|  |  |  |  |                 string jobNo, locationId; | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 string reportName = WmsConstants.FILE_SVR_PRINT + "pickOutSeedsJob5.5.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 this.reportViewer1.LocalReport.ReportPath = reportName; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 using (ServiceReferenceStockOutPickRequest.WmsOutPickRequestClient client = | 
					
						
							|  |  |  |  |                      new WmsOutPickRequestClient("BasicHttpBinding_IWmsOutPickRequest", | 
					
						
							|  |  |  |  |                               buildSvrAddress("WmsOutPickRequestService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                    // dt = client.getPickSummary(waveNo, (int)enumWhLocVol.零库)  ;// client.getPickInfo(waveNo); | 
					
						
							|  |  |  |  |                    dt= client.getPickLightTasks(282, 0, 0); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                   | 
					
						
							|  |  |  |  |                     dr["jobCode128"] = Util.CreateQRcode(dr["jobNo"].ToString()); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 /* | 
					
						
							|  |  |  |  |                 DataView dv = dt.DefaultView;       | 
					
						
							|  |  |  |  |                 int rowCnt = dt.Rows.Count; | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", dt)); | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     //int volType = Convert.ToInt32(dr["volType"].ToString()); | 
					
						
							|  |  |  |  |                     jobNo = dr["jobNo"].ToString(); | 
					
						
							|  |  |  |  |                     //    if (volType == 0) //bulk pick | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                     { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                         jobNo = "JOB231021062633"; | 
					
						
							|  |  |  |  |                         parameters[0] = new ReportParameter("job128", Util.getCode128(jobNo)); | 
					
						
							|  |  |  |  |                         reportViewer1.LocalReport.SetParameters(parameters);  | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |                          this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |                     | 
					
						
							|  |  |  |  |         | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 }    | 
					
						
							|  |  |  |  |                 */ | 
					
						
							|  |  |  |  |                  | 
					
						
							|  |  |  |  |             | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |       | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 showErrorMsg(er, er.Message); | 
					
						
							|  |  |  |  |                 client.Close(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnPrintflow_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.DataSources.Clear();  | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                 int num = Convert.ToInt32(txtflowcnt.Text.Trim()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters   | 
					
						
							|  |  |  |  |                     = new Microsoft.Reporting.WinForms.ReportParameter[3]; | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |                 this.reportViewer1.LocalReport.ReportPath = getReportPath("flowCode.rdlc") ;// "DeiNiu.wms.Logical.reports.code_print.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 | 
					
						
							|  |  |  |  |                 /* | 
					
						
							|  |  |  |  |                 for (int i = 0; i < num; i++) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     string flowno = Util.getTimeStamp()+"" ; | 
					
						
							|  |  |  |  |                     flowno = flowno.Substring(6); | 
					
						
							|  |  |  |  |                     parameters[0] = new ReportParameter("flowNo", flowno); | 
					
						
							|  |  |  |  |                     parameters[1] = new ReportParameter("flowCode", Util.getCode128(flowno)); | 
					
						
							|  |  |  |  |                     parameters[2] = new ReportParameter("flowName", txtflowName.Text); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                     reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                     reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", new DataTable("table1"))); | 
					
						
							|  |  |  |  |                    this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                  * */ | 
					
						
							|  |  |  |  |                 DataTable dt = new DataTable(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 dt.Columns.Add("code128"); | 
					
						
							|  |  |  |  |                 dt.Columns.Add("code"); | 
					
						
							|  |  |  |  |                 dt.Columns.Add("title");  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 for (int i = 0; i < num; i++) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     string flowno = Util.getTimeStamp() + ""; | 
					
						
							|  |  |  |  |                     flowno = flowno.Substring(6); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     DataRow dr = dt.NewRow(); | 
					
						
							|  |  |  |  |                     dr["code128"] = Util.getCode128(flowno); | 
					
						
							|  |  |  |  |                     dr["code"] = flowno; | 
					
						
							|  |  |  |  |                     dr["title"] = txtflowName.Text; | 
					
						
							|  |  |  |  |                     dt.Rows.Add(dr);  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                // reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                  printIn.printFlowNos(txtflowName.Text, num); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 MessageBox.Show(er.Message); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnPreIn_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |             DataTable dt = null; | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |             string orderNo = this.txtPreIn.Text.Trim(); | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |             this.reportViewer1.LocalReport.ReportPath = getReportPath("requestPreInOrderQCode.rdlc")  ; | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[4]; | 
					
						
							|  |  |  |  |                 parameters[0] = new ReportParameter("vender", "test vender"); | 
					
						
							|  |  |  |  |                 parameters[1] = new ReportParameter("preInNo", orderNo); | 
					
						
							|  |  |  |  |                 parameters[2] = new ReportParameter("preInNo128", Util.getCode128(orderNo)); | 
					
						
							|  |  |  |  |                 parameters[3] = new ReportParameter("preInNoQ", Util.CreateQRcode(orderNo)); | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 //  reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             }catch(Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 showErrorMsg(er); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |           | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             return; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 orderNo =this.txtPreIn .Text.Trim(); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 using (ServiceReferenceStockInRequest.WmsInRequestClient client = new ServiceReferenceStockInRequest.WmsInRequestClient("BasicHttpBinding_IWmsInRequest", | 
					
						
							|  |  |  |  |             buildSvrAddress("WmsInRequestService.svc"))) { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                     dt = client.getPreInSumary(orderNo); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     showErrorMsg("预到单不存在"); | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |             //    dt.Columns.Add("barcode128"); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                     dr.BeginEdit();  | 
					
						
							|  |  |  |  |                     dr["barcode128"] = Util.getCode128(dr["主条码"].ToString());  | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                     dr.EndEdit(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |                 this.reportViewer1.LocalReport.ReportPath = getReportPath("requestPreInItemCode.rdlc")  ; | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 /* | 
					
						
							|  |  |  |  |                  * Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[3]; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 parameters[0] = new ReportParameter("rptTitle", WmsConstants.CURRENT_USER_ORG + "入库预到单"); | 
					
						
							|  |  |  |  |                 parameters[1] = new ReportParameter("operater", LoginInfo.Account); | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 parameters[2] = new ReportParameter("preinCode", Util.CreateQRcode(orderNo)); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |               //  BillPrint.Run(dt, reportName, PrinterType.A4, parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 */ | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void simpleButton2_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 // reqportPrint.printStockOutCode(client.getPickOrderTmsInfo("PICK060000026285")); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |                 //   this.reportViewer1.LocalReport.ReportPath = "wms_in_code.rdlc";// "DeiNiu.wms.Logical.reports.code_print.rdlc"; | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 DataTable dt; | 
					
						
							|  |  |  |  |                 string waveNo = txtWaveNo.Text; | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |         | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters =  | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                     new Microsoft.Reporting.WinForms.ReportParameter[0]; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 string reportName = WmsConstants.FILE_SVR_PRINT+ "pickOutDpsCode.rdlc"; | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.ReportPath = reportName;  | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 using (ServiceReferenceStockOutPickRequest.WmsOutPickRequestClient client = | 
					
						
							|  |  |  |  |                      new WmsOutPickRequestClient("BasicHttpBinding_IWmsOutPickRequest", | 
					
						
							|  |  |  |  |                               buildSvrAddress("WmsOutPickRequestService.svc"))) | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                     //dt = client.getPickVolInfo(waveNo, 1);// client.getPickInfo(waveNo); | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                     // string  query = (string.Format("takeBy = #{0};partion = #{1};isnull(lineId,0) = #{2};orderType = #{3};"                , 282, 0, 0, 0)); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     string query = (string.Format("pickOrderNo = #'{0}'", waveNo)); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                   //  query = (string.Format("take = #'{0}'", waveNo)); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                     dt = pickClient.getTasks(query, 0, 100).Tables[0]; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                     dr["barcode"] = Util.CreateQRcode(dr["id"].ToString() ); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                     if (!String.IsNullOrEmpty(dr["recType"].ToString())) | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                     { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                         dr["recTypeName"] = (enumStockRecordType)Convert.ToUInt16(dr["recType"].ToString()); | 
					
						
							|  |  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                          | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                         | 
					
						
							|  |  |  |  |                     if (!String.IsNullOrEmpty(dr["toWhType"].ToString())) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         dr["tranAreaName"] = (enumWhType)Convert.ToUInt16(dr["toWhType"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |   | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                 int rowCnt = dt.Rows.Count; | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", dt)); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 showErrorMsg(er, er.Message); | 
					
						
							|  |  |  |  |                 client.Close(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void simpleButton2_Click_1(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-03-06 20:48:05 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |                 DataTable dt = null; | 
					
						
							|  |  |  |  |                 using (ServiceCustomer.CustomerClient  client = | 
					
						
							|  |  |  |  |                    new CustomerClient("BasicHttpBinding_ICustomer", | 
					
						
							|  |  |  |  |                             buildSvrAddress("CustomerService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     //dt = client.getPickVolInfo(waveNo, 1);// client.getPickInfo(waveNo); | 
					
						
							|  |  |  |  |                     // string  query = (string.Format("takeBy = #{0};partion = #{1};isnull(lineId,0) = #{2};orderType = #{3};"                , 282, 0, 0, 0)); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     string query = ""; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //  query = (string.Format("take = #'{0}'", waveNo)); | 
					
						
							|  |  |  |  |                     dt = client.query(query, 0, 100).Tables[0]; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |                 dv.RowFilter = "custId like '130%' "; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                | 
					
						
							|  |  |  |  |                 foreach (DataRowView drv in dv) | 
					
						
							|  |  |  |  |                 {  this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                //int num = Convert.ToInt32(txtflowcnt.Text.Trim()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters | 
					
						
							|  |  |  |  |                     = new Microsoft.Reporting.WinForms.ReportParameter[3]; | 
					
						
							| 
									
										
										
										
											2024-03-06 20:48:05 +08:00
										 |  |  |  |                 this.reportViewer1.LocalReport.ReportPath = getReportPath("singleSimpleCode128.rdlc")  ;  | 
					
						
							|  |  |  |  |                    Customer customer = new Customer(drv.Row); | 
					
						
							|  |  |  |  |                     string code = customer.customerId; | 
					
						
							|  |  |  |  |                     string name = drv["custName"].ToString(); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                       | 
					
						
							| 
									
										
										
										
											2024-03-06 20:48:05 +08:00
										 |  |  |  |                     parameters[0] = new ReportParameter("flowNo",code ); | 
					
						
							|  |  |  |  |                     parameters[1] = new ReportParameter("flowNo128", Util.getCode128(code)); | 
					
						
							|  |  |  |  |                     parameters[2] = new ReportParameter("flowName", name);  | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-06 20:48:05 +08:00
										 |  |  |  |                   | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                     reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                     reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                     reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", new DataTable("table1"))); | 
					
						
							|  |  |  |  |                     this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 //   printIn.printFlowNos(txtflowName.Text, num); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-06 20:48:05 +08:00
										 |  |  |  |                 /* | 
					
						
							|  |  |  |  |                     this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |                //int num = Convert.ToInt32(txtflowcnt.Text.Trim()); | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters | 
					
						
							|  |  |  |  |                     = new Microsoft.Reporting.WinForms.ReportParameter[3]; | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.ReportPath = getReportPath("singleSimpleCode128.rdlc")  ;  | 
					
						
							|  |  |  |  |                 string code128 = txtSimpleCode.Text; | 
					
						
							|  |  |  |  |                 string code = txtSimpleDesc.Text; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 parameters[0] = new ReportParameter("flowCode", Util.CreateQRcode(code128)); | 
					
						
							|  |  |  |  |                 parameters[1] = new ReportParameter("flowNo", code128); | 
					
						
							|  |  |  |  |                 parameters[2] = new ReportParameter("flowName", code); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 //BillPrint.Run(new DataTable("tmp"), "simpleCode.rdlc", PrinterType.code, parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", new DataTable("table1"))); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 */ | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |               //  MessageBox.Show(er.InnerException.ToString()); | 
					
						
							|  |  |  |  |                 showErrorMsg(er); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void simpleButton3_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             DataTable dtResult = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |                 string orderNo = this.txtPickOrder.Text.Trim(); | 
					
						
							|  |  |  |  |                 using (TMService.TMServiceClient client = | 
					
						
							|  |  |  |  |                     new TMService.TMServiceClient("BasicHttpBinding_ITMService", | 
					
						
							|  |  |  |  |                      buildSvrAddress("TMService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dtResult = client.queryPickRequests4Report(orderNo); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (dtResult.Rows.Count == 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     showErrorMsg(" 不存在"); | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 WmsOutPickRequest wpr; | 
					
						
							|  |  |  |  |                 | 
					
						
							|  |  |  |  |                 printIn pi = new printIn(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 wpr = new WmsOutPickRequest(dtResult.Rows[0]); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 string sumPrice = Utils.Util.convertToChinese((Decimal)199999.99); //"壹佰贰拾伍元整"; | 
					
						
							|  |  |  |  |                         | 
					
						
							|  |  |  |  |                        // tmsClient.updatePickInvoice(wpr.pickOrderNo, wpr.invoiceNo); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 DataRow dr1 = dtResult.Rows[0]; | 
					
						
							|  |  |  |  |                 for (int i = 0; i < 10; i++) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     DataRow dr = dtResult.NewRow(); | 
					
						
							|  |  |  |  |                     for (int j = 0; j < dtResult.Columns.Count; j++) | 
					
						
							|  |  |  |  |                     {  | 
					
						
							|  |  |  |  |                         dr[j] = dr1[j]; | 
					
						
							|  |  |  |  |                     }   | 
					
						
							|  |  |  |  |                      dtResult.Rows.Add(dr); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |                  this.reportViewer1.LocalReport.ReportPath = getReportPath("pickOrder4Customer.rdlc")  ; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[5]; | 
					
						
							|  |  |  |  |                  | 
					
						
							|  |  |  |  |                 parameters[0] = new ReportParameter("rpHead", WmsConstants.CURRENT_USER_ORG + "随货同行单"); | 
					
						
							|  |  |  |  |                 parameters[1] = new ReportParameter("sumPrice", sumPrice); | 
					
						
							|  |  |  |  |                 parameters[2] = new ReportParameter("docNo", "1234"); | 
					
						
							|  |  |  |  |                 parameters[3] = new ReportParameter("address", "朝阳门大街1号"); | 
					
						
							|  |  |  |  |                 parameters[4] = new ReportParameter("phone", WmsConstants.CURRENT_WAREHOUSE_OUT_PHONE);  | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtResult)); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |         static string getReportPath(string reportName) | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |             string report = string.IsNullOrEmpty(WmsConstants.FILE_SVR_PRINT) ? "utils\\reports\\" : WmsConstants.FILE_SVR_PRINT + reportName; | 
					
						
							|  |  |  |  |             if (File.Exists(report)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 return report; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             return "utils\\reports\\" + reportName; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void lbA4_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnReceive_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             DataTable dt = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |                 string orderNo = this.txtPreRecieve.Text.Trim(); | 
					
						
							|  |  |  |  |                 using (ServiceReferenceStockInRequest.WmsInRequestClient client = new ServiceReferenceStockInRequest.WmsInRequestClient("BasicHttpBinding_IWmsInRequest", | 
					
						
							|  |  |  |  |             buildSvrAddress("WmsInRequestService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dt = client.getPreValidResult(orderNo); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     showErrorMsg("收货单不存在"); | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 dt.Columns.Add("barcode128"); | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dr.BeginEdit(); | 
					
						
							|  |  |  |  |                     dr["barcode128"] = Util.getCode128(dr["barCode"].ToString()); | 
					
						
							|  |  |  |  |                     dr.EndEdit(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |                 this.reportViewer1.LocalReport.ReportPath = getReportPath("preInMulti.rdlc")  ; | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[3]; | 
					
						
							|  |  |  |  |                 parameters[0] = new ReportParameter("rptTitle", WmsConstants.CURRENT_USER_ORG + "收货入库单"); | 
					
						
							|  |  |  |  |                 parameters[1] = new ReportParameter("operater", LoginInfo.Account); | 
					
						
							|  |  |  |  |                 parameters[2] = new ReportParameter("preinCode", Util.getCode128(orderNo)); | 
					
						
							|  |  |  |  |                 //  BillPrint.Run(dt, reportName, PrinterType.A4, parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void btnPrint_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             DataTable dt = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.reportViewer1.LocalReport.DataSources.Clear(); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |                 string orderNo = this.txtPandian.Text.Trim(); | 
					
						
							|  |  |  |  |                 using (StockLocationServiceClient client = | 
					
						
							|  |  |  |  |                    new StockLocationServiceClient("BasicHttpBinding_IStockLocationService", | 
					
						
							|  |  |  |  |                        string.Format("http://{0}/{1}", Park.svrUrl, "StockLocationService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dt = client.getPandianTargetItems(orderNo); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dr.BeginEdit(); | 
					
						
							|  |  |  |  |                     dr["locationId128"] = Util.getCode128(dr["locationId"].ToString()); | 
					
						
							|  |  |  |  |                     dr.EndEdit(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                   | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |                 this.reportViewer1.LocalReport.ReportPath = getReportPath("pandianItems.rdlc")  ; | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[3]; | 
					
						
							|  |  |  |  |                 parameters[0] = new ReportParameter("rptTitle", WmsConstants.CURRENT_USER_ORG + "盘点单"); | 
					
						
							|  |  |  |  |                 parameters[1] = new ReportParameter("operater", LoginInfo.Account); | 
					
						
							|  |  |  |  |                 parameters[2] = new ReportParameter("orderCode", Util.getCode128(orderNo)); | 
					
						
							|  |  |  |  |                 //  BillPrint.Run(dt, reportName, PrinterType.A4, parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.SetParameters(parameters); | 
					
						
							|  |  |  |  |                 reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; | 
					
						
							|  |  |  |  |                 reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dt)); | 
					
						
							|  |  |  |  |                 this.reportViewer1.RefreshReport(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } |