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.
114 lines
3.6 KiB
114 lines
3.6 KiB
5 months ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.ComponentModel;
|
||
|
using System.Data;
|
||
|
using System.Drawing;
|
||
|
using System.Text;
|
||
|
using System.Windows.Forms;
|
||
|
using DBFactory;
|
||
|
namespace wcfControlMonitorClient
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Creator:Richard.liu
|
||
|
/// ��̨״̬����
|
||
|
/// </summary>
|
||
|
public partial class FrmWorkstationStatus : Form
|
||
|
{
|
||
|
#region ��������
|
||
|
DBOperator dbo = CStaticClass.dbo;
|
||
|
DBOperator dboM = CStaticClass.dboM;
|
||
|
Model.MDevice _device = null;
|
||
|
int _deviceIndex;
|
||
|
/// <summary>
|
||
|
/// ����Ҫ��ʾ���豸����
|
||
|
/// </summary>
|
||
|
public int DeviceIndex
|
||
|
{
|
||
|
set { _deviceIndex = value;}
|
||
|
}
|
||
|
#endregion
|
||
|
|
||
|
#region ���캯��/��ʼ��
|
||
|
public FrmWorkstationStatus()
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
}
|
||
|
|
||
|
private void FrmDeviceStatus_Load(object sender, EventArgs e)
|
||
|
{
|
||
|
btnRefresh_Click(null, EventArgs.Empty);
|
||
|
}
|
||
|
#endregion
|
||
|
|
||
|
#region �����豸״̬
|
||
|
private void btnRefresh_Click(object sender, EventArgs e)
|
||
|
{
|
||
|
//20100108
|
||
|
DataView dv;
|
||
|
try
|
||
|
{
|
||
|
_device = Model.CGetInfo.GetDeviceInfo(_deviceIndex);
|
||
|
//�豸����
|
||
|
this.lblDeviceIndex.Text = _device.DeviceIndex.ToString();
|
||
|
//�豸����
|
||
|
this.lblDeviceName.Text = _device.DeviceName;
|
||
|
dv = dbo.ExceSQL("SELECT F_Address FROM T_Base_AGV_Gate WHERE (F_AGVGateDeviceIndex = " + _deviceIndex + ")").Tables[0].DefaultView;
|
||
|
if (dv.Count > 0)
|
||
|
{
|
||
|
//AGV��ַ
|
||
|
this.lblAGVAddress.Text = dv[0]["F_Address"].ToString();
|
||
|
}
|
||
|
dv = dbo.ExceSQL("SELECT F_PALLETBARCODE FROM T_Base_Device WHERE (F_DeviceIndex = " + _deviceIndex + ")").Tables[0].DefaultView;
|
||
|
if (dv.Count > 0)
|
||
|
{
|
||
|
//��������
|
||
|
|
||
|
this.lblPALLETBARCODE.Text = dv[0]["F_PALLETBARCODE"].ToString();
|
||
|
}
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
throw ex;
|
||
|
}
|
||
|
finally
|
||
|
{
|
||
|
dv = null;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
#endregion
|
||
|
|
||
|
#region �رմ���
|
||
|
private void btnClose_Click(object sender, EventArgs e)
|
||
|
{
|
||
|
this.Close();
|
||
|
}
|
||
|
#endregion
|
||
|
|
||
|
private void button5_Click(object sender, EventArgs e)
|
||
|
{
|
||
|
if (MessageBox.Show("��ȷ�ϡ���̨�����̡�����", "������ʾ��", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
//20090817����������������Ϣ
|
||
|
dboM.ExecuteSql("UPDATE T_ITEMDEVICE SET devicestatus ='0' WHERE devicecode = '" + _deviceIndex + "'");
|
||
|
dbo.ExceSQL("UPDATE T_Base_Device SET F_PALLETBARCODE='-',F_HaveGoods = 0 where F_DeviceIndex =" + _deviceIndex);
|
||
|
}
|
||
|
|
||
|
private void button6_Click(object sender, EventArgs e)
|
||
|
{
|
||
|
if (MessageBox.Show("��ȷ�ϡ���̨�����̡�����", "������ʾ��", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
//20090817����������������Ϣ
|
||
|
dboM.ExecuteSql("UPDATE T_ITEMDEVICE SET devicestatus ='1' WHERE devicecode = '" + _deviceIndex + "'");
|
||
|
dbo.ExceSQL("UPDATE T_Base_Device SET F_HaveGoods = 1 where F_DeviceIndex =" + _deviceIndex);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|