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.
54 lines
1.8 KiB
54 lines
1.8 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace PunchingMistake
|
|
{
|
|
public partial class FrmPlanSeach : Form
|
|
{
|
|
private string _planID = string.Empty;
|
|
|
|
public FrmPlanSeach(string planID)
|
|
{
|
|
InitializeComponent();
|
|
dataGridView1.AutoGenerateColumns = false;
|
|
this.StartPosition = FormStartPosition.CenterParent;
|
|
_planID = planID;
|
|
date1.Value = DateTime.Now.AddDays(-1);
|
|
btnSearch_Click(null, null);
|
|
}
|
|
|
|
private void btnSearch_Click(object sender, EventArgs e)
|
|
{
|
|
string d1 = date1.Value.ToString("yyyy-MM-dd 00:00:00:000");
|
|
string d2 = date2.Value.ToString("yyyy-MM-dd 23:59:59:000");
|
|
|
|
DataTable dt = Function2.GetPunchRecord(_planID, txtBarCode.Text, d1, d2);
|
|
dataGridView1.DataSource = dt;
|
|
}
|
|
|
|
private void btnRePrint_Click(object sender, EventArgs e)
|
|
{
|
|
if( dataGridView1.SelectedRows.Count == 0)
|
|
{
|
|
MessageBox.Show("请先选择数据.");
|
|
return;
|
|
}
|
|
DataRow row = (dataGridView1.SelectedRows[0].DataBoundItem as DataRowView).Row;
|
|
string partName = Function2.GetProductName(row["ZcPartNo"].ToString());
|
|
if (string.IsNullOrEmpty(partName))
|
|
{
|
|
MessageBox.Show($"总成零件号[{row["ZcPartNo"].ToString()}]在零件表中不存在.");
|
|
return;
|
|
}
|
|
Printer.PrintPunchAssembleBarCode(row["ZcBarCode"].ToString(), row["ZcPartNo"].ToString(), partName, row["SerialNo"].ToString());
|
|
|
|
}
|
|
}
|
|
}
|
|
|