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.
68 lines
2.2 KiB
68 lines
2.2 KiB
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
|
|
/// 设备故障查询//20151120
|
|
/// </summary>
|
|
public partial class FrmDeviceErrorSolutions : Form
|
|
{
|
|
StringBuilder Commsql = new StringBuilder();
|
|
private static FrmDeviceErrorSolutions _formInstance;
|
|
|
|
public static FrmDeviceErrorSolutions FormInstance
|
|
{
|
|
get
|
|
|
|
{
|
|
if (_formInstance == null)
|
|
{
|
|
_formInstance = new FrmDeviceErrorSolutions();
|
|
}
|
|
return _formInstance;
|
|
}
|
|
set { _formInstance = value; }
|
|
}
|
|
DBOperator dbo =CStaticClass.dbo;
|
|
public FrmDeviceErrorSolutions()
|
|
{
|
|
InitializeComponent();
|
|
_formInstance = this;//20101028
|
|
Commsql.Append("SELECT F_DeviceErrorIndex as 故障代码,F_ErrorName as 故障名称,F_ErrorReasons as 故障原因,F_ErrorSolutions as 故障解决办法 FROM T_Base_Device_State ");
|
|
}
|
|
|
|
|
|
private void FrmDeviceErrorLog_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
_formInstance = null;
|
|
}
|
|
|
|
private void FrmDeviceErrorSolutions_Load(object sender, EventArgs e)
|
|
{
|
|
DataView dv = dbo.ExceSQL("SELECT F_DeviceKindIndex ,F_DeviceKindName FROM T_Base_Device_Kind where F_GoodsMoveKindIndex=1").Tables[0].DefaultView;
|
|
comboBox1.ValueMember = "F_DeviceKindIndex";
|
|
comboBox1.DisplayMember = "F_DeviceKindName";
|
|
comboBox1.DataSource = dv;
|
|
|
|
}
|
|
|
|
public void button1_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
int kind=-1;
|
|
int errid=-1;
|
|
int.TryParse(comboBox1.SelectedValue.ToString(), out kind);
|
|
int.TryParse(textBox1.Text, out errid);
|
|
DataView dv = dbo.ExceSQL(Commsql.ToString()+ string.Format(" where F_DeviceKindIndex={0} and F_DeviceErrorIndex={1}",kind,errid)).Tables[0].DefaultView;
|
|
dataGridView1.DataSource = dv;
|
|
}
|
|
}
|
|
}
|