BaoKai_202508-Wcs-Jingwang..../WCSIce/Form_TaskInfo.cs
2025-08-24 12:51:29 +08:00

173 lines
5.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
namespace WCS
{
public partial class Form_TaskInfo : DevExpress.XtraEditors.XtraForm
{
public Form_TaskInfo()
{
InitializeComponent();
}
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
}
private void Form_TaskInfo_Load(object sender, EventArgs e)
{
GetData();
}
private void GetData()
{
string errText = string.Empty;
try
{
DataTable iningtask = DataClass.Instance().GetiningGoodsDecidOhp(ref errText);
if (errText.Length > 0)
{
MessageBox.Show("查询AGV送达接驳口任务异常:" + errText);
return;
}
if (iningtask != null)
{
if (iningtask.Rows.Count > 0)
{
if (gridControl2.InvokeRequired)
{
// 如果当前线程不是UI线程则使用Invoke在UI线程上调用此方法
gridControl2.Invoke(new MethodInvoker(delegate
{
gridControl2.DataSource = iningtask;
}));
}
else
{
// 如果当前线程已经是UI线程则直接设置DataSource
gridControl2.DataSource = iningtask;
}
}
}
DataTable SSJRK = DataClass.Instance().Get_T_AGV_IN_SSJ(ref errText);
if (errText.Length > 0)
{
MessageBox.Show("查询AGV请求放货任务异常:" + errText);
return;
}
if (SSJRK != null)
{
if (SSJRK.Rows.Count > 0)
{
if (gridControl1.InvokeRequired)
{
// 如果当前线程不是UI线程则使用Invoke在UI线程上调用此方法
gridControl1.Invoke(new MethodInvoker(delegate
{
gridControl1.DataSource = SSJRK;
}));
}
else
{
// 如果当前线程已经是UI线程则直接设置DataSource
gridControl1.DataSource = SSJRK;
}
//gridControl1.DataSource = SSJRK;
}
}
//DataClass.Instance().DELETE_DATA();
}
catch (Exception ex)
{
//AddText("查询出入库任务异常错误 :" + ex.Message);
}
}
private void button5_Click(object sender, EventArgs e)
{
GetData();
}
private void button1_Click(object sender, EventArgs e)
{
GetData();
}
private void button4_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确定要删除AGV任务号:" + lblSSJid.Text + "吗?", "删除前确认", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
if (DataClass.Instance().DEL_T_AGV_IN_SSJ(lblSSJid.Text.Trim()) > 0)
{
MessageBox.Show("AGV任务号:" + lblSSJid.Text + "删除数据成功");
lblSSJid.Text = "0";
}
}
else
{
return;
}
}
private void button2_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确定要删除PLC任务号:" + lblPlcId.Text + "吗?", "删除前确认", MessageBoxButtons.OKCancel) == DialogResult.OK)
{
if (DataClass.Instance().DEL_T_AGV_TO_WCS_TASK(int.Parse(lblPlcId.Text)) > 0)
{
MessageBox.Show("PLC任务号:" + lblPlcId.Text + "删除数据成功");
}
lblPlcId.Text = "0";
}
else
{
return;
}
}
private void gridView1_Click(object sender, EventArgs e)
{
try
{
if (gridView1.RowCount == 0)
{
return;
}
lblSSJid.Text = gridView1.GetFocusedRowCellValue("taskCode").ToString();
}
catch { }
}
private void gridView3_Click(object sender, EventArgs e)
{
try
{
if (gridView3.RowCount == 0)
{
return;
}
lblPlcId.Text = gridView3.GetFocusedRowCellValue("PLCID").ToString();
}
catch { }
}
}
}