| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Text; | 
					
						
							|  |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | //using DeiNiu.wms.Logical; | 
					
						
							|  |  |  |  | using DeiNiu.Utils; | 
					
						
							|  |  |  |  | using Microsoft.Reporting.WinForms; | 
					
						
							|  |  |  |  | using DeiNiu.wms.Data.Model; | 
					
						
							|  |  |  |  | using DeiNiu.wms.win.ServiceReferenceStockInRequest; | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  | using DeiNiu.wms.win.ServiceReferenceStockLocation; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | namespace DeiNiu.wms.win.utils.print | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |    public class printIn | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         /*WmsStock _stkObj; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public WmsStock stkObj | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (_stkObj == null) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     _stkObj = new WmsStock(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 return _stkObj; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |        */ | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public void printStockInCode(string orderNo) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             DataTable dt = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 /* | 
					
						
							|  |  |  |  |                 using (ServiceReferenceStockLocation.StockLocationServiceClient client = new ServiceReferenceStockLocation.StockLocationServiceClient()) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dt = client.getStockRecord(orderNo); | 
					
						
							|  |  |  |  |                 }*/ | 
					
						
							|  |  |  |  |                 using (WmsInRequestClient client = | 
					
						
							|  |  |  |  |                       new WmsInRequestClient("BasicHttpBinding_IWmsInRequest", | 
					
						
							|  |  |  |  |                           string.Format("http://{0}/{1}", Park.svrUrl, "WmsInRequestService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dt = client.getRequestInStockDetail(orderNo); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 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(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 string reportName =  "wms_requestInCodesNew.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |               //  Microsoft.Reporting.WinForms.ReportParameter[] parameters  | 
					
						
							|  |  |  |  |                  //   = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                // parameters[0] = new ReportParameter("PackNo", "-1"); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 BillPrint.Run(dt, reportName, PrinterType.code); | 
					
						
							|  |  |  |  |                 // new printUtils().print_report(dt, reportName, null, "code"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch(Exception e) | 
					
						
							|  |  |  |  |             {   | 
					
						
							|  |  |  |  |               throw e; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public void printStockInA4(string orderNo) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             DataTable dt = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 using (WmsInRequestClient client = | 
					
						
							|  |  |  |  |                      new WmsInRequestClient("BasicHttpBinding_IWmsInRequest", | 
					
						
							|  |  |  |  |                          string.Format("http://{0}/{1}", Park.svrUrl, "WmsInRequestService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dt = client.getRequestInStockDetail(orderNo); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 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(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 string reportName = "DeiNiu.wms.Logical.reports.wms_in_code.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 reportName =  "wms_requestInA4New.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 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); | 
					
						
							|  |  |  |  |                 BillPrint.Run(dt, reportName, PrinterType.A4, parameters); | 
					
						
							|  |  |  |  |                 // new printUtils().print_report(dt, reportName, null, "code"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  |                   | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         public static void printStockPreInA4(string orderNo) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |             DataTable dt = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 using ( WmsInRequestClient client = | 
					
						
							|  |  |  |  |                     new WmsInRequestClient("BasicHttpBinding_IWmsInRequest", | 
					
						
							|  |  |  |  |                         string.Format("http://{0}/{1}", Park.svrUrl, "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) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 {                    | 
					
						
							|  |  |  |  |                     dr.BeginEdit(); | 
					
						
							|  |  |  |  |                     dr["barcode128"] = Util.getCode128(dr["主条码"].ToString()); | 
					
						
							|  |  |  |  |                     dr.EndEdit(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 string  reportName = "requestPreInA4.rdlc"; | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[3]; | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 parameters[0] = new ReportParameter("rptTitle", WmsConstants.CURRENT_USER_ORG + "到货通知单"); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                 parameters[1] = new ReportParameter("operater", LoginInfo.Account); | 
					
						
							|  |  |  |  |                 parameters[2] = new ReportParameter("preinCode", Util.getCode128(orderNo)); | 
					
						
							|  |  |  |  |                 BillPrint.Run(dt, reportName, PrinterType.A4, parameters); | 
					
						
							|  |  |  |  |                 // new printUtils().print_report(dt, reportName, null, "code"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |         | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public static void printStockPreInCode(string orderNo,string venderName) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             DataTable dt = new DataTable("noname"); | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             {  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 string reportName =  "requestPreInOrderQCode.rdlc"; | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[4]; | 
					
						
							|  |  |  |  |                 parameters[0] = new ReportParameter("vender", venderName); | 
					
						
							|  |  |  |  |                 parameters[1] = new ReportParameter("preInNo", orderNo); | 
					
						
							|  |  |  |  |                 parameters[2] = new ReportParameter("preInNo128", Util.getCode128(orderNo)); | 
					
						
							|  |  |  |  |                 parameters[3] = new ReportParameter("preInNoQ", Util.CreateQRcode(orderNo)); | 
					
						
							|  |  |  |  |                 BillPrint.Run(dt, reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                  | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public static void printStockPreInItemsCode(string orderNo) | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             DataTable dt = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 using (WmsInRequestClient client = | 
					
						
							|  |  |  |  |                     new WmsInRequestClient("BasicHttpBinding_IWmsInRequest", | 
					
						
							|  |  |  |  |                         string.Format("http://{0}/{1}", Park.svrUrl, "WmsInRequestService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dt = client.getPreInSumary(orderNo); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dr.BeginEdit(); | 
					
						
							|  |  |  |  |                     dr["barcode128"] = Util.getCode128(dr["主条码"].ToString()); | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |                     dr["温度"] = Convert.ToDecimal( dr["virtialCount"].ToString()); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                     dr.EndEdit(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 string reportName =  "requestPreInItemCode.rdlc"; | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  |                 BillPrint.Run(dt, reportName, PrinterType.code, null); | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 // new printUtils().print_report(dt, reportName, null, "code"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public static void printStockReceiveMulti(string orderNo) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             DataTable dt = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 using (WmsInRequestClient client = | 
					
						
							|  |  |  |  |                     new WmsInRequestClient("BasicHttpBinding_IWmsInRequest", | 
					
						
							|  |  |  |  |                         string.Format("http://{0}/{1}", Park.svrUrl, "WmsInRequestService.svc"))) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dt = client.getPreValidResult(orderNo); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                  dt.Columns.Add("barcode128"); | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     dr.BeginEdit(); | 
					
						
							|  |  |  |  |                     dr["barcode128"] = Util.getCode128(dr["barCode"].ToString()); | 
					
						
							|  |  |  |  |                     dr.EndEdit(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 string reportName =  "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.pin, parameters); | 
					
						
							|  |  |  |  |                 // new printUtils().print_report(dt, reportName, null, "code"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         public static void printPandianItemsMulti(string orderNo) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             DataTable dt = null; | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 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(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 string reportName =  "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)); | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |                 BillPrint.Run(dt, reportName, PrinterType.A4, parameters); | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 // new printUtils().print_report(dt, reportName, null, "code"); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         public  void printStockIn(string orderNo) | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 printStockInA4(orderNo); | 
					
						
							|  |  |  |  |                 printStockInCode(orderNo); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |        /// <summary> | 
					
						
							|  |  |  |  |        /// 打印下架单 | 
					
						
							|  |  |  |  |        /// 1.判断是不是播种下架单 | 
					
						
							|  |  |  |  |        /// 2.判断是不是拆零单 | 
					
						
							|  |  |  |  |        /// </summary> | 
					
						
							|  |  |  |  |        /// <param name="dt"></param> | 
					
						
							|  |  |  |  |       public void printStockOutCode(DataTable dt,bool isPrintBoxs) | 
					
						
							|  |  |  |  |       { | 
					
						
							|  |  |  |  |             | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |               { | 
					
						
							|  |  |  |  |                   return; | 
					
						
							|  |  |  |  |               } | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |               string reportName =  "pickOutSeedsBulk.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |              | 
					
						
							|  |  |  |  |               int volType = 0;  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |               int cnt = 0; | 
					
						
							|  |  |  |  |               string waveNo,jobNo,locationId; | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  |               DataTable dnew = new DataTable("report"); | 
					
						
							|  |  |  |  |               foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |               { | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                   //volType = Convert.ToInt32(dr["volType"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                   waveNo = dr["waveOrder"].ToString() ; | 
					
						
							|  |  |  |  |                        | 
					
						
							|  |  |  |  |                   if (volType == 0) //bulk pick | 
					
						
							|  |  |  |  |                   { | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                         reportName =  "pickOutDpsBatch.rdlc";// "pickOutSeedsBulk.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                       jobNo=dr["jobNo"].ToString(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                       dv.RowFilter = string.Format("waveOrder= '{0}' and jobNo ='{1}'", waveNo, jobNo); | 
					
						
							|  |  |  |  |                       foreach (DataRowView drv in dv) | 
					
						
							|  |  |  |  |                       { | 
					
						
							|  |  |  |  |                           if (String.IsNullOrEmpty(drv.Row["tranAreaName"].ToString())) | 
					
						
							|  |  |  |  |                           { | 
					
						
							|  |  |  |  |                               drv.Row["tranAreaName"] = "分播区1"; | 
					
						
							|  |  |  |  |                           } | 
					
						
							|  |  |  |  |                       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                       Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  |                       parameters[0] = new ReportParameter("job128", Util.getCode128(jobNo));  | 
					
						
							|  |  |  |  |                       BillPrint.Run(dv.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |                       cnt++; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                   } | 
					
						
							|  |  |  |  |                   else //batch pick | 
					
						
							|  |  |  |  |                   { | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                       int outStoreType = Convert.ToInt32(dt.Rows[0]["outStoreType"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                       if (outStoreType == (int)enumOutStoreType.拣货出库) //dps | 
					
						
							|  |  |  |  |                       { | 
					
						
							|  |  |  |  |                           printStockOutCodeTypePick(dt, isPrintBoxs); | 
					
						
							|  |  |  |  |                            return; | 
					
						
							|  |  |  |  |                       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                       if (outStoreType == (int)enumOutStoreType.补货出库) //dps | 
					
						
							|  |  |  |  |                       { | 
					
						
							|  |  |  |  |                           printStockOutCodeTypePick(dt, true); | 
					
						
							|  |  |  |  |                           return; | 
					
						
							|  |  |  |  |                       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                       reportName = "pickOutSeedsBatch.rdlc"; | 
					
						
							|  |  |  |  |                       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); | 
					
						
							|  |  |  |  |                       cnt++; | 
					
						
							|  |  |  |  |                   } | 
					
						
							|  |  |  |  |                   if (cnt == 2) | 
					
						
							|  |  |  |  |                   { | 
					
						
							|  |  |  |  |                       break; | 
					
						
							|  |  |  |  |                   } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception er) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw er; | 
					
						
							|  |  |  |  |               // return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         public void printSeedsLightCode(DataTable dt ) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |            | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 string reportName = "pickOutSeedsJob5.5.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |                 int volType = 0; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |                 int cnt = 0; | 
					
						
							|  |  |  |  |                 string waveNo, jobNo, locationId; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 DataTable dnew = new DataTable("report"); | 
					
						
							|  |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2024-02-06 19:36:47 +08:00
										 |  |  |  |                     dr["jobCode128"] = Util.CreateQRcode(dr["jobNo"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                     /* | 
					
						
							|  |  |  |  |                      //volType = Convert.ToInt32(dr["volType"].ToString()); | 
					
						
							|  |  |  |  |                      waveNo = dr["waveOrder"].ToString();  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                          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["jobCode128"] = Util.getCode128(drv.Row["barcode"].ToString()); | 
					
						
							|  |  |  |  |                              //  drv.Row["tranAreaName"] = "分播区1"; | 
					
						
							|  |  |  |  |                          } | 
					
						
							|  |  |  |  |                          */ | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //  parameters[0] = new ReportParameter("pickNo", Util.getCode128(dt.Rows[0]["pickOrderNo"].ToString())); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //   cnt++; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     // if (cnt == 2)// | 
					
						
							|  |  |  |  |                     //   { | 
					
						
							|  |  |  |  |                     //     break; | 
					
						
							|  |  |  |  |                     //  } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 }   | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[0]; | 
					
						
							|  |  |  |  |                      BillPrint.Run(dv.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  |                 // return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 所有PDA 拣货 | 
					
						
							|  |  |  |  |         /// 不分货位类型 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="dt"></param> | 
					
						
							|  |  |  |  |         /// <param name="isPrintBoxs"></param> | 
					
						
							|  |  |  |  |         public void printPickCode(DataTable dt ) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             try | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |                 string reportName =  "pickOutDpsCode.rdlc";// "pickOutSeedsBulk.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |                 foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |                 {  | 
					
						
							|  |  |  |  |                   //  dr["barcode"] = Util.getCode128(dr["barcode"].ToString()); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     dr["barcode"] = Util.CreateQRcode(dr["id"].ToString()); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                  //   WmsOutPickPort wop = new WmsOutPickPort(dr); | 
					
						
							|  |  |  |  |                  //   dr["recTypeName"] = (enumStockRecordType)wop.recType; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     if (!String.IsNullOrEmpty(dr["recType"].ToString())) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         dr["recTypeName"] = (enumStockRecordType)Convert.ToUInt16(dr["recType"].ToString()); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     if (!String.IsNullOrEmpty(dr["toWhType"].ToString())) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         dr["tranAreaName"] = (enumWhType)Convert.ToUInt16(dr["toWhType"].ToString()); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                        | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 | 
					
						
							|  |  |  |  |                 Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[0]; | 
					
						
							|  |  |  |  |                 // parameters[0] = new ReportParameter("job128", Util.getCode128(jobNo)); | 
					
						
							|  |  |  |  |                 BillPrint.Run(dt, reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |                     | 
					
						
							|  |  |  |  |                       | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             catch (Exception er) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 throw er; | 
					
						
							|  |  |  |  |                 // return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public void printStockOutCodeTypePick(DataTable dt, bool isPrintBoxs) | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |       { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |               { | 
					
						
							|  |  |  |  |                   return; | 
					
						
							|  |  |  |  |               } | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |               string reportName =  "pickOutDpsBatch.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |               string locationId, pickNo;  | 
					
						
							|  |  |  |  |               int boxcnt; | 
					
						
							|  |  |  |  |               Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  |               DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |               foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |               { | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                   boxcnt = Convert.ToInt32(dt.Rows[0]["boxcnt"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                   locationId = dr["locationId"].ToString(); | 
					
						
							|  |  |  |  |                   pickNo = dr["pickOrderNo"].ToString(); | 
					
						
							|  |  |  |  |                   parameters[0] = new ReportParameter("boxs", string.Format("共{0}件", boxcnt)); | 
					
						
							|  |  |  |  |                   dv.RowFilter = string.Format("pickOrderNo= '{0}' and locationId ='{1}'", pickNo, locationId);  | 
					
						
							|  |  |  |  |                   foreach (DataRowView drv in dv) | 
					
						
							|  |  |  |  |                   { | 
					
						
							|  |  |  |  |                       drv.Row["ownerName"] = Util.getCode128(drv.Row["barcode"].ToString()); | 
					
						
							|  |  |  |  |                       //drv.Row["tranAreaName"] = "分播区1"; | 
					
						
							|  |  |  |  |                   } | 
					
						
							|  |  |  |  |                   if (isPrintBoxs && WmsConstants.OUT_BATCH_PICK_PRINT_CODE_EACH_BOX) | 
					
						
							|  |  |  |  |                   { | 
					
						
							|  |  |  |  |                       for (int i = 0; i < boxcnt; i++) | 
					
						
							|  |  |  |  |                       { | 
					
						
							|  |  |  |  |                           parameters[0] = new ReportParameter("boxs", string.Format("{0}/{1}件", i + 1, boxcnt)); | 
					
						
							|  |  |  |  |                           BillPrint.Run(dv.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                       } | 
					
						
							|  |  |  |  |                       continue; | 
					
						
							|  |  |  |  |                   } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                   BillPrint.Run(dv.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception er) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw er; | 
					
						
							|  |  |  |  |               // return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       public void printStockRepPick(DataTable dt, bool isPrintBoxs) | 
					
						
							|  |  |  |  |       { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |               { | 
					
						
							|  |  |  |  |                   return; | 
					
						
							|  |  |  |  |               } | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |               string reportName =  "pickOutRepBatch.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |               //string recId, pickNo; | 
					
						
							|  |  |  |  |              // int boxcnt; | 
					
						
							|  |  |  |  |              // Microsoft.Reporting.WinForms.ReportParameter[] parameters = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  |               DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |               // dv.Sort = "recordId"; | 
					
						
							|  |  |  |  |               dv.Sort = "locationId"; | 
					
						
							|  |  |  |  |               BillPrint.Run(dv.ToTable(), reportName, PrinterType.code ); | 
					
						
							|  |  |  |  |               /* | 
					
						
							|  |  |  |  |               foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |               { | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                   boxcnt = Convert.ToInt32(dt.Rows[0]["boxcnt"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                   recId = dr["recordId"].ToString(); | 
					
						
							|  |  |  |  |                   pickNo = dr["pickOrderNo"].ToString(); | 
					
						
							|  |  |  |  |                   parameters[0] = new ReportParameter("boxs", string.Format("共{0}件", boxcnt)); | 
					
						
							|  |  |  |  |                   dv.RowFilter = string.Format("recordId= '{0}'",  recId);  | 
					
						
							|  |  |  |  |                     | 
					
						
							|  |  |  |  |                    BillPrint.Run(dv.ToTable(), reportName, PrinterType.code, parameters);  | 
					
						
							|  |  |  |  |                }*/ | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 //  BillPrint.Run(dv.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |            }  | 
					
						
							|  |  |  |  |           catch (Exception er) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw er; | 
					
						
							|  |  |  |  |               // return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  |       public void printStockOutA4(DataTable dt) | 
					
						
							|  |  |  |  |       { | 
					
						
							|  |  |  |  |           if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         //  dt.Columns.Add(new DataColumn("id128")); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |            | 
					
						
							|  |  |  |  |           foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               if (!string.IsNullOrEmpty(dr["id128"].ToString())) | 
					
						
							|  |  |  |  |               { | 
					
						
							|  |  |  |  |                   continue; | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  |               dr.BeginEdit(); | 
					
						
							|  |  |  |  |               dr["id128"] = Util.getCode128(dr["id"].ToString()); | 
					
						
							|  |  |  |  |               dr.EndEdit(); | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |                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())); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |               string reportName =  "pickOrderBatchOutA4.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |               BillPrint.Run(dt, reportName, PrinterType.A4,parameters); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							| 
									
										
										
										
											2023-11-21 19:18:23 +08:00
										 |  |  |  |       public static void printStockOutInvoice(DataTable dt,string sumPrice) | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |       { | 
					
						
							|  |  |  |  |           if (dt.Rows.Count == 0) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               return; | 
					
						
							|  |  |  |  |           }  | 
					
						
							|  |  |  |  |           ReportParameter[] parameters = new ReportParameter[5]; | 
					
						
							|  |  |  |  |           parameters[0] = new ReportParameter("rpHead", WmsConstants.CURRENT_USER_ORG + "随货同行单"); | 
					
						
							|  |  |  |  |           parameters[1] = new ReportParameter("sumPrice", sumPrice); | 
					
						
							|  |  |  |  |           parameters[2] = new ReportParameter("docNo", WmsConstants.CURRENT_WAREHOUSE_OUT_DOCNO); | 
					
						
							|  |  |  |  |           parameters[3] = new ReportParameter("address", WmsConstants.CURRENT_WAREHOUSE_ADDRESS); | 
					
						
							|  |  |  |  |           parameters[4] = new ReportParameter("phone", WmsConstants.CURRENT_WAREHOUSE_OUT_PHONE);  | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |           string reportName =  "pickOrder4Customer.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |           BillPrint.Run(dt, reportName, PrinterType.pin, parameters); | 
					
						
							|  |  |  |  |             | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  |       public void printSeedsPickOrderCode(DataTable dt) | 
					
						
							|  |  |  |  |       {  | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           {  | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |               string reportName =  "seedsPickOrder.rdlc";  | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |               BillPrint.Run(dt, reportName, PrinterType.code); | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception er) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw er; | 
					
						
							|  |  |  |  |               // return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  |       public void printBulkValidError(DataTable dt) | 
					
						
							|  |  |  |  |       { | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |               string reportName =  "pickBulkValidtionError.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |               BillPrint.Run(dt, reportName, PrinterType.code); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception er) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw er; | 
					
						
							|  |  |  |  |               // return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  |       public bool printBulkPacking(DataTable dt ) | 
					
						
							|  |  |  |  |       { | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |               string reportName =  "pickOrderBulks.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               Microsoft.Reporting.WinForms.ReportParameter[] parameters  | 
					
						
							|  |  |  |  |                   = new Microsoft.Reporting.WinForms.ReportParameter[2]; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |               { | 
					
						
							|  |  |  |  |                   parameters[1] = new ReportParameter("pickNo",Util.getCode128(dr["pickOrderNo"].ToString())); | 
					
						
							|  |  |  |  |                   break; | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |              // parameters[1] = new ReportParameter("pickNo", Util.getCode128("052759" + "")); | 
					
						
							|  |  |  |  |               DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |               DataTable dtBulks;  | 
					
						
							|  |  |  |  |               //打印拼袋单 | 
					
						
							|  |  |  |  |               dv.RowFilter = string.Format("volType={0}",(int)enumWhLocVol.散货拼袋); | 
					
						
							|  |  |  |  |              // parameters[0] = new ReportParameter("bulksPackCnt","共"+ dv.Count + "袋"); | 
					
						
							|  |  |  |  |               dtBulks = dv.ToTable(); | 
					
						
							|  |  |  |  |               DataView dv2 = dtBulks.DefaultView; | 
					
						
							|  |  |  |  |               for (int i = 0; i < dtBulks.Rows.Count; i++) | 
					
						
							|  |  |  |  |               { | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                   int id = Convert.ToInt32(dtBulks.Rows[i]["id"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                   dv2.RowFilter = string.Format("id={0}",id); | 
					
						
							|  |  |  |  |                   parameters[0] = new ReportParameter("packNo","第 " + (i+1) + "/"+ dv.Count + " 拼袋"  ); | 
					
						
							|  |  |  |  |                   BillPrint.Run(dv2.ToTable(), reportName, PrinterType.code, parameters);   | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  |                //打印拼箱单 | 
					
						
							|  |  |  |  |               dv.RowFilter = string.Format("volType={0}", (int)enumWhLocVol.散货拼箱); | 
					
						
							|  |  |  |  |               //parameters[0] = new ReportParameter("bulksPackCnt", "共" + dv.Count + "箱"); | 
					
						
							|  |  |  |  |               dtBulks = dv.ToTable(); | 
					
						
							|  |  |  |  |               dv2 = dtBulks.DefaultView; | 
					
						
							|  |  |  |  |               for (int i = 0; i < dtBulks.Rows.Count; i++) | 
					
						
							|  |  |  |  |               { | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                   int id = Convert.ToInt32(dtBulks.Rows[i]["id"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                   dv2.RowFilter = string.Format("id={0}", id); | 
					
						
							|  |  |  |  |                   parameters[0] = new ReportParameter("packNo", "第 " + (i+1) + "/" + dv.Count + " 拼箱"); | 
					
						
							|  |  |  |  |                   BillPrint.Run(dv2.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  |               return true; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch(Exception er) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw er; | 
					
						
							|  |  |  |  |              // return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       public bool printBulkPackingNoStore(DataTable dt, int boxes, int bags) | 
					
						
							|  |  |  |  |       { | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							| 
									
										
										
										
											2023-12-03 22:13:49 +08:00
										 |  |  |  |               string reportName =  "pickOrderBulks.rdlc"; | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               Microsoft.Reporting.WinForms.ReportParameter[] parameters | 
					
						
							|  |  |  |  |                   = new Microsoft.Reporting.WinForms.ReportParameter[2]; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               foreach (DataRow dr in dt.Rows) | 
					
						
							|  |  |  |  |               { | 
					
						
							|  |  |  |  |                   parameters[1] = new ReportParameter("pickNo", Util.getCode128(dr["pickOrderNo"].ToString())); | 
					
						
							|  |  |  |  |                   break; | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               // parameters[1] = new ReportParameter("pickNo", Util.getCode128("052759" + "")); | 
					
						
							|  |  |  |  |               DataView dv = dt.DefaultView; | 
					
						
							|  |  |  |  |               DataTable dtBulks; | 
					
						
							|  |  |  |  |               //打印拼袋单 | 
					
						
							|  |  |  |  |               dv.RowFilter = string.Format("volType={0}", (int)enumWhLocVol.散货拼袋); | 
					
						
							|  |  |  |  |               // parameters[0] = new ReportParameter("bulksPackCnt","共"+ dv.Count + "袋"); | 
					
						
							|  |  |  |  |               dtBulks = dv.ToTable(); | 
					
						
							|  |  |  |  |               DataView dv2 = dtBulks.DefaultView; | 
					
						
							|  |  |  |  |               for (int i = 0; i < bags; i++) | 
					
						
							|  |  |  |  |               { | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                   int id = Convert.ToInt32(dtBulks.Rows[i]["id"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                   dv2.RowFilter = string.Format("id={0}", id); | 
					
						
							|  |  |  |  |                   parameters[0] = new ReportParameter("packNo", "第 " + (i + 1) + "/" + bags + " 拼袋"); | 
					
						
							|  |  |  |  |                   BillPrint.Run(dv2.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  |               //打印拼箱单 | 
					
						
							|  |  |  |  |               dv.RowFilter = string.Format("volType={0}", (int)enumWhLocVol.散货拼箱); | 
					
						
							|  |  |  |  |               //parameters[0] = new ReportParameter("bulksPackCnt", "共" + dv.Count + "箱"); | 
					
						
							|  |  |  |  |               dtBulks = dv.ToTable(); | 
					
						
							|  |  |  |  |               dv2 = dtBulks.DefaultView; | 
					
						
							|  |  |  |  |               for (int i = 0; i < boxes; i++) | 
					
						
							|  |  |  |  |               { | 
					
						
							| 
									
										
										
										
											2023-09-04 22:41:19 +08:00
										 |  |  |  |                   int id = Convert.ToInt32(dtBulks.Rows[i]["id"].ToString()); | 
					
						
							| 
									
										
										
										
											2023-05-23 16:13:17 +08:00
										 |  |  |  |                   dv2.RowFilter = string.Format("id={0}", id); | 
					
						
							|  |  |  |  |                   parameters[0] = new ReportParameter("packNo", "第 " + (i + 1) + "/" + boxes + " 拼箱"); | 
					
						
							|  |  |  |  |                   BillPrint.Run(dv2.ToTable(), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |               } | 
					
						
							|  |  |  |  |               return true; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception er) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw er; | 
					
						
							|  |  |  |  |               // return; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       public void printLightId(int minId,int maxId,int id) | 
					
						
							|  |  |  |  |       { | 
					
						
							|  |  |  |  |            | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               string reportName = "light.rdlc"; | 
					
						
							|  |  |  |  |                  Microsoft.Reporting.WinForms.ReportParameter[] parameters  | 
					
						
							|  |  |  |  |                  = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                  if (id > 0) | 
					
						
							|  |  |  |  |                  { | 
					
						
							|  |  |  |  |                      parameters[0] = new ReportParameter("lightId", "" + id); | 
					
						
							|  |  |  |  |                      BillPrint.Run(new DataTable("table1"), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |                  } | 
					
						
							|  |  |  |  |                  else | 
					
						
							|  |  |  |  |                  { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                      for (int i = minId; i < maxId; i = i + 4) | 
					
						
							|  |  |  |  |                      { | 
					
						
							|  |  |  |  |                          parameters[0] = new ReportParameter("lightId", "" + i); | 
					
						
							|  |  |  |  |                          BillPrint.Run(new DataTable("table1"), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |                      } | 
					
						
							|  |  |  |  |                  } | 
					
						
							|  |  |  |  |               | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception e) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw e; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  |       public static void printFlowNos(string flowName,int count) | 
					
						
							|  |  |  |  |       {  | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               string reportName = "flowCode.rdlc"; | 
					
						
							|  |  |  |  |           | 
					
						
							|  |  |  |  |               DataTable dt = new DataTable(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 dt.Columns.Add("code128"); | 
					
						
							|  |  |  |  |                 dt.Columns.Add("code"); | 
					
						
							|  |  |  |  |                 dt.Columns.Add("title");  | 
					
						
							|  |  |  |  |                 for (int i = 0; i < count; i++) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     string flowno = Util.getTimeStamp() + ""; | 
					
						
							|  |  |  |  |                     flowno = flowno.Substring(6); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     DataRow dr = dt.NewRow(); | 
					
						
							|  |  |  |  |                     dr["code128"] = Util.getCode128(flowno); | 
					
						
							|  |  |  |  |                     dr["code"] = flowno; | 
					
						
							|  |  |  |  |                     dr["title"] = flowName; | 
					
						
							|  |  |  |  |                     dt.Rows.Add(dr);  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 }  | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 BillPrint.Run(dt, reportName, PrinterType.code ); | 
					
						
							|  |  |  |  |                 | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception e) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw e; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  |       public void printController(string controller1) | 
					
						
							|  |  |  |  |       { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               string reportName = "controller.rdlc"; | 
					
						
							|  |  |  |  |               Microsoft.Reporting.WinForms.ReportParameter[] parameters | 
					
						
							|  |  |  |  |               = new Microsoft.Reporting.WinForms.ReportParameter[1]; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |               parameters[0] = new ReportParameter("controller1", controller1);  | 
					
						
							|  |  |  |  |               BillPrint.Run(new DataTable("table1"), reportName, PrinterType.code, parameters); | 
					
						
							|  |  |  |  |                | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception e) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw e; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       public static void printSimple(string code,string desc) | 
					
						
							|  |  |  |  |       {  | 
					
						
							|  |  |  |  |           try | 
					
						
							|  |  |  |  |           {  | 
					
						
							|  |  |  |  |               Microsoft.Reporting.WinForms.ReportParameter[] parameters | 
					
						
							|  |  |  |  |               = new Microsoft.Reporting.WinForms.ReportParameter[3];  | 
					
						
							|  |  |  |  |               parameters[0] = new ReportParameter("flowCode", Util.getCode128(code)); | 
					
						
							|  |  |  |  |               parameters[1] = new ReportParameter("flowNo", code);  | 
					
						
							|  |  |  |  |               parameters[2] = new ReportParameter("flowName", desc);  | 
					
						
							|  |  |  |  |               BillPrint.Run(new DataTable("tmp"), "simpleCode.rdlc", PrinterType.code, parameters); | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |           catch (Exception e) | 
					
						
							|  |  |  |  |           { | 
					
						
							|  |  |  |  |               throw e; | 
					
						
							|  |  |  |  |           } | 
					
						
							|  |  |  |  |       } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |