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

📄 formmain.cs

📁 超市进销存管理系统 Visual Studio 2005+SQL Sever2005
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using _10901BS;

namespace _10901BS
{
    public partial class formMain : Form
    {
        StreamReader smRd1;
        formDenglu dengLu = new formDenglu();
        SqlCaoZuo ff = new SqlCaoZuo();
        DataTable dt;
        string str,str1;
        SqlDataReader dr;
        public formMain()
        {
            InitializeComponent();
        }

        private void btnTC_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void frmlong_ZCT_Load(object sender, EventArgs e)
        {
            dengLu.ShowDialog();
            
            this.WindowState = FormWindowState.Maximized;//最大化窗口
            this.panel1.Hide();

            str = "SELECT ygName from yhxxBiao,ygBiao where yhID='"+formDenglu.str1+"' and yhName=ygID  ";

            dr = ff.SqlDr(str);
            if (dr.Read()==true)
            {
                this.toolStripStatusLabel2.Text = ff.sqlComCell(str);
            }
            dr.Close();


            str = "SELECT bumen from yhxxBiao,ygBiao where yhID='"+formDenglu.str1+"' and yhName=ygID  ";

            dr = ff.SqlDr(str);
            if (dr.Read()==true)
            {
                this.toolStripStatusLabel5.Text = ff.sqlComCell(str);
            }
            dr.Close();  


            //状态栏第七个文本显示当前系统日期
            this.statusStrip1.Items[6].Text = DateTime.Now.ToLongDateString();
            this.timer1.Enabled = true;
            //状态栏第八个文本显示当前系统时间
            this.statusStrip1.Items[7].Text = DateTime.Now.ToLongTimeString();


            //库存报警提示
            str = "SELECT distinct spxqBiao.spID,spName,spkcxx ";
            str += "from rkxqBiao,spxqBiao, (SELECT spID,sum(shKcsl) AS spzksl ";
            str += "from rkxqBiao group by spID) as aa ";
            str += "where rkxqBiao.spID=spxqBiao.spID ";
            str += "and aa.spID=spxqBiao.spID ";
            str += "and aa.spzksl<=spkcxx ";

            dr = ff.SqlDr(str);
            if (dr.Read() == true)
            {
                dt = ff.dtShuJuBiao(str);
                foreach(DataRow row in dt.Rows)
                {
                    this.lb_Kcbj.Text += "\n\t"+row.ItemArray[0].ToString() +" " + row.ItemArray[1].ToString() +" 的在库数量已经小于该商品的设定的库存下限 " + row.ItemArray[2].ToString() +" \n\t请及时进货!!\n\t";
                }
            }
            dr.Close();  


            //每日应入库提示
            str = "SELECT djID ";
            str += "from DJCZBiao ";
            str += "where DJID LIKE 'JH%' ";
            str += "and SHZT != 'True' ";
 
            dr = ff.SqlDr(str);
            if (dr.Read() == true)
            {
                dt = ff.dtShuJuBiao(str);
                foreach (DataRow row in dt.Rows)
                {
                    this.lb_Yrkts.Text += "\n\t" + row.ItemArray[0].ToString() + " 此进货单据尚未审核入库\n\t请及时入库!!\n\t";
                }
            }
            else
            {
                dr.Close();
                str = "SELECT djID ";
                str += "from DJCZBiao ";
                str += "where djid like 'JH%' and  DJID not in  ";
                str += "(SELECT JhDjID from rkxqBiao) ";

                dr = ff.SqlDr(str);
                if (dr.Read() == true)
                {
                    dt = ff.dtShuJuBiao(str);
                    foreach (DataRow row in dt.Rows)
                    {
                        this.lb_Yrkts.Text += "\n\t" + row.ItemArray[0].ToString() + " 此进货单据已经审核,但尚未入库\n\t请及时入库!!\n\t";
                    }
                }

            }
            dr.Close();  

        }



        private void 重新登陆ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //起动主窗体(exe)
            smRd1 = new StreamReader(@"..\..\Resources\重新登陆.txt", Encoding.Default);
            str1 = smRd1.ReadLine().ToString();
            smRd1.Close();
            Process.Start(str1);
            this.Close();
        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            //状态栏第八个文本显示当前系统时间
            this.statusStrip1.Items[7].Text = DateTime.Now.ToLongTimeString();
        }



        private void 供应商信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.panel1.Hide();
            formGhsBiao ghs=new formGhsBiao();
            ghs.MdiParent = this;
            ghs.Show();

        }


        private void 销售查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.panel1.Hide();
            formXscx xscx=new formXscx();
            xscx.MdiParent = this;
            xscx.Show();
        }

        private void 前台POS销售系统ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new formPos().ShowDialog();
        }

 

        private void bt_Jhzx_MouseEnter(object sender, EventArgs e)
        {
            if(this.ActiveMdiChild!=null)
                return;

            smRd1 = new StreamReader(@"..\..\Resources\进货业务.txt", Encoding.Default);
            str1 = smRd1.ReadLine().ToString();
            smRd1.Close();
            this.label1.Text = str1;

            smRd1 = new StreamReader(@"..\..\Resources\进货查询.txt", Encoding.Default);
            str1 = smRd1.ReadLine().ToString();
            smRd1.Close();
            this.label2.Text = str1;

            this.bt_Jhzx.Dock = DockStyle.Fill;
            this.bt_Xszx.Dock = DockStyle.None;
            this.bt_Kczx.Dock = DockStyle.None;
            this.bt_Mrts.Dock = DockStyle.None;
            this.bt_Jbxs.Dock = DockStyle.None;
            this.bt_Xtgl.Dock = DockStyle.None;

            //功能按钮
            this.panel1.Show();
            this.bt_Xscx.Visible = false;
            this.bt_Posqt.Visible = false;
            this.bt_Rkyw.Visible = false;
            this.bt_Gysxx.Visible = false;
            this.bt_Spxx.Visible = false;
            this.bt_Khxx.Visible = false;
            this.bt_Yggl.Visible = false;
            this.bt_Yhxx.Visible = false;
            this.bt_Kccx.Visible = false;
            this.lb_Yrkts.Visible = false;
            this.label3.Visible = false;
            this.label4.Visible = false;
            this.pictureBox1.Visible = false;
            this.pictureBox3.Visible = false;
            this.pictureBox5.Visible = false;

            this.bt_Jhyw.Visible = true;
            this.bt_Jhcx.Visible = true;
            this.lb_Kcbj.Visible = true;
            this.label1.Visible = true;
            this.label2.Visible = true;

            this.bt_Jhyw.Location = new Point(20, 70);
            this.bt_Jhcx.Location = new Point(20, 130);
            this.lb_Kcbj.Location = new Point(20, 250);

            this.label1.Location = new Point(250, 75);
            this.label2.Location = new Point(250, 135);

        }

        private void bt_Xszx_MouseEnter(object sender, EventArgs e)
        {
            if (this.ActiveMdiChild != null)
                return;

            smRd1 = new StreamReader(@"..\..\Resources\前台POS系统.txt", Encoding.Default);
            str1 = smRd1.ReadLine().ToString();
            smRd1.Close();
            this.label1.Text = str1;

            smRd1 = new StreamReader(@"..\..\Resources\销售查询.txt", Encoding.Default);
            str1 = smRd1.ReadLine().ToString();
            smRd1.Close();
            this.label2.Text = str1;

            this.bt_Xszx.Dock = DockStyle.Fill;
            this.bt_Jhzx.Dock = DockStyle.None;
            this.bt_Kczx.Dock = DockStyle.None;
            this.bt_Mrts.Dock = DockStyle.None ;
            this.bt_Jbxs.Dock = DockStyle.None;
            this.bt_Xtgl.Dock = DockStyle.None;

            //功能按钮
            this.panel1.Show();

            this.bt_Jhyw.Visible = false;
            this.bt_Jhcx.Visible = false;
            this.lb_Yrkts.Visible = false;
            this.lb_Kcbj.Visible = false;
            this.bt_Rkyw.Visible = false;
            this.bt_Gysxx.Visible = false;
            this.bt_Spxx.Visible = false;
            this.bt_Khxx.Visible = false;
            this.bt_Yggl.Visible = false;
            this.bt_Yhxx.Visible = false;
            this.bt_Kccx.Visible = false;
            this.label3.Visible = false;
            this.label4.Visible = false;
            this.pictureBox1.Visible = false;
            this.pictureBox3.Visible = false;
            this.pictureBox5.Visible = false;

            this.bt_Xscx.Visible = true;
            this.bt_Posqt.Visible = true;
            this.label1.Visible = true;
            this.label2.Visible = true;

            this.bt_Xscx.Location = new Point(20, 160);
            this.bt_Posqt.Location = new Point(20, 220);
            this.label1.Location = new Point(250, 165);
            this.label2.Location = new Point(250, 225);



        }

        private void bt_Kczx_MouseEnter(object sender, EventArgs e)
        {
            if (this.ActiveMdiChild != null)
                return;

            smRd1 = new StreamReader(@"..\..\Resources\库存业务.txt", Encoding.Default);
            str1 = smRd1.ReadLine().ToString();
            smRd1.Close();
            this.label1.Text = str1;

            smRd1 = new StreamReader(@"..\..\Resources\库存查询.txt", Encoding.Default);
            str1 = smRd1.ReadLine().ToString();
            smRd1.Close();
            this.label2.Text = str1;

            this.bt_Kczx.Dock = DockStyle.Fill;
            this.bt_Xszx.Dock = DockStyle.None;
            this.bt_Jhzx.Dock = DockStyle.None;
            this.bt_Mrts.Dock = DockStyle.None;
            this.bt_Jbxs.Dock = DockStyle.None;
            this.bt_Xtgl.Dock = DockStyle.None;

            //功能按钮
            this.panel1.Show();


            this.bt_Jhyw.Visible = false;
            this.bt_Jhcx.Visible = false;
            this.lb_Kcbj.Visible = false;
            this.bt_Xscx.Visible = false;
            this.bt_Posqt.Visible = false;
            this.bt_Gysxx.Visible = false;
            this.bt_Spxx.Visible = false;
            this.bt_Khxx.Visible = false;
            this.bt_Yggl.Visible = false;
            this.bt_Yhxx.Visible = false;
            //this.label2.Visible = false;
            this.label3.Visible = false;
            this.label4.Visible = false;
            this.pictureBox1.Visible = false;
            this.pictureBox3.Visible = false;
            this.pictureBox5.Visible = false;

            this.bt_Rkyw.Visible = true;
            this.bt_Kccx.Visible = true;
            this.lb_Yrkts.Visible = true;

⌨️ 快捷键说明

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