📄 frmmainmenu.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using System.Data.OleDb;
using System.Data;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
namespace SupermarketProject
{
/// <summary>
/// Summary description for frmMainMenu.
/// </summary>
public class frmMainMenu : System.Windows.Forms.Form
{
private System.Windows.Forms.MenuItem mnuUsers;
private System.Windows.Forms.MenuItem mnuProduct;
private System.Windows.Forms.MenuItem mnuStock;
private System.Windows.Forms.MenuItem mnuSalesMgmt;
private System.Windows.Forms.MenuItem mnuTeller;
private System.Windows.Forms.MenuItem mnuWindows;
private System.Windows.Forms.MenuItem mnuSystem;
private System.Windows.Forms.MenuItem mnuHelp;
private System.Windows.Forms.MenuItem mnuHelpContents;
private System.Windows.Forms.MenuItem mnuHelpIndex;
private System.Windows.Forms.MenuItem mnuHelpSearch;
private System.Windows.Forms.MenuItem mnuHelpAbout;
private System.Windows.Forms.MenuItem mnuUsersUsrMgr;
private System.Windows.Forms.MenuItem mnuProductPrdCtgy;
private System.Windows.Forms.MenuItem mnuSalesMgmtBillsMgmt;
private System.Windows.Forms.MenuItem mnuSalesMgmtRtnMgmt;
private System.Windows.Forms.MenuItem mnuSalesMgmtDisMgmt;
private System.Windows.Forms.MenuItem mnuTellerPrdSales;
private System.Windows.Forms.MenuItem mnuWindowsArrange;
private System.Windows.Forms.MenuItem mnuWindowsCascade;
private System.Windows.Forms.MenuItem mnuWindowsVertical;
private System.Windows.Forms.MenuItem mnuWindowsCloseAll;
private System.Windows.Forms.MenuItem mnuSystemRelogin;
private System.Windows.Forms.MenuItem mnuSystemExit;
private System.Windows.Forms.MenuItem mnuUsersRptUsers;
private System.Windows.Forms.MenuItem mnuUsersRptUsersActive;
private System.Windows.Forms.MenuItem mnuUsersRptUsersInActive;
private System.Windows.Forms.MenuItem mnuProductRptPrdList;
private System.Windows.Forms.MenuItem mnuStockRptStock;
private System.Windows.Forms.MenuItem mnuStockRptStockToday;
private System.Windows.Forms.MenuItem mnuStockRptStockCurrMnth;
private System.Windows.Forms.MenuItem mnuStockRptStockTotStock;
private System.Windows.Forms.MenuItem mnuStockRptStockOutStock;
private System.Windows.Forms.MenuItem mnuStockRptStockCurrStk;
private System.Windows.Forms.MenuItem mnuStockRptStockNumLessThan10;
private System.Windows.Forms.MenuItem mnuStockRptStockTop10;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBills;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStat;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsToday;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsWeek;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsMonth;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsYear;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsRtnToday;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsRtnMonth;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsCurrDisRpt;
private System.Windows.Forms.MenuItem mnuTellerRptSales;
private System.Windows.Forms.MenuItem mnuTellerRptSalesToday;
private System.Windows.Forms.MenuItem mnuTellerRptSalesMonth;
private System.Windows.Forms.MenuItem mnuTellerRptSalesAll;
private System.Windows.Forms.MenuItem mnuUsersSeparator;
private System.Windows.Forms.MenuItem mnuProductSeparator;
private System.Windows.Forms.MenuItem mnuStockSeparator;
private System.Windows.Forms.MenuItem mnuStockRptStockSeparator1;
private System.Windows.Forms.MenuItem mnuStockRptStockSeparator2;
private System.Windows.Forms.MenuItem mnuSalesMgmtSeparator;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsSeparator1;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptBillsSeparator2;
private System.Windows.Forms.MenuItem mnuTellerSeparator;
private System.Windows.Forms.MenuItem mnuWindowsSeparator;
private System.Windows.Forms.MenuItem mnuSystemSeparator;
private System.Windows.Forms.MenuItem mnuHelpSeparator;
private System.Windows.Forms.MainMenu mnuMain;
private System.Windows.Forms.ImageList imlList;
private System.Windows.Forms.ToolBar tbrMainTool;
private System.Windows.Forms.ToolBarButton tbrbtnPrdSales;
private System.Windows.Forms.ToolBarButton tbrbtnUsrMgmt;
private System.Windows.Forms.ToolBarButton tbrbtnSeparator;
private System.Windows.Forms.ToolBarButton tbrbtnPrdMgmt;
private System.Windows.Forms.ToolBarButton tbrbtnStkMgmt;
private System.Windows.Forms.ToolBarButton tbrbtnBillsMgmt;
private System.Windows.Forms.MenuItem mnuSystemOption;
private System.Windows.Forms.MenuItem mnuStockStkMgmt;
private System.Windows.Forms.MenuItem mnuProductPdtMgmt;
private System.Windows.Forms.MenuItem mnuWindowsHorizontal;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.ContextMenu cmnuCtextMnu;
private System.Windows.Forms.NotifyIcon nicNotify;
private bool reLogin;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatPrdSoldTodayByCount;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatPrdSoldByMoney;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatPrdSoldThisMnth;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatSep1;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatTop10PrdCountToday;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatTop10CntThisMonth;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatTop10PrdPriceToday;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatTop10PrdPriceThisMnth;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatTop3SalesToday;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatTop3SalesThisMnth;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatSep2;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatProfitRptToday;
private System.Windows.Forms.MenuItem mnuSalesMgmtRptStatProfitRptThisMonth;
private bool reportLoaded = false;
public ReportDocument repDoc;
public static int varUsrMgmt;
public static int varPrdSales;
public static int varPrdMgmt;
public static int varStkMgmt;
public static int varBillsMgmt;
public static int varPrdCategory;
public static int varRtnMgmt;
public static int varDisMgmt;
public static int varOption;
private System.Windows.Forms.HelpProvider hlpMainMenu;
private System.Windows.Forms.ToolTip tipMainMenu;
public static int varReLogin;
public static string AppPath;
private TableLogOnInfo tableInfo;
private int interval = 0;
private System.Windows.Forms.ProgressBar pgrReport;
private System.Windows.Forms.Timer tmrMenu;
private System.Windows.Forms.GroupBox grpReportNotification;
private Settings settings;
private frmReport fRpt;
public frmMainMenu()
{
settings =new Settings();
InitializeComponent();
DataConnection.load();
repDoc=new ReportDocument();
this.hlpMainMenu.HelpNamespace=settings.uiDirectory+@"\HELP\SupermarketHelp.chm";
nicNotify.Icon = new System.Drawing.Icon (settings.uiDirectory+@"\Images\dragon.ico");
this.cmnuCtextMnu.MenuItems.Add("欢迎",new EventHandler(Welcome_Clicked));
this.cmnuCtextMnu.MenuItems.Add(new MenuItem("-"));
this.cmnuCtextMnu.MenuItems.Add("退出(&E)",new EventHandler(Exit_Clicked));
this.nicNotify.ContextMenu = this.cmnuCtextMnu;
nicNotify.Visible = true;
tableInfo = new TableLogOnInfo ();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
[STAThread]
static void Main()
{
Application.Run(new frmMainMenu());
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMainMenu));
this.mnuMain = new System.Windows.Forms.MainMenu();
this.mnuUsers = new System.Windows.Forms.MenuItem();
this.mnuUsersUsrMgr = new System.Windows.Forms.MenuItem();
this.mnuUsersSeparator = new System.Windows.Forms.MenuItem();
this.mnuUsersRptUsers = new System.Windows.Forms.MenuItem();
this.mnuUsersRptUsersActive = new System.Windows.Forms.MenuItem();
this.mnuUsersRptUsersInActive = new System.Windows.Forms.MenuItem();
this.mnuProduct = new System.Windows.Forms.MenuItem();
this.mnuProductPdtMgmt = new System.Windows.Forms.MenuItem();
this.mnuProductPrdCtgy = new System.Windows.Forms.MenuItem();
this.mnuProductSeparator = new System.Windows.Forms.MenuItem();
this.mnuProductRptPrdList = new System.Windows.Forms.MenuItem();
this.mnuStock = new System.Windows.Forms.MenuItem();
this.mnuStockStkMgmt = new System.Windows.Forms.MenuItem();
this.mnuStockSeparator = new System.Windows.Forms.MenuItem();
this.mnuStockRptStock = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockToday = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockCurrMnth = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockTotStock = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockSeparator1 = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockOutStock = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockCurrStk = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockSeparator2 = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockNumLessThan10 = new System.Windows.Forms.MenuItem();
this.mnuStockRptStockTop10 = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmt = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtBillsMgmt = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRtnMgmt = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtDisMgmt = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtSeparator = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBills = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsToday = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsWeek = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsMonth = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsYear = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsSeparator1 = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsRtnToday = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsRtnMonth = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsSeparator2 = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptBillsCurrDisRpt = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStat = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatPrdSoldTodayByCount = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatPrdSoldByMoney = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatPrdSoldThisMnth = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatSep1 = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatTop10PrdCountToday = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatTop10CntThisMonth = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatTop10PrdPriceToday = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatTop10PrdPriceThisMnth = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatTop3SalesToday = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatTop3SalesThisMnth = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatSep2 = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatProfitRptToday = new System.Windows.Forms.MenuItem();
this.mnuSalesMgmtRptStatProfitRptThisMonth = new System.Windows.Forms.MenuItem();
this.mnuTeller = new System.Windows.Forms.MenuItem();
this.mnuTellerPrdSales = new System.Windows.Forms.MenuItem();
this.mnuTellerSeparator = new System.Windows.Forms.MenuItem();
this.mnuTellerRptSales = new System.Windows.Forms.MenuItem();
this.mnuTellerRptSalesToday = new System.Windows.Forms.MenuItem();
this.mnuTellerRptSalesMonth = new System.Windows.Forms.MenuItem();
this.mnuTellerRptSalesAll = new System.Windows.Forms.MenuItem();
this.mnuWindows = new System.Windows.Forms.MenuItem();
this.mnuWindowsArrange = new System.Windows.Forms.MenuItem();
this.mnuWindowsCascade = new System.Windows.Forms.MenuItem();
this.mnuWindowsVertical = new System.Windows.Forms.MenuItem();
this.mnuWindowsHorizontal = new System.Windows.Forms.MenuItem();
this.mnuWindowsSeparator = new System.Windows.Forms.MenuItem();
this.mnuWindowsCloseAll = new System.Windows.Forms.MenuItem();
this.mnuSystem = new System.Windows.Forms.MenuItem();
this.mnuSystemOption = new System.Windows.Forms.MenuItem();
this.mnuSystemSeparator = new System.Windows.Forms.MenuItem();
this.mnuSystemRelogin = new System.Windows.Forms.MenuItem();
this.mnuSystemExit = new System.Windows.Forms.MenuItem();
this.mnuHelp = new System.Windows.Forms.MenuItem();
this.mnuHelpContents = new System.Windows.Forms.MenuItem();
this.mnuHelpIndex = new System.Windows.Forms.MenuItem();
this.mnuHelpSearch = new System.Windows.Forms.MenuItem();
this.mnuHelpSeparator = new System.Windows.Forms.MenuItem();
this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
this.imlList = new System.Windows.Forms.ImageList(this.components);
this.tbrMainTool = new System.Windows.Forms.ToolBar();
this.tbrbtnUsrMgmt = new System.Windows.Forms.ToolBarButton();
this.tbrbtnPrdSales = new System.Windows.Forms.ToolBarButton();
this.tbrbtnSeparator = new System.Windows.Forms.ToolBarButton();
this.tbrbtnPrdMgmt = new System.Windows.Forms.ToolBarButton();
this.tbrbtnStkMgmt = new System.Windows.Forms.ToolBarButton();
this.tbrbtnBillsMgmt = new System.Windows.Forms.ToolBarButton();
this.cmnuCtextMnu = new System.Windows.Forms.ContextMenu();
this.nicNotify = new System.Windows.Forms.NotifyIcon(this.components);
this.hlpMainMenu = new System.Windows.Forms.HelpProvider();
this.tipMainMenu = new System.Windows.Forms.ToolTip(this.components);
this.tmrMenu = new System.Windows.Forms.Timer(this.components);
this.pgrReport = new System.Windows.Forms.ProgressBar();
this.grpReportNotification = new System.Windows.Forms.GroupBox();
this.SuspendLayout();
//
// mnuMain
//
this.mnuMain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuUsers,
this.mnuProduct,
this.mnuStock,
this.mnuSalesMgmt,
this.mnuTeller,
this.mnuWindows,
this.mnuSystem,
this.mnuHelp});
//
// mnuUsers
//
this.mnuUsers.Index = 0;
this.mnuUsers.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuUsersUsrMgr,
this.mnuUsersSeparator,
this.mnuUsersRptUsers});
this.mnuUsers.Text = "用户";
//
// mnuUsersUsrMgr
//
this.mnuUsersUsrMgr.Index = 0;
this.mnuUsersUsrMgr.Text = "用户管理";
this.mnuUsersUsrMgr.Click += new System.EventHandler(this.mnuUsersUsrMgr_Click);
//
// mnuUsersSeparator
//
this.mnuUsersSeparator.Index = 1;
this.mnuUsersSeparator.Text = "-";
//
// mnuUsersRptUsers
//
this.mnuUsersRptUsers.Index = 2;
this.mnuUsersRptUsers.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuUsersRptUsersActive,
this.mnuUsersRptUsersInActive});
this.mnuUsersRptUsers.Text = "用户报表";
//
// mnuUsersRptUsersActive
//
this.mnuUsersRptUsersActive.Index = 0;
this.mnuUsersRptUsersActive.Text = "活动用户列表";
this.mnuUsersRptUsersActive.Click += new System.EventHandler(this.mnuUsersRptUsersActive_Click);
//
// mnuUsersRptUsersInActive
//
this.mnuUsersRptUsersInActive.Index = 1;
this.mnuUsersRptUsersInActive.Text = "非活动用户列表";
this.mnuUsersRptUsersInActive.Click += new System.EventHandler(this.mnuUsersRptUsersInActive_Click);
//
// mnuProduct
//
this.mnuProduct.Index = 1;
this.mnuProduct.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuProductPdtMgmt,
this.mnuProductPrdCtgy,
this.mnuProductSeparator,
this.mnuProductRptPrdList});
this.mnuProduct.Text = "产品";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -