SCLS/SSWCS_JXDL(2019)/ControlSystem/FrmHelp.cs

358 lines
14 KiB
C#
Raw Normal View History

2025-05-19 09:45:29 +08:00
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 ControlSystem
{
public partial class FrmHelp : WeifenLuo.WinFormsUI.Docking.DockContent
{
DBOperator dbo = CStaticClass.dbo;
DBOperator dboM = CStaticClass.dboM;
string[] bars = new string[60];
public FrmHelp()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
FrmSystemInit.FormInstance.ShowDialog();
}
private void button2_Click(object sender, EventArgs e)
{
FrmLaneTest.FormInstance.ShowDialog();
}
private void button3_Click(object sender, EventArgs e)
{
//if (CStaticClass.testapplyin == 0)
//{
// CStaticClass.testapplyin = 1;
//}
//else
//{
// CStaticClass.testapplyin = 0;
//}
if (CStaticClass.StopTestLane == true)
{
CStaticClass.StopTestLane = false;
// this.button3.Text = "<22><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
}
else
{
CStaticClass.StopTestLane = true;
// this.button3.Text = "ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
}
}
private void button4_Click(object sender, EventArgs e)
{
// CStaticClass.testapplyin = 0;
}
private void button5_Click(object sender, EventArgs e)
{
// CStaticClass.tuopanapplyin = 0;
}
private void button8_Click(object sender, EventArgs e)
{
//string qw5 = string.Empty;
//DataView dv = dbo.ExceSQL("select * from TESTjxdl").Tables[0].DefaultView;
//int listid = 0;
//for (int i = 0; i < dv.Count; i++)
//{
// qw5 = dv[i]["QW5"].ToString();
// DataView dvm= dboM.ExceSQL("select * from STORAGE_MAIN where STOCK_BARCODE ='" + qw5 + "'").Tables[0].DefaultView;
// if (dvm.Count > 0)
// {
// listid = Convert.ToInt32(dvm[0]["STORAGE_ID"]);
// dbo.ExceSQL("update TESTjxdl set LIST_id =" + listid + "where QW5 ='" + qw5 + "'");
// }
// if (i % 1000 == 0)
// {
// MessageBox.Show("<22><><EFBFBD><EFBFBD>һǧ");
// }
//}
//MessageBox.Show("ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
private void button9_Click(object sender, EventArgs e)
{
//string qw5 = string.Empty;
//DataView dv = dbo.ExceSQL("select * from JXDLHELLO where LIST_id is not null").Tables[0].DefaultView;
//int listid = 0;
//int LISTID2 = 0;
//for (int i = 0; i < dv.Count; i++)
//{
// listid =Convert.ToInt32( dv[i]["LIST_id"]);
// DataView dvm = dboM.ExceSQL("select * from STORAGE_LIST where STORAGE_ID ="+listid+"").Tables[0].DefaultView;
// if (dvm.Count > 0)
// {
// LISTID2 = Convert.ToInt32(dvm[0]["STORAGE_LIST_ID"]);
// dbo.ExceSQL("update JXDLHELLO set LIST_ID2 =" + LISTID2 + "where LIST_id ='" + listid + "'");
// }
// if (i % 1000 == 0)
// {
// MessageBox.Show("<22><><EFBFBD><EFBFBD>һǧ");
// }
//}
//MessageBox.Show("ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
private void button10_Click(object sender, EventArgs e)
{
//DataView dv = dboM.ExceSQL("select * from STORAGE_DETAIL").Tables[0].DefaultView;
//if (dv.Count > 0)
//{
// for (int i = 0; i < dv.Count; i++)
// {
// string boxbarcode = dv[i]["BOX_BARCODE"].ToString().Trim();
// string manbarcode = dv[i]["STORAGE_DETAIL_REMARK"].ToString().Trim();
// int STORAGE_DETAIL_ID = Convert.ToInt32(dv[i]["STORAGE_DETAIL_ID"]);
// dboM.ExceSQL("update STORAGE_DETAIL set BOX_BARCODE ='" + boxbarcode + "' ,STORAGE_DETAIL_REMARK='" + manbarcode + "' where STORAGE_DETAIL_ID =" + STORAGE_DETAIL_ID);
// if (i % 1000 == 0)
// {
// MessageBox.Show("<22><><EFBFBD><EFBFBD>һǧ");
// }
// }
// MessageBox.Show("ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
//}
}
private void button11_Click(object sender, EventArgs e)
{
//DataView dv = dboM.ExceSQL("select * from MANAGE_DETAIL").Tables[0].DefaultView;
//if (dv.Count > 0)
//{
// for (int i = 0; i < dv.Count; i++)
// {
// string boxbarcode = dv[i]["BOX_BARCODE"].ToString().Trim();
// string manbarcode = dv[i]["MANAGE_DETAIL_REMARK"].ToString().Trim();
// int STORAGE_DETAIL_ID = Convert.ToInt32(dv[i]["MANAGE_DETAIL_ID"]);
// dboM.ExceSQL("update MANAGE_DETAIL set BOX_BARCODE ='" + boxbarcode + "' ,MANAGE_DETAIL_REMARK='" + manbarcode + "' where MANAGE_DETAIL_ID =" + STORAGE_DETAIL_ID);
// if (i % 1000 == 0)
// {
// MessageBox.Show("<22><><EFBFBD><EFBFBD>һǧ");
// }
// }
// MessageBox.Show("ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
//}
}
private void button12_Click(object sender, EventArgs e)
{
// string boxbarcode = string.Empty;
// int list_id = 0;
// int count = 40000;
// DataView dvm = dboM.ExceSQL("select STOCK_BARCODE,STORAGE_LIST_ID from V_STORAGE_LIST where ENTRY_TIME <('2013-01-17') and GOODS_NAME ='<27><>ת<EFBFBD><D7AA>'").Tables[0].DefaultView;
//if (dvm.Count > 0)
//{
// for (int i = 0; i < dvm.Count; i++)
// {
// boxbarcode = dvm[i]["STOCK_BARCODE"].ToString();
// list_id = Convert.ToInt32(dvm[i]["STORAGE_LIST_ID"]);
// dboM.ExceSQL("insert into STORAGE_DETAIL (STORAGE_DETAIL_ID,STORAGE_LIST_ID,BOX_BARCODE,GOODS_BARCODE,STORAGE_DETAIL_REMARK) values (" + count + "," + list_id + ",'" + boxbarcode + "','" + boxbarcode + "','" + boxbarcode + "')");
// count += 1;
// }
// MessageBox.Show("<22>ɹ<EFBFBD>");
//}
}
private void button13_Click(object sender, EventArgs e)
{
//string cellstr = string.Empty;
//string cell_code = string.Empty;
//DataView dvm = dboM.ExceSQL("select distinct CELL_CODE ,goods_id from V_STORAGE_LIST order by GOODS_ID ").Tables[0].DefaultView;
//if (dvm.Count > 0)
//{
// for (int i = 0; i < dvm.Count; i++)
// {
// cell_code = dvm[i]["CELL_CODE"].ToString();
// DataView dvmore = dboM.ExceSQL("select * from V_STORAGE_LIST where CELL_CODE = '" + cell_code + "' order by ENTRY_TIME").Tables[0].DefaultView;
// if (dvmore.Count > 1)
// {
// int STORAGE_ID = Convert.ToInt32(dvmore[0]["STORAGE_ID"]);
// int STORAGE_LIST_ID = Convert.ToInt32(dvmore[0]["STORAGE_LIST_ID"]);
// dboM.ExceSQL("delete from storage_main where STORAGE_ID ="+STORAGE_ID);
// dboM.ExceSQL("delete from storage_list where STORAGE_LIST_ID ="+STORAGE_LIST_ID);
// dboM.ExceSQL("delete from storage_detail where STORAGE_LIST_ID =" + STORAGE_LIST_ID);
// }
// }
// MessageBox.Show("<22><><EFBFBD><EFBFBD>");
//}
string strtemp = "delete from t_bak_manage_task where fendtime <'" + DateTime.Now.AddMonths(-2).ToString("yyyy-MM-dd HH:mm:ss") + "'";
}
private void button14_Click(object sender, EventArgs e)
{
// FrmLogin.FormInstance.ShowDialog();
FrmConfigManage.FormInstance.ShowDialog();
}
private void button15_Click(object sender, EventArgs e)
{
if (MessageBox.Show("<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>յ<EFBFBD><D5B5>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
dbo.ExceSQL("update T_Base_PLC_Ask set F_BarCode ='" + string.Empty + "' where F_DeviceIndex =14021");
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
}
private void button16_Click(object sender, EventArgs e)
{
// if (MessageBox.Show("<22>Ƿ<EFBFBD><C7B7><EFBFBD>֤<EFBFBD><D6A4>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
// {
// return;
// }
//DataView dvv= dboM.ExceSQL("select distinct(n.BOX_BARCODE) from STORAGE_DETAIL n").Tables[0].DefaultView;
//string record = string.Empty;
//string boxbarcode = string.Empty;
//if (dvv.Count > 0)
//{
// for (int i = 0; i < dvv.Count; i++)
// {
// boxbarcode = dvv[i]["BOX_BARCODE"].ToString();
// DataView dvs= dboM.ExceSQL("select * from STORAGE_DETAIL n where n.BOX_BARCODE ='"+boxbarcode+"'").Tables[0].DefaultView;
// if (dvs.Count > 12)
// {
// record += boxbarcode + "-----";
// }
// }
// MessageBox.Show(record);
//}
// DataView dv = dbo.ExceSQL("select * from T_Base_Route where F_StartDevice =12026 and F_EndDevice >12207 and F_RouteKind =2").Tables[0].DefaultView;
//for (int i = 0; i < dv.Count; i++)
//{
// // string sqltest ="SELECT * FROM T_Base_Route_Device WHERE (F_DeviceIndex =19001 or F_DeviceIndex =16001 ) and F_RouteID =" + Convert.ToInt32(dv[i]["F_RouteID"])+" order by F_SerialNumber";
// DataView dvv = dbo.ExceSQL("SELECT * FROM T_Base_Route_Device WHERE (F_DeviceIndex =19001 or F_DeviceIndex =16001 ) and F_RouteID =" + Convert.ToInt32(dv[i]["F_RouteID"])+" order by F_SerialNumber").Tables[0].DefaultView;
// if (dvv.Count == 2)
// {
// dbo.ExceSQL("update T_Base_Route_Device set F_DeviceOrder =1 ,F_DeviceIndex =16001 where F_RouteID ="+Convert.ToInt32(dv[i]["F_RouteID"])+" and F_SerialNumber = "+Convert.ToInt32 (dvv[0]["F_SerialNumber"]));
// dbo.ExceSQL("update T_Base_Route_Device set F_DeviceOrder =-1 ,F_DeviceIndex =19001 where F_RouteID =" + Convert.ToInt32(dv[i]["F_RouteID"]) + " and F_SerialNumber = " + Convert.ToInt32(dvv[1]["F_SerialNumber"]));
// }
//}
//MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
DataView DV = dbo.ExceSQL("SELECT * FROM T_Base_Route_Device WHERE F_DeviceIndex =12207 ORDER BY F_RouteID").Tables[0].DefaultView;
for (int i = 0; i < DV.Count; i++)
{
DataView dvv = dbo.ExceSQL("SELECT * FROM T_Base_Route_Device WHERE F_DeviceIndex =12207 and F_RouteID=" + Convert.ToInt32(DV[i]["F_RouteID"])).Tables[0].DefaultView;
if (dvv.Count == 2)
{
dbo.ExceSQL("delete from T_Base_Route_Device WHERE F_RouteDeviceIndex = " + Convert.ToInt32(dvv[1]["F_RouteDeviceIndex"]));
}
}
MessageBox.Show("ok");
}
private void button17_Click(object sender, EventArgs e)
{
//if (MessageBox.Show("<22>Ƿ<EFBFBD>ֹͣ12026<32><36><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룿", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
//{
// return;
//}
//CStaticClass.stopplcask = true;
}
private void textBox11_TextChanged(object sender, EventArgs e)
{
}
private void button18_Click(object sender, EventArgs e)
{
// StringBuilder sb = new StringBuilder();
//DataView dv= dboM.ExceSQL("select * from record_detail where record_list_id =9704").Tables[0].DefaultView;
//if (dv.Count > 0)
//{
// for (int i = 0; i < dv.Count; i++)
// {
// bars[i] = dv[i]["goods_barcode"].ToString();
// sb.Append(bars[i]).Append("**");
// }
//}
//string s = sb.ToString();
//this.button18.Enabled = false;
}
private void button18_Click_1(object sender, EventArgs e)
{
// CStaticClass.stopplcask = false;
}
private void button19_Click(object sender, EventArgs e)
{
FrmBarcode.Formstatnce.ShowDialog();
}
private void button1_Click_1(object sender, EventArgs e)
{
CStaticClass.isDisassembleTask = true;
}
private void button2_Click_1(object sender, EventArgs e)
{
// FrmSystemInit.FormInstance.ShowDialog();
FrmBarcode.Formstatnce.ShowDialog();
}
private void button3_Click_1(object sender, EventArgs e)
{
if (CStaticClass.StopTestLane == true)
{
CStaticClass.StopTestLane = false;
this.button3.Text = "<22><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
}
else
{
CStaticClass.StopTestLane = true;
this.button3.Text = "ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
}
}
private void button4_Click_1(object sender, EventArgs e)
{
FrmConfigManage.FormInstance.ShowDialog();
}
private void button5_Click_1(object sender, EventArgs e)
{
// dbo.ExceSQL ("select * from t_mon")
}
}
}