2025-03-28 09:49:56 +08:00

166 lines
5.3 KiB
C#
Raw 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 RunUpdateExe;
using System;
using System.Linq;
using System.Windows.Forms;
namespace InvoicingTool
{
public partial class MenuMain : Form
{
string _Type = "";
QualityHelper _QualityHelper = new QualityHelper();
WaiteFrom _WaitForm;
public MenuMain()
{
InitializeComponent();
}
public MenuMain(string[] Type)
{
InitializeComponent();
if (Type.Count() > 0)
{
_Type = Type[0];
if (_Type.ToLower() == "serverpart")
{
//btnPurchase.Enabled = false;
}
}
}
private void btnCheckCommodity_Click(object sender, EventArgs e)
{
Visible = false;
if (_QualityHelper.OnLine == "1"|| _Type.ToLower() == "serverpart")
{
CheckCommodity checkCommodityCount = new CheckCommodity();
checkCommodityCount.TopMost = true;
checkCommodityCount.ShowInTaskbar = true;
checkCommodityCount.ShowDialog();
Close();
}
else
{
CommodityInventory checkCommodityCount = new CommodityInventory();
checkCommodityCount.TopMost = true;
checkCommodityCount.ShowInTaskbar = true;
checkCommodityCount.ShowDialog();
Close();
}
}
private void btnInvoicing_Click(object sender, EventArgs e)
{
Visible = false;
if (_QualityHelper.OnLine == "1")
{
InvoicingMain invoicingMain = new InvoicingMain();
invoicingMain.TopMost = true;
invoicingMain.ShowInTaskbar = false;
invoicingMain.ShowDialog();
Close();
}
else
{
CommodityStorage invoicingMain = new CommodityStorage();
invoicingMain.TopMost = true;
invoicingMain.ShowInTaskbar = false;
invoicingMain.ShowDialog();
Close();
}
}
private void btnPurchase_Click(object sender, EventArgs e)
{
//DownLoadHelper downLoadHelper = new DownLoadHelper();
//label1.Text = "正在获取可采购商品信息,请稍候……";
//ShowWaiteForm();
//_WaitForm.ShowMessage("正在获取可采购商品信息,请稍候......");
//downLoadHelper.SellerCommodityById();
////downLoadHelper.RolepriceDownLoad();
////downLoadHelper.SellerCommodityDownLoad();
////downLoadHelper.SellerCommoditytypeDownLoad();
//_WaitForm.Close();
//_WaitForm.Dispose();
if (_Type.ToLower() != "serverpart")
{
Visible = false;
PurchaseMain purchase = new PurchaseMain();
purchase.TopMost = true;
purchase.ShowInTaskbar = false;
purchase.ShowDialog();
Close();
}
else
{
Visible = false;
ServerPartPurchase purchase = new ServerPartPurchase();
purchase.TopMost = true;
purchase.ShowInTaskbar = false;
purchase.ShowDialog();
Close();
//MessageBox.Show("报货系统建设中,敬请期待......", "系统提示", MessageBoxButtons.OK);
}
}
private void MenuMain_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Escape:
Environment.Exit(0);
break;
case Keys.F1:
//报货
btnPurchase_Click(null, null);
break;
case Keys.F2:
//入库
btnInvoicing_Click(null, null);
break;
case Keys.F3:
//盘点
btnCheckCommodity_Click(null, null);
break;
}
}
public void ShowWaiteForm()
{
_WaitForm = WaiteFrom.GetInstance();
//设置WaitForm的父窗体为当前窗体以便在WaitForm中使用父窗体对象
_WaitForm.TopMost = true;
_WaitForm.Owner = this;
_WaitForm.ShowMessage("加载中......");
_WaitForm.Show();
Application.DoEvents();
_WaitForm.Refresh();
}
private void btnClose_Click(object sender, EventArgs e)
{
Close();
}
private void cbSetupType_CheckedChanged(object sender, EventArgs e)
{
if (cbSetupType.Checked)
{
_QualityHelper.UpdateConfigUration("online", "1");
}
else
{
_QualityHelper.UpdateConfigUration("online", "0");
}
}
private void MenuMain_Load(object sender, EventArgs e)
{
if (_QualityHelper.OnLine == "1")
{
cbSetupType.Checked = true;
}
else
{
cbSetupType.Checked = false;
}
}
}
}