一厂MES,含注塑,喷涂,冲孔
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

55 lines
1.8 KiB

using grproLib;
using InjectionPC;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PunchingMistake
{
public class Printer
{
/// <summary>
/// 小件总成装配打印总成条码
/// </summary>
public static void PrintPunchAssembleBarCode( string barCode, string partNo1, string partName, string serialNo)
{
string filename = GetPrintFileName();
DataTable headTable = new DataTable();
headTable.Columns.Add("BarCode");
headTable.Columns.Add("PartName");
headTable.Columns.Add("PartNo");
headTable.Columns.Add("BatchNo");
headTable.Columns.Add("SerialNo");
headTable.Columns.Add("Line");
DataRow row = headTable.NewRow();
row["BarCode"] = barCode;
row["PartNo"] = partNo1;
row["PartName"] = partName;
row["BatchNo"] = DateTime.Now.ToString("yyMMdd");
row["SerialNo"] = serialNo;
row["Line"] = ConfigurationManager.AppSettings["Line"];
string printBoxName = "Printer1";
string reportName = ConfigurationManager.AppSettings[printBoxName].ToString();
headTable.Rows.Add(row);
ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoLandscape, 1, reportName);
rp.Report.Print(false);
}
static string GetPrintFileName()
{
if (Program.station == "F01")
{
return System.AppDomain.CurrentDomain.BaseDirectory + "Report\\总成条码MI.grf";
}
return System.AppDomain.CurrentDomain.BaseDirectory + "Report\\总成条码MI.grf";
}
}
}