📄 form1.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OracleClient;
using GlobleUtility;
using System.Runtime.InteropServices; //监控加
using PlatF;
using System.Diagnostics;
namespace Charge
{
/// <summary>
/// 通用收费系统主窗口
/// </summary>
public class CfrmChargeMain : System.Windows.Forms.Form
{
/// <summary>
/// 必需的设计器变量。
private ErrorCode E = new ErrorCode();
private string m_sAdminName = ""; //管理员用户名
private string m_sAdminID = ""; //管理员ID
private int m_nAdminRight = -1; //管理员权限,0系统管理员,1一般操作员
private int m_nSiteID = 0; //收费点编号
private string m_sSiteName = ""; //收费点名称
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem mnSystem;
private System.Windows.Forms.MenuItem mnRelogin;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem mnExit;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.MenuItem mnNewCharge;
private System.Windows.Forms.MenuItem mnPlatf;
private System.Windows.Forms.MenuItem mnSchool;
private System.Windows.Forms.MenuItem mnDept;
private System.Windows.Forms.MenuItem menuItem16;
private System.Windows.Forms.MenuItem menuItem17;
private System.Windows.Forms.MenuItem menuItem18;
private System.Windows.Forms.MenuItem menuItem19;
private System.Windows.Forms.MenuItem menuItem21;
private System.Windows.Forms.MenuItem menuItem22;
private System.Windows.Forms.MenuItem menuItem23;
private System.Windows.Forms.MenuItem mnItemMain;
private System.Windows.Forms.MenuItem mnSetItem;
private System.Windows.Forms.MenuItem mnItemTask;
private System.Windows.Forms.MenuItem mnItemStart;
private System.Windows.Forms.MenuItem mnItemStop;
private System.Windows.Forms.MenuItem menuItem24;
private System.Windows.Forms.MenuItem menuItem25;
private System.Windows.Forms.MenuItem mnADmin;
private System.Windows.Forms.MenuItem mnItemView;
private System.Windows.Forms.MenuItem mnSite;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.MenuItem menuItem2;
/// </summary>
private System.ComponentModel.Container components = null;
public CfrmChargeMain()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
//
// 关闭数据库联接
//
OracleConnection conn = Connection.DBConnection;
if(conn != null)
{
try
{
conn.Close();
}
catch
{
}
}
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CfrmChargeMain));
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.mnSystem = new System.Windows.Forms.MenuItem();
this.menuItem23 = new System.Windows.Forms.MenuItem();
this.mnRelogin = new System.Windows.Forms.MenuItem();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.mnExit = new System.Windows.Forms.MenuItem();
this.mnPlatf = new System.Windows.Forms.MenuItem();
this.mnSchool = new System.Windows.Forms.MenuItem();
this.mnDept = new System.Windows.Forms.MenuItem();
this.menuItem16 = new System.Windows.Forms.MenuItem();
this.menuItem17 = new System.Windows.Forms.MenuItem();
this.menuItem18 = new System.Windows.Forms.MenuItem();
this.menuItem19 = new System.Windows.Forms.MenuItem();
this.mnADmin = new System.Windows.Forms.MenuItem();
this.mnSite = new System.Windows.Forms.MenuItem();
this.menuItem21 = new System.Windows.Forms.MenuItem();
this.menuItem22 = new System.Windows.Forms.MenuItem();
this.mnItemMain = new System.Windows.Forms.MenuItem();
this.mnSetItem = new System.Windows.Forms.MenuItem();
this.mnItemTask = new System.Windows.Forms.MenuItem();
this.mnItemStart = new System.Windows.Forms.MenuItem();
this.mnItemStop = new System.Windows.Forms.MenuItem();
this.mnItemView = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.mnNewCharge = new System.Windows.Forms.MenuItem();
this.menuItem24 = new System.Windows.Forms.MenuItem();
this.menuItem25 = new System.Windows.Forms.MenuItem();
this.statusBar1 = new System.Windows.Forms.StatusBar();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnSystem,
this.mnPlatf,
this.mnSite,
this.mnItemMain,
this.mnNewCharge});
//
// mnSystem
//
this.mnSystem.Index = 0;
this.mnSystem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem23,
this.mnRelogin,
this.menuItem1,
this.mnExit});
this.mnSystem.Text = "系统 ";
//
// menuItem23
//
this.menuItem23.Index = 0;
this.menuItem23.Text = "修改口令";
this.menuItem23.Click += new System.EventHandler(this.menuItem23_Click);
//
// mnRelogin
//
this.mnRelogin.Index = 1;
this.mnRelogin.Text = "重新登录(&D)";
this.mnRelogin.Click += new System.EventHandler(this.mnRelogin_Click);
//
// menuItem1
//
this.menuItem1.Index = 2;
this.menuItem1.Text = "-";
this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
//
// mnExit
//
this.mnExit.Index = 3;
this.mnExit.Text = "退出(&X)";
this.mnExit.Click += new System.EventHandler(this.mnExit_Click);
//
// mnPlatf
//
this.mnPlatf.Index = 1;
this.mnPlatf.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnSchool,
this.mnDept,
this.menuItem16,
this.menuItem17,
this.menuItem18,
this.menuItem19,
this.mnADmin});
this.mnPlatf.Text = "平台管理";
//
// mnSchool
//
this.mnSchool.Index = 0;
this.mnSchool.Text = "学校管理";
this.mnSchool.Click += new System.EventHandler(this.mnSchool_Click);
//
// mnDept
//
this.mnDept.Index = 1;
this.mnDept.Text = "部门管理";
this.mnDept.Click += new System.EventHandler(this.menuItem17_Click);
//
// menuItem16
//
this.menuItem16.Index = 2;
this.menuItem16.Text = "专业管理";
this.menuItem16.Click += new System.EventHandler(this.menuItem16_Click_2);
//
// menuItem17
//
this.menuItem17.Index = 3;
this.menuItem17.Text = "班级管理";
this.menuItem17.Click += new System.EventHandler(this.menuItem17_Click_1);
//
// menuItem18
//
this.menuItem18.Index = 4;
this.menuItem18.Text = "学生管理";
this.menuItem18.Click += new System.EventHandler(this.menuItem18_Click);
//
// menuItem19
//
this.menuItem19.Index = 5;
this.menuItem19.Text = "教工管理";
this.menuItem19.Click += new System.EventHandler(this.menuItem19_Click);
//
// mnADmin
//
this.mnADmin.Index = 6;
this.mnADmin.Text = "系统管理员管理";
this.mnADmin.Visible = false;
//
// mnSite
//
this.mnSite.Index = 2;
this.mnSite.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem21,
this.menuItem22});
this.mnSite.Text = "收费点维护";
//
// menuItem21
//
this.menuItem21.Index = 0;
this.menuItem21.Text = "工作站管理";
this.menuItem21.Click += new System.EventHandler(this.menuItem21_Click);
//
// menuItem22
//
this.menuItem22.Index = 1;
this.menuItem22.Text = "收费点管理";
this.menuItem22.Click += new System.EventHandler(this.menuItem22_Click);
//
// mnItemMain
//
this.mnItemMain.Index = 3;
this.mnItemMain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnSetItem,
this.mnItemTask,
this.mnItemStart,
this.mnItemStop,
this.mnItemView,
this.menuItem2});
this.mnItemMain.Text = "收费项目管理";
//
// mnSetItem
//
this.mnSetItem.Index = 0;
this.mnSetItem.Text = "创建项目";
this.mnSetItem.Click += new System.EventHandler(this.mnSetItem_Click);
//
// mnItemTask
//
this.mnItemTask.Index = 1;
this.mnItemTask.Text = "项目收费任务维护";
this.mnItemTask.Click += new System.EventHandler(this.mnItemTask_Click);
//
// mnItemStart
//
this.mnItemStart.Index = 2;
this.mnItemStart.Text = "开通收费项目";
this.mnItemStart.Click += new System.EventHandler(this.mnItemStart_Click);
//
// mnItemStop
//
this.mnItemStop.Index = 3;
this.mnItemStop.Text = "废止收费项目";
this.mnItemStop.Click += new System.EventHandler(this.mnItemStop_Click);
//
// mnItemView
//
this.mnItemView.Index = 4;
this.mnItemView.Text = "收费项目属性查看";
this.mnItemView.Click += new System.EventHandler(this.mnItemView_Click);
//
// menuItem2
//
this.menuItem2.Index = 5;
this.menuItem2.Text = "test";
this.menuItem2.Visible = false;
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click_2);
//
// mnNewCharge
//
this.mnNewCharge.Index = 4;
this.mnNewCharge.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem24,
this.menuItem25});
this.mnNewCharge.Text = "交费管理";
this.mnNewCharge.Click += new System.EventHandler(this.menuItem16_Click);
//
// menuItem24
//
this.menuItem24.Index = 0;
this.menuItem24.Text = "项目交费";
this.menuItem24.Click += new System.EventHandler(this.menuItem24_Click);
//
// menuItem25
//
this.menuItem25.Index = 1;
this.menuItem25.Text = "项目交欠费查看";
this.menuItem25.Click += new System.EventHandler(this.menuItem25_Click);
//
// statusBar1
//
this.statusBar1.Location = new System.Drawing.Point(0, 222);
this.statusBar1.Name = "statusBar1";
this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.statusBarPanel1});
this.statusBar1.ShowPanels = true;
this.statusBar1.Size = new System.Drawing.Size(402, 72);
this.statusBar1.TabIndex = 2;
this.statusBar1.PanelClick += new System.Windows.Forms.StatusBarPanelClickEventHandler(this.statusBar1_PanelClick);
//
// statusBarPanel1
//
this.statusBarPanel1.Text = "欢迎使用高校收费系统";
this.statusBarPanel1.Width = 400;
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.SystemColors.Desktop;
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(402, 294);
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
//
// pictureBox2
//
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
this.pictureBox2.Location = new System.Drawing.Point(0, 0);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(408, 384);
this.pictureBox2.TabIndex = 3;
this.pictureBox2.TabStop = false;
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Image = ((System.Drawing.Image)(resources.GetObject("label1.Image")));
this.label1.Location = new System.Drawing.Point(0, 120);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(408, 104);
this.label1.TabIndex = 4;
this.label1.Text = "欢迎使用高校收费系统";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// CfrmChargeMain
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(402, 294);
this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox2);
this.Controls.Add(this.statusBar1);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Menu = this.mainMenu1;
this.Name = "CfrmChargeMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "高校收费系统";
//this.Closing += new System.ComponentModel.CancelEventHandler(this.CfrmChargeMain_Closing);
this.Load += new System.EventHandler(this.CfrmChargeMain_Load);
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new CfrmChargeMain());
}
/// 窗口装载
private void CfrmChargeMain_Load(object sender, System.EventArgs e)
{
//
// 管理员登录
//
CfrmLogin frmLogin = new CfrmLogin();
if (frmLogin.ShowDialog(this) == DialogResult.Cancel)
{
Application.Exit();
return;
}
//登录完成,获取登录管理员用户名
m_sAdminName = Connection.LoginUser;
//sbAdminPanel.Text = "当前管理员 " + m_sAdminName;
statusBarPanel1.Text="当前管理员 " + m_sAdminName;
//
// 获取当前管理员信息
//
int ret = AcquireCurrentAdminInfo();
if (ret != 0)
{
Application.Exit();
return;
}
//
// 获取当前收费点信息
//
ret = AcquireSiteInfo();
//发生未知错误
if (ret == -1)
{
Application.Exit();
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -