一厂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.

65 lines
2.2 KiB

2 weeks ago
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 carType)
2 weeks ago
{
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");
headTable.Columns.Add("Operater");
headTable.Columns.Add("CarType");
2 weeks ago
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"];
row["Operater"] = Program.UserName;
row["CarType"] = carType;
2 weeks ago
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()
{
1 day ago
string templateName = ConfigurationManager.AppSettings["BarCodeFormat"].ToString();
if(templateName == "MI")
{
return System.AppDomain.CurrentDomain.BaseDirectory + $"Report\\总成条码MI.grf";
}
else
{
return System.AppDomain.CurrentDomain.BaseDirectory + $"Report\\总成条码Hyundai.grf";
}
2 weeks ago
}
}
}