AHTC/RGD/RGD.WCS/FrmStackerCache.cs

65 lines
1.9 KiB
C#
Raw Permalink Normal View History

2025-05-19 09:22:33 +08:00
using RGD.DBUtility;
using System;
using System.Data;
using System.Windows.Forms;
namespace RGD.WCS
{
public partial class FrmStackerCache : Form
{
private static FrmStackerCache _formInstance;
public static FrmStackerCache FormInstance
{
get
{
if (_formInstance == null)
{
_formInstance = new FrmStackerCache();
}
return _formInstance;
}
set { _formInstance = value; }
}
public FrmStackerCache()
{
InitializeComponent();
}
private void FrmStackerCache_Load(object sender, EventArgs e)
{
comboBox1.Items.Clear();
DataTable dt = DbHelperSQL.Query("select * from t_base_device where f_devicekindindex=5 and F_DeviceIndex in(14001,14002)").Tables[0];
foreach (DataRow dr in dt.Rows)
{
comboBox1.Items.Add(dr["f_deviceindex"]);
}
comboBox1.SelectedIndex = 0;
}
private void button1_Click(object sender, EventArgs e)
{
string barcodes = textBox1.Text.Replace("\r\n", "|") + "|";
DbHelperSQL.ExecuteSql("update T_Base_PLC_Ask set F_BarCode='" + barcodes + "' where F_DeviceIndex='" + comboBox1.Text + "'");
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
DataTable dt = DbHelperSQL.Query("select F_BarCode from T_Base_PLC_Ask where F_DeviceIndex='" + comboBox1.Text + "'").Tables[0];
if (dt.Rows.Count > 0)
{
textBox1.Text = dt.Rows[0][0].ToString().Trim('|').Replace("|", "\r\n");
}
else
{
this.Close();
}
}
}
}