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.
470 lines
14 KiB
470 lines
14 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using WeifenLuo.WinFormsUI.Docking;
|
|
using Stone.Common;
|
|
using Stone.WinBiz.SystemData;
|
|
using Stone.WinModule.BasicData;
|
|
|
|
|
|
namespace Stone.WinForm
|
|
{
|
|
public partial class frmMain : Form
|
|
{
|
|
#region 构造函数和属性
|
|
public frmMain()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void frmMain_Load(object sender, EventArgs e)
|
|
{
|
|
if (MyAppconfig.ReadValue("WindowsState") == "Maximized")
|
|
{
|
|
this.WindowState = FormWindowState.Maximized;
|
|
}
|
|
|
|
this.Text = MyAppconfig.ReadValue("Title");
|
|
|
|
F_Menu.Init(this.leftTree);
|
|
|
|
//this.leftTree.ExpandAll();
|
|
this.leftTree.Nodes[0].Expand();
|
|
|
|
Stone.WinBiz.BasicData.F_Log.WriteLog("用户登录");
|
|
|
|
//DateTime d = MyDateTime.GetServerDateTime();
|
|
//if (d > new DateTime(2015, 5, 1))
|
|
//{
|
|
// MyMessageBox.ShowErrorMessage("未将对象引用到实例,错误号:3389");
|
|
// Application.Exit();
|
|
//}
|
|
}
|
|
|
|
private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
MyAppconfig.WriteValue("WindowsState", this.WindowState.ToString());
|
|
|
|
Stone.WinBiz.BasicData.F_Log.WriteLog("用户登出");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(ex.Message);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 进入功能模块事件
|
|
private void leftTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
|
|
{
|
|
if (e.Node.Tag == null) return;
|
|
|
|
DateTime dt = DateTime.Now;
|
|
this.tlbState.Text = "载入模块...";
|
|
this.Update();
|
|
try
|
|
{
|
|
#region 系统设置
|
|
|
|
//if (e.Node.Text == "参数设置")
|
|
//{
|
|
// Stone.WinModule.BasicData.frmAppconfig frm = new WinModule.BasicData.frmAppconfig();
|
|
// frm.m_Base = new WinBiz.BasicData.F_Appconfig();
|
|
// frm.init();
|
|
|
|
// ShowWindow(frm);
|
|
//}
|
|
|
|
if (e.Node.Text == "用户管理")
|
|
{
|
|
Stone.WinModule.SystemData.frmUsers frm = new Stone.WinModule.SystemData.frmUsers();
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
|
|
|
|
if (e.Node.Text == "密码修改")
|
|
{
|
|
|
|
Stone.WinModule.SystemData.frmPassword frm = new Stone.WinModule.SystemData.frmPassword();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "系统日志")
|
|
{
|
|
Stone.WinModule.BasicData.frmLog frm = new Stone.WinModule.BasicData.frmLog();
|
|
frm.m_Base = new WinBiz.BasicData.F_Log();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
|
|
if (e.Node.Text == "预警设置")
|
|
{
|
|
Stone.WinModule.BasicData.frmErrTypeLevel frm = new Stone.WinModule.BasicData.frmErrTypeLevel();
|
|
frm.m_Base = new WinBiz.BasicData.F_ErrTypeLevel();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "预警错误处理")
|
|
{
|
|
Stone.WinModule.BasicData.frmErrLog frm = new Stone.WinModule.BasicData.frmErrLog();
|
|
frm.m_Base = new WinBiz.BasicData.F_ErrLog();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 基础资料管理
|
|
|
|
if (e.Node.Text == "颜色管理")
|
|
{
|
|
Stone.WinModule.BasicData.frmColor frm = new WinModule.BasicData.frmColor();
|
|
frm.m_Base = new WinBiz.BasicData.F_Color();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "车型管理")
|
|
{
|
|
Stone.WinModule.BasicData.frmCarModel frm = new WinModule.BasicData.frmCarModel();
|
|
frm.m_Base = new WinBiz.BasicData.F_CarModel();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "卸货点管理")
|
|
{
|
|
Stone.WinModule.BasicData.frmLocation frm = new WinModule.BasicData.frmLocation();
|
|
frm.m_Base = new WinBiz.BasicData.F_Location();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "存货管理")
|
|
{
|
|
Stone.WinModule.BasicData.frmProduct frm = new WinModule.BasicData.frmProduct();
|
|
frm.m_Base = new WinBiz.BasicData.F_Product();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "累计发货数量")
|
|
{
|
|
Stone.WinModule.BasicData.frmPartOutQty frm = new WinModule.BasicData.frmPartOutQty();
|
|
frm.m_Base = new WinBiz.BasicData.F_PartOutQty();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "ASN单流水管理")
|
|
{
|
|
Stone.WinModule.BasicData.frmASNManager frm = new WinModule.BasicData.frmASNManager();
|
|
frm.Text = "ASN单流水管理";
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "零件订单管理")
|
|
{
|
|
Stone.WinModule.BasicData.frmPartPO frm = new WinModule.BasicData.frmPartPO();
|
|
frm.m_Base = new WinBiz.BasicData.F_PartPO();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 排序数据
|
|
|
|
if (e.Node.Text == "操作日志")
|
|
{
|
|
Stone.WinModule.JISData.frmJISLog frm = new WinModule.JISData.frmJISLog();
|
|
frm.m_Base = new WinBiz.JISData.F_JIS_Log();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
|
|
|
|
if (e.Node.Text == "LAB数据查询")
|
|
{
|
|
Stone.WinModule.JISData.frmJISLAB frm = new WinModule.JISData.frmJISLAB();
|
|
frm.m_Base = new WinBiz.JISData.F_JIS_LAB();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "LAB数据查询-STD")
|
|
{
|
|
Stone.WinModule.JISData.frmJISLAB_STD frm = new WinModule.JISData.frmJISLAB_STD();
|
|
frm.m_Base = new WinBiz.JISData.F_JIS_LAB_STD();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "LAB历史版本")
|
|
{
|
|
// Stone.WinModule.JISData.frmJISLAB_All frm = new WinModule.JISData.frmJISLAB_All();
|
|
// frm.m_Base = new WinBiz.JISData.F_JIS_LAB_All();
|
|
Stone.WinModule.JISData.frmJISLAB_All_new frm = new WinModule.JISData.frmJISLAB_All_new();
|
|
// frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "LAB报表查询")
|
|
{
|
|
Stone.WinModule.JISData.frmJISLABReport frm = new WinModule.JISData.frmJISLABReport();
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "LAB零件版本对比")
|
|
{
|
|
Stone.WinModule.JISData.frmJISLABCompare frm = new WinModule.JISData.frmJISLABCompare();
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region 校验管理
|
|
|
|
if (e.Node.Text == "装箱校验数据")
|
|
{
|
|
Stone.WinModule.VerifyData.frmVerifyBill frm = new WinModule.VerifyData.frmVerifyBill();
|
|
frm.m_Base = new WinBiz.VerifyData.F_VerifyBill();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Text == "发货校验数据")
|
|
{
|
|
Stone.WinModule.VerifyData.frmShipBill frm = new WinModule.VerifyData.frmShipBill();
|
|
frm.m_Base = new WinBiz.VerifyData.F_ShipBill();
|
|
frm.init();
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SY78
|
|
|
|
if (e.Node.Tag.ToString() == "0701") //VDA标签打印
|
|
{
|
|
WinBiz.Standard.F_JIS_VDA f_JIS_VDA = new WinBiz.Standard.F_JIS_VDA();
|
|
f_JIS_VDA.fileType = "SY78";
|
|
|
|
Stone.WinModule.Standard.frmJISVDA frm = new WinModule.Standard.frmJISVDA();
|
|
frm.m_Base = f_JIS_VDA;
|
|
frm.init();
|
|
|
|
frm.Text = "SY78_" + "发货准备与跟踪";
|
|
frm.TabText = frm.Text;
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Tag.ToString() == "0702") //ASN管理
|
|
{
|
|
WinBiz.Standard.F_JIS_VDA_ASN f_JIS_VDA_ASN = new WinBiz.Standard.F_JIS_VDA_ASN();
|
|
f_JIS_VDA_ASN.fileType = "SY78";
|
|
|
|
Stone.WinModule.Standard.frmJISVDAASN frm = new WinModule.Standard.frmJISVDAASN();
|
|
frm.m_Base = f_JIS_VDA_ASN;
|
|
frm.init();
|
|
|
|
frm.Text = "SY78_" + "ASN管理";
|
|
frm.TabText = frm.Text;
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region SY88
|
|
|
|
if (e.Node.Tag.ToString() == "0801") //VDA标签打印
|
|
{
|
|
WinBiz.Standard.F_JIS_VDA f_JIS_VDA = new WinBiz.Standard.F_JIS_VDA();
|
|
f_JIS_VDA.fileType = "SY88";
|
|
|
|
Stone.WinModule.Standard.frmJISVDA frm = new WinModule.Standard.frmJISVDA();
|
|
frm.m_Base = f_JIS_VDA;
|
|
frm.init();
|
|
|
|
frm.Text = "SY88_" + "号码预分配";
|
|
frm.TabText = frm.Text;
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
if (e.Node.Tag.ToString() == "0802") //ASN管理
|
|
{
|
|
WinBiz.Standard.F_JIS_VDA_ASN f_JIS_VDA_ASN = new WinBiz.Standard.F_JIS_VDA_ASN();
|
|
f_JIS_VDA_ASN.fileType = "SY88";
|
|
|
|
Stone.WinModule.Standard.frmJISVDAASN frm = new WinModule.Standard.frmJISVDAASN();
|
|
frm.m_Base = f_JIS_VDA_ASN;
|
|
frm.init();
|
|
|
|
frm.Text = "SY88_" + "ASN管理";
|
|
frm.TabText = frm.Text;
|
|
|
|
ShowWindow(frm);
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MyMessageBox.ShowErrorMessage(ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
TimeSpan ts = DateTime.Now - dt;
|
|
|
|
this.tlbState.Text = "模块载入完成,所花时间 " + ts.TotalSeconds + " 秒";
|
|
Application.DoEvents();
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Tab操作
|
|
private void 关闭CToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
this.dockMain.ActiveContent.DockHandler.Close();
|
|
}
|
|
|
|
private void 关闭全部LToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
DockContentCollection contents = this.dockMain.Contents;
|
|
int num = 0;
|
|
while (num < contents.Count)
|
|
{
|
|
if (contents[num].DockHandler.DockState == DockState.Document)
|
|
{
|
|
//contents[num].DockHandler.Close();
|
|
contents[num].DockHandler.Hide();
|
|
}
|
|
else
|
|
{
|
|
num++;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void 除此之外关闭OToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
DockContentCollection contents = this.dockMain.Contents;
|
|
int num = 0;
|
|
while (num < contents.Count)
|
|
{
|
|
if (contents[num].DockHandler.DockState == DockState.Document && this.dockMain.ActiveContent != contents[num])
|
|
{
|
|
contents[num].DockHandler.Hide();
|
|
}
|
|
else
|
|
{
|
|
num++;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void btnCollapseAll_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
this.leftTree.CollapseAll();
|
|
}
|
|
|
|
private void btnExpandAll_Click(object sender, EventArgs e)
|
|
{
|
|
this.leftTree.ExpandAll();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 菜单事件
|
|
|
|
|
|
private void 退出系统QToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
private void 工具栏TToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
this.toolStrip1.Visible = ((ToolStripMenuItem)sender).Checked;
|
|
}
|
|
|
|
private void 树型菜单MToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
this.splitContainer1.Panel1Collapsed = !((ToolStripMenuItem)sender).Checked;
|
|
}
|
|
|
|
private void 状态栏SToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
this.statusStrip1.Visible = ((ToolStripMenuItem)sender).Checked;
|
|
}
|
|
|
|
private void 关于AToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
MyMessageBox.ShowInfoMessage(this.Text);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 私有函数
|
|
|
|
|
|
private void ShowWindow(Stone.WinModule.frmBase frm)
|
|
{
|
|
foreach (IDockContent content in dockMain.Documents)
|
|
{
|
|
if (content.DockHandler.TabText == frm.Text)
|
|
{
|
|
content.DockHandler.Activate();
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
frm.Show(this.dockMain);
|
|
frm.TabPageContextMenuStrip = this.contextMenuStrip1;
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|