⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 message.cs

📁 一个农村管理系统的程序 数据库那部分可能不全 大家可以
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace MsgSystem
{
    public partial class Main_message : Form
    {
        public SqlConnection conn = null;
        public ConnectionPool conns =null;

        public Main_message( )
        {
            InitializeComponent();

            //conns = Program.conns;
            //why it doesn't work if I initiate it like this.

        }

        private void main_staffMenuItem_Click(object sender, EventArgs e)
        {
            Main_staff main = new Main_staff();
            main.MdiParent = this;
            main.Show();
        }

        private void hand_disposeMenuItem_Click(object sender, EventArgs e)
        {
            Hand_dispose hand = new Hand_dispose();
            hand.MdiParent = this;
            hand.Show();
        }

        private void sys_recordMenuItem_Click(object sender, EventArgs e)
        {
            Sys_record sys = new Sys_record();
            sys.MdiParent = this;
            sys.Show();
        }

        private void prod_staffMenuItem_Click(object sender, EventArgs e)
        {
            Prod_staff prod1 = new Prod_staff();
            prod1.MdiParent = this;
            prod1.Show();
        }

        private void prod_sendMenuItem_Click(object sender, EventArgs e)
        {
            Prod_send prod2 = new Prod_send();
            prod2.MdiParent = this;
            prod2.Show();
        }

        private void prod_seeMenuItem_Click(object sender, EventArgs e)
        {
            Prod_see prod3 = new Prod_see();
            prod3.MdiParent = this;
            prod3.Show();
        }

        private void fi_staffMenuItem_Click(object sender, EventArgs e)
        {
            Fi_staff fi1 = new Fi_staff();
            fi1.MdiParent = this;
            fi1.Show();
        }

        private void fi_sendMenuItem_Click(object sender, EventArgs e)
        {
            Fi_send fi2 = new Fi_send();
            fi2.MdiParent = this;
            fi2.Show();
        }

        private void fi_seeMenuItem_Click(object sender, EventArgs e)
        {
            Fi_see fi3 = new Fi_see();
            fi3.MdiParent = this;
            fi3.Show();
        }

        private void bug_staffMenuItem_Click(object sender, EventArgs e)
        {
            Bug_staff bug1 = new Bug_staff();
            bug1.MdiParent = this;
            bug1.Show();
        }

        private void bug_sendMenuItem_Click(object sender, EventArgs e)
        {
            Bug_send bug2 = new Bug_send();
            bug2.MdiParent = this;
            bug2.Show();
        }

        private void bug_seeMenuItem_Click(object sender, EventArgs e)
        {
            Bug_see bug3 = new Bug_see();
            bug3.MdiParent = this;
            bug3.Show();
        }

        private void dis_staffMenuItem_Click(object sender, EventArgs e)
        {
            Dis_staff dis1 = new Dis_staff();
            dis1.MdiParent = this;
            dis1.Show();
        }

        private void dis_sendMenuItem_Click(object sender, EventArgs e)
        {
            Dis_send dis2 = new Dis_send();
            dis2.MdiParent = this;
            dis2.Show();
        }

        private void dis_seeMenuItem_Click(object sender, EventArgs e)
        {
            Dis_see dis3 = new Dis_see();
            dis3.MdiParent = this;
            dis3.Show();
        }

        private void sec_staffMenuItem_Click(object sender, EventArgs e)
        {
            Sec_staff sec1 = new Sec_staff();
            sec1.MdiParent = this;
            sec1.Show();
        }

        private void sec_sendMenuItem_Click(object sender, EventArgs e)
        {
            Sec_send sec2 = new Sec_send();
            sec2.MdiParent = this;
            sec2.Show();
        }

        private void sec_seeMenuItem_Click(object sender, EventArgs e)
        {
            Sec_see sec3 = new Sec_see();
            sec3.MdiParent = this;
            sec3.Show();
        }

        private void edu_staffMenuItem_Click(object sender, EventArgs e)
        {
            Edu_staff edu1 = new Edu_staff();
            edu1.MdiParent = this;
            edu1.Show();
        }

        private void edu_sendMenuItem_Click(object sender, EventArgs e)
        {
            Edu_send edu2 = new Edu_send();
            edu2.MdiParent = this;
            edu2.Show();
        }

        private void edu_seeMenuItem_Click(object sender, EventArgs e)
        {
            Edu_see edu3 = new Edu_see();
            edu3.MdiParent = this;
            edu3.Show();
        }

        private void pol_staffMenuItem_Click(object sender, EventArgs e)
        {
            Pol_staff pol1 = new Pol_staff();
            pol1.MdiParent = this;
            pol1.Show();
        }

        private void pol_sendMenuItem_Click(object sender, EventArgs e)
        {
            Pol_send pol2 = new Pol_send();
            pol2.MdiParent = this;
            pol2.Show();
        }

        private void pol_seeMenuItem_Click(object sender, EventArgs e)
        {
            Pol_see pol3 = new Pol_see();
            pol3.MdiParent = this;
            pol3.Show();
        }

        private void event_staffMenuItem_Click(object sender, EventArgs e)
        {
            Event_staff event1 = new Event_staff();
            event1.MdiParent = this;
            event1.Show();
        }

        private void event_sendMenuItem_Click(object sender, EventArgs e)
        {
            Event_send event2 = new Event_send();
            event2.MdiParent = this;
            event2.Show();
        }

        private void event_seeMenuItem_Click(object sender, EventArgs e)
        {
            Event_see event3 = new Event_see();
            event3.MdiParent = this;
            event3.Show();
        }

        private void toolStripStatusLabel1_Click(object sender, EventArgs e)
        {

        }

        private void flowLayoutPanel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void Main_message_Load(object sender, EventArgs e)
        {

        }

        private void splitContainer1_Panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {

        }

        private void toolStripStatusLabel3_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void toolStrip2_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            Program.main_wnd.Text = "" + conns.getSize();
            conn = conns.getConnection();
            Console.WriteLine("there are still {0} connections", conns.getSize());



        }

        private void testConnectionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //these all works, see what it means


            if (conns == null)
            {
                conns = Program.conns;

                Program.main_wnd.Text = Program.main_wnd.Text + " null";
            }
            else
            {

                conn = conns.getConnection();
                Text = "" + conns.getSize( ) + " remaining";

            }

            if (Program.conns == null)
            {
                Program.main_wnd.Text = Program.main_wnd.Text + "null again";
            }
        }

        private void getAConnectionToolStripMenuItem_Click(object sender, EventArgs e)
        {

            conn = Program.conns.getConnection();
            Text = "" +Program.conns.getSize() + " remaining";

        }

        private void releaseItToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool temp = Program.conns.releaseConnection( conn);

            if( temp)
            {
                Text = "" + Program.conns.getSize() + " remaining"; 
            }
        }

        private void ShutDown_Click(object sender, EventArgs e)
        {
            DbFun.insertSysMsg( "System shun-down.");
            Application.Exit();
        }


    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -