仓库物资管理系统(C#+SQL)

目 录
摘要………………………………………………………………………………………………1
一 绪论………………………………………………………………………………………1

  1. 1管理信息系统的概述…………………………………………………………………………………1
  2. 2数据库应用系统开发简介…………………………………………………………………………2
  3. 3物资管理系统…………………………………………………………………………………………2
    1.3.1国内外同类管理软件的研究现状与发展趋势……………………………………………2
    1.3.2物资管理系统研究背景与意义………………………………………………………………2
    二 物资管理系统设计分析…………………………………………………………3
    2.1需求分析…………………………………………………………………………………………………3
    2.2模块划分…………………………………………………………………………………………………4
    三 数据库设计…………………………………………………………………………4
    3.1 设计的数据项和数据结构如下…………………………………………………………4
    3.2 数据库概念结构设计……………………………………………………………………………5
    3.3数据库逻辑结构设计………………………………………………………………………………7
    3.4 数据库和数据库表创建语法……………………………………………………………………8
    四 详细设计(代码)………………………………………………………………10
    4.1 系统登陆窗体模块的设计………………………………………………………………10
    4.2 货品入库窗体模块的设计………………………………………………………………11
    4.3 货品出库窗体模块的设计 ………………………………………………………………12
    4.4 货品入库查询窗体模块的设计 ………………………………………………………13
    4.5 货品出库查询窗体模块的设计 ………………………………………………………15
    4.6 用户注销窗体模块的设计 ……………………………………………………………16
    五 程序的实现…………………………………………………………17
    5.1 系统登陆的实现…………………………………………………………………………17
    5.2 货品入库的实现…………………………………………………………………………18
    5.3 货品入库查询的实现 …………………………………………………………………19
    5.4 货品出库的实现 ………………………………………………………………………20
    5.5 货品出库查询的实现 …………………………………………………………………20
    5.6 用户密码修改的实现 …………………………………………………………………20
    六 课程设计总结……………………………………………………21
    七 参考文献 ………………………………………………………21
    二 物资管理系统设计分析
    物资管理系统是典型的信息管理系统,其开发主要包括后台数据库的建立和维护以及前端应用程序的开发两个方面。对于前者要求建立起数据一致性和完整性强、数据安全性好的数据库。而对于后者则要求应用程序功能完备,易使用等特点。
    2.1 需求分析:
    通过对系统的终端用户、生产商和销售商进行分析,可以得到本系统典型的文本需求说明,其中的关键部分如下:
    基本信息是物资管理系统得以运行的数据基础。基本信息包括产品信息、仓库信息、生产商信息和销售商的信息。用户可以通过界面来随时添加、修改和查询这些信息。
    出入库管理是物资管理系统的核心部分,实现产品的出入库登记。产品出入库登记中的产品信息、仓库信息、生产商信息和销售商的信息都是从已有的信息中通过下拉列表选择的,这样可以减少出错,提高效率;如果在基本信息中找不到相关信息即时进行添加。
    根据用户需求,该系统应该实现以下功能:
    1)基本信息(包括产品信息、仓库信息、生产商和销售商信息)的添加、修改和查询。
    2)填写基本信息→提交信息填写
    3)修改基本信息→提交信息修改
    4)选择填写查询条件→提交查询→查询结果显示
    5)产品入库登记、修改和查询。
    6)填写入库产品信息→提交入库登记
    7)修改入库登记→提交信息修改
    8)选择填写查询条件→提交查询→查询结果显示
    9)品出库登记、修改和查询。
    10)出库选择→填写出库产品信息→提交出库登记
    11)修改出库登记→提交信息修改
    12)选择填写查询条件→提交查询→查询结果显示
    13)产品库存统计信息查询
    14)选择查询条件→填写查询内容→提交查询→查询结果显示
    15)用户和物资管理员注册
    16)登录→输入用户名→输入密码→注册
    17)用户修改密码和物资管理员添加用户。
    28)输入旧密码→输入新密码→确认新密码→提交密码修改
    29)本文转载自http://www.biyezuopin.vip/onews.asp?id=13045输入新用户名→输入用户密码→确认密码→设置用户权限→提交用户添加
    2.2模块划分
    在这里插入图片描述

2.2.1系统功能模块设计
在这里插入图片描述

2.2.2数据流程图

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
//download by http://www.codefans.net
namespace CkglS1
{
	/// <summary>
	/// login 的摘要说明。
	/// </summary>
	public class login : System.Windows.Forms.Form
	{
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.TextBox text1;
		private System.Windows.Forms.TextBox text2;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public login()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(login));
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.text2 = new System.Windows.Forms.TextBox();
            this.text1 = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            // 
            // pictureBox1
            // 
            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
            this.pictureBox1.Location = new System.Drawing.Point(-3, -2);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(241, 100);
            this.pictureBox1.TabIndex = 0;
            this.pictureBox1.TabStop = false;
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.text2);
            this.groupBox1.Controls.Add(this.text1);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.groupBox1.Location = new System.Drawing.Point(5, 104);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(242, 89);
            this.groupBox1.TabIndex = 1;
            this.groupBox1.TabStop = false;
            // 
            // text2
            // 
            this.text2.Location = new System.Drawing.Point(77, 53);
            this.text2.Name = "text2";
            this.text2.PasswordChar = '*';
            this.text2.Size = new System.Drawing.Size(156, 21);
            this.text2.TabIndex = 3;
            this.text2.Text = "123456";
            // 
            // text1
            // 
            this.text1.Location = new System.Drawing.Point(77, 20);
            this.text1.Name = "text1";
            this.text1.Size = new System.Drawing.Size(156, 21);
            this.text1.TabIndex = 2;
            this.text1.Text = "admin";
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(6, 56);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(64, 15);
            this.label2.TabIndex = 1;
            this.label2.Text = "密  码:";
            // 
            // label1
            // 
            this.label1.Location = new System.Drawing.Point(6, 26);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(64, 15);
            this.label1.TabIndex = 0;
            this.label1.Text = "用户名:";
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(82, 199);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 2;
            this.button1.Text = "登录";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // button2
            // 
            this.button2.Location = new System.Drawing.Point(163, 199);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 3;
            this.button2.Text = "退出";
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // login
            // 
            this.AcceptButton = this.button1;
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
            this.ClientSize = new System.Drawing.Size(259, 228);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.pictureBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "login";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "用户登录";
            this.Closed += new System.EventHandler(this.login_Closed);
            this.Load += new System.EventHandler(this.login_Load);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.ResumeLayout(false);

		}
		#endregion

		public bool _log=false;
		int _count=0;
		private void button2_Click(object sender, System.EventArgs e)
		{
			Application.Exit();
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			if(text1.Text=="")
			{
				MessageBox.Show("请输入用户名。","登录提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				text1.Focus();
			}
			else
			{
				_count++;
				string _name,_pass;
				_name=text1.Text.Trim();
				_pass=text2.Text.Trim();
				c_form.myad=new SqlDataAdapter("select pass from yh where name='"+_name+"'",c_form.conn);
				c_form.myad.Fill(c_form.mydata,"yhdl");
				if(c_form.mydata.Tables["yhdl"].Rows.Count==0)
				{
					if(_count==3)
					{
						MessageBox.Show("输入三次错误,自动退出登录。","登录提示",MessageBoxButtons.OK,MessageBoxIcon.Stop);
						Application.Exit();
					}
					else
					{
						MessageBox.Show("用户名错误,请重新输入。","登录提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
						text1.Focus();
					}
				}
				else
				{
					string _passstr=c_form.mydata.Tables["yhdl"].Rows[0][0].ToString().Trim();
					if(_passstr!=_pass)
					{
						if(_count==3)
						{
							MessageBox.Show("输入三次错误,自动退出登录。","登录提示",MessageBoxButtons.OK,MessageBoxIcon.Stop);
							Application.Exit();
						}
						else
						{
							MessageBox.Show("密码错误,请重新输入。","登录提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
							text1.Focus();
						}
					}
					else
					{
						c_form._name=_name;
						_log=true;
						this.Close();
					}
				}
			}
		}

		private void login_Closed(object sender, System.EventArgs e)
		{
			c_form.mydata.Tables.Clear();
			if(_log==false)
				Application.Exit();
		}

        private void login_Load(object sender, EventArgs e)
        {

        }

	}
}

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shejizuopin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值