📄 mainfrom.cs
字号:
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem6,
this.menuItem17,
this.menuItemSysManage});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2,
this.menuItem3,
this.menuItem4,
this.menuItem5});
this.menuItem1.Text = "数据维护(&D)";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "供应商";
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.Text = "客户";
//
// menuItem4
//
this.menuItem4.Index = 2;
this.menuItem4.Text = "商品类别";
//
// menuItem5
//
this.menuItem5.Index = 3;
this.menuItem5.Text = "商品信息";
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem7,
this.menuItem8,
this.menuItem9});
this.menuItem6.Text = "商品操作(&M)";
//
// menuItem7
//
this.menuItem7.Index = 0;
this.menuItem7.Text = "进货";
//
// menuItem8
//
this.menuItem8.Index = 1;
this.menuItem8.Text = "出货";
//
// menuItem9
//
this.menuItem9.Index = 2;
this.menuItem9.Text = "商品盘点";
//
// menuItem17
//
this.menuItem17.Index = 2;
this.menuItem17.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem18,
this.menuItem19,
this.menuItem20});
this.menuItem17.Text = "综合操作(&P)";
//
// menuItem18
//
this.menuItem18.Index = 0;
this.menuItem18.Text = "利润分析";
//
// menuItem19
//
this.menuItem19.Index = 1;
this.menuItem19.Text = "综合查询";
//
// menuItem20
//
this.menuItem20.Index = 2;
this.menuItem20.Text = "打印报表";
//
// menuItemSysManage
//
this.menuItemSysManage.Index = 3;
this.menuItemSysManage.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem10,
this.menuItem13,
this.menuItem11,
this.menuItem14});
this.menuItemSysManage.Text = "系统管理(&S)";
//
// menuItem10
//
this.menuItem10.Index = 0;
this.menuItem10.Text = "用户管理";
//
// menuItem13
//
this.menuItem13.Index = 1;
this.menuItem13.Text = "系统连接";
//
// menuItem11
//
this.menuItem11.Index = 2;
this.menuItem11.Text = "系统帮助";
//
// menuItem14
//
this.menuItem14.Index = 3;
this.menuItem14.Text = "退出系统";
//
// MainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.Color.Navy;
this.ClientSize = new System.Drawing.Size(672, 481);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.navBarControl1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsMdiContainer = true;
this.MaximizeBox = false;
this.Menu = this.mainMenu1;
this.MinimizeBox = false;
this.Name = "MainForm";
this.Text = "销售管理信息系统";
this.Load += new System.EventHandler(this.MainForm_Load);
((System.ComponentModel.ISupportInitialize)(this.navBarControl1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Login loginForm=new Login();
loginForm.ShowDialog();
Application.Run(new MainForm(loginForm.GetUserSort()));
}
private void button7_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void MainForm_Load(object sender, System.EventArgs e)
{
Form expertMaintenance = new InitialForm();
for(int x=0;x<this.MdiChildren.Length;x++)
{
Form tempChild = (Form)this.MdiChildren[x];
tempChild.Close();
}
expertMaintenance.MdiParent = this;//setup MdiParent for expertMaintenance form
expertMaintenance.WindowState = FormWindowState.Maximized;
expertMaintenance.Show();
if(usersort.Equals("system"))
{
this.SystemOperation.Visible=true;
this.menuItemSysManage.Visible=true;
}
else
{
this.SystemOperation.Visible=false;
this.menuItemSysManage.Visible=false;
}
}
private void Exit_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
{
Application.Exit();
}
private void Help_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
{
Form expertMaintenance = new Help();
///close all of this form's MdiChildren which had been opened ago!
for(int x=0;x<this.MdiChildren.Length;x++)
{
Form tempChild = (Form)this.MdiChildren[x];
tempChild.Close();
}
expertMaintenance.MdiParent = this;//setup MdiParent for expertMaintenance form
expertMaintenance.WindowState = FormWindowState.Maximized;
expertMaintenance.Show();
}
private void ProBuy_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
{
Form ProBuyForm = new ProBuy();//创建商品进货窗体实例
for(int x=0;x<this.MdiChildren.Length;x++)
{
Form tempChild = (Form)this.MdiChildren[x];
tempChild.Close();//关闭主界面中的所有子窗体
}
ProBuyForm.MdiParent = this;//设置商品销售界面的父窗体是主窗体
ProBuyForm.WindowState = FormWindowState.Maximized;//商品销售窗口状态为最大化
ProBuyForm.Show();//显示商品销售窗口
}
private void ProfitAnalyse_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
{
Form ProBuyForm = new ProfitAnalyse();//创建商品进货窗体实例
for(int x=0;x<this.MdiChildren.Length;x++)
{
Form tempChild = (Form)this.MdiChildren[x];
tempChild.Close();//关闭主界面中的所有子窗体
}
ProBuyForm.MdiParent = this;//设置商品销售界面的父窗体是主窗体
ProBuyForm.WindowState = FormWindowState.Maximized;//商品销售窗口状态为最大化
ProBuyForm.Show();//显示商品销售窗口
}
private void ProSell_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
{
Form ProSellForm = new ProSell();//创建商品进货窗体实例
for(int x=0;x<this.MdiChildren.Length;x++)
{
Form tempChild = (Form)this.MdiChildren[x];
tempChild.Close();//关闭主界面中的所有子窗体
}
ProSellForm.MdiParent = this;//设置商品销售界面的父窗体是主窗体
ProSellForm.WindowState = FormWindowState.Maximized;//商品销售窗口状态为最大化
ProSellForm.Show();//显示商品销售窗口
}
private void ProCheck_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
{
Form ProCheckForm = new ProCheck();//创建商品进货窗体实例
for(int x=0;x<this.MdiChildren.Length;x++)
{
Form tempChild = (Form)this.MdiChildren[x];
tempChild.Close();//关闭主界面中的所有子窗体
}
ProCheckForm.MdiParent = this;//设置商品销售界面的父窗体是主窗体
ProCheckForm.WindowState = FormWindowState.Maximized;//商品销售窗口状态为最大化
ProCheckForm.Show();//显示商品销售窗口
}
private void Product_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
{
Form ProductForm = new Product();//创建商品进货窗体实例
for(int x=0;x<this.MdiChildren.Length;x++)
{
Form tempChild = (Form)this.MdiChildren[x];
tempChild.Close();//关闭主界面中的所有子窗体
}
ProductForm.MdiParent = this;//设置商品销售界面的父窗体是主窗体
ProductForm.WindowState = FormWindowState.Maximized;//商品销售窗口状态为最大化
ProductForm.Show();//显示商品销售窗口
}
private void Reprot_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
{
Form ReportForm = new Report();//创建商品进货窗体实例
for(int x=0;x<this.MdiChildren.Length;x++)
{
Form tempChild = (Form)this.MdiChildren[x];
tempChild.Close();//关闭主界面中的所有子窗体
}
ReportForm.MdiParent = this;//设置商品销售界面的父窗体是主窗体
ReportForm.WindowState = FormWindowState.Maximized;//商品销售窗口状态为最大化
ReportForm.Show();//显示商品销售窗口
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -