购书中心管理系统的设计

欢迎微信扫一扫互相交流学习哦!

二维码

项目源码:https://gitee.com/oklongmm/biye

摘要
随着信息时代的步伐的加快,各行各业都采用了现代化的管理手段。对购书中心而言,当然也是必不可少的,因为通过它可以提高管理水平,加快操作速度,快速而准确的进行各种统计等,从而提高在行业内的竞争力。本系统完成的基本任务是完成购书中心的基本管理功能,其中包括购书中心的进货功能,售货功能,价格查询,价格管理,修改密码,添加用户等多项功能,又很大的实用价值。
本系统所用的开发工具是Microsoft Visual Studio 2010,通过C#技术来实现的,其中系统的后台数据库是Microsoft SQL Server 2005来支持。


关键词  销售,数据库分析和设计,前台界面,E-R实体图,数据表关系图

Title  Supermarket Management System     
Abstract
    With the speeding up of the pace of the information age, the from all walks of life have adopted modern management means. It is also necessary for supermarkets, of course, because it can improve the level of management, speed up the operation, fast and accurate for various statistics, etc, so as to improve the competitiveness of the industry. This system to complete the basic task is to complete the supermarket's basic management functions, including functions of supermarket replenish onr's stock, sales function, price inquiry, price management, change passwords, add users and so on many functions, and great practical value.
    Development tools used in this system is a Microsoft Visual Studio 2010, through the c # technology to realize, the background database of the system is a Microsoft SQL Server 2005 to support.


Keyword  sell, database analysis and design, the front desk interface, E - R entity graph, data table diagram 

           


目   录 
1 引言    1
2 项目需求分析    1
2.1 系统管理员对功能的需求    1
2.2 销售人员对功能的需求    1
2.3 购书中心经理对功能的需求    1
2.4 方案的可行性    2
3  项目概念设计    2
3.1系统功能描述    2
3.2 功能模块划分    2
4  项目逻辑结构设计    5
5 编码    7
6 项目测试    12
6.1 登录界面    12
6.2主界面登录    12
6.3商品管理    13
6.4 购书中心会员管理    13
6.5 销售录入    13
致  谢    16
参 考 文 献    17

 
1 引言
    购书中心管理系统是一个有很大实用价值的系统,特别是在各行各业都采用现代化管理的时代。本系统的基本功能是帮助购书中心的工作人员处理日常的基本工作,包括一般的进货工作,价格管理等多方面的工作,可以减少工作人员的工作量,以及工作成本,主要的业务是处理进货售货你的管理,开发目标是实现一个功能强的系统,来帮助购书中心获得更大的收益。
2 项目需求分析
    购书中心管理系统是一个很实用的系统,现在几乎所有的大型购书中心都有自己的管理系统,这个系统的运用时十分广泛的,所以用户的需求是非常大的。本系统所要解决的基本问题是货物的录入,查询,价格的制定,价格的调查,销售记录的查询与存档,并且在录入的过程中对货物进行分类,以便与查询。
2.1 系统管理员对功能的需求
2.1.1 用户信息管理:管理系统中所有登录用户的信息,分配用户的级别。
2.1.2 会员信息管理:可浏览、添加、查找会员信息。
2.1.3 商品信息管理:可添加商品信息。
2.1.4 商品信息的查询: 可查询所有库存商品信息。
2.1.5 密码修改:修改登录密码。
2.2 销售人员对功能的需求
2.2.1 销售情况录入:可浏览、添加已销售商品信息。
2.2.2 密码修改:修改登录密码。
2.3 购书中心经理对功能的需求
2.3.1 会员信息管理:可浏览、添加、查找会员信息。
2.3.2 商品信息管理:可添加商品信息。
2.3.3 商品信息的查询: 可查询所有库存商品信息。
2.3.4 销售情况查询:可浏览已销售商品信息。
2.3.5 密码修改:修改登录密码。

2.4 方案的可行性
经过思考,改方案可行。应为该方案基本满足了目前一些购书中心的基本运营要求。
3  项目概念设计
3.1系统功能描述
3.1.1 用户登录
由于此系统涉及不同的用户级别,因此要对不用登录用户分配不同的权限页面,并记录下每个用户ID和级别数据。
3.1.2 查看用户信息
系统管理员登录系统后,主界面系统设置-用户管理,显示用户编码、用户姓名、用户权限信息。
3.1.3 维护用户信息
系统管理员可以增加新的用户信息,包括用户编码、用户姓名、用户权限,管理员还可以修改或删除某一用户的信息记录。
3.1.4 查看商品信息
可以浏览项目商品库存列表,包括项商品编号、商品名称、价格、库存量、库存报警数、计划进货数、促销价格、促销起始日期、厂商地址。
3.1.5 进货管理
通过查看库存数量可以生成进货单,包括进货编号、商品编号、商品单价、商品总额、进货日期等。
3.1.6 购书中心会员信息管理
可以添加会员,查询会员信息,包括会员编号、卡号、姓名、电话、地址、消费金额、注册日期的信息。
3.1.7 销售产品录入管理
可以产看已销售商品编号、销售日期、销售数量、销售金额、支付方式、销售人员、会员卡号等信息。
3.1.8 密码信息的修改
可以修改密码信息,填写旧密码,然后填写新更新的密码,或将旧密码更新为新密码。
3.2 功能模块划分
3.2.1 用户登录管理
用户登录系统,并划分用户的管理权限。
3.2.2 用户信息管理
查看用户的信息、增加、修改、删除项目信息。
3.2.3 商品信息管理
查看商品的信息、增加、修改、删除项目信息。
3.2.4 会员添加管理
增加购书中心会员信息。
3.2.5 销售情况查询管理
    对已销售商品的情况进行添加、修改、查询的操作。
3.2.6 密码修改管理
修改登录密码信息。


3.3 算法原理阐述
3.3.1 商品信息管理
商品信息由系统管理员维护管理。商品信息管理提供了商品信息的列表,在此列表中可查看、修改、删除商品的记录信息。在添加商品信息界面中,可添加新的商品信息记录。用户信息管理功能流程图如下。


3.3.2 会员管理
会员管理提供了管理员对购书中心会员的添加、修改查询等功能,其功能流程图如下。

3.3.3销售人员对已销售商品管理
    对销售人员提供了对已销售商品的记录功能,让销售人员对售出商品的售出时间、价格、支付手段等信息进行记录。
3.3.4 密码修改管理
密码修改管理的主要功能是修改登陆用户的密码,用户定期更换密码,保证其登录的安全性。
3.4 E-R模型图
3.4.1 商品E-R实体图
商品的实体具有商品编号、商品名称、库存数量、库存警报、计划进货数、销售允许、厂商编号、销售单价、促销价9个属性,员工实体图如下图。

3.4.2会员E-R实体图
购书中心会员的实体具有会员编号、卡号、姓名、电话、地址、注册时间、消费金额7个属性、日志E-R实体图如下图。

4  项目逻辑结构设计
4.1 数据表的创建
4.1.1 商品信息表
商品信息表(Merch)用于存放商品的各种信息,商品信息的管理是购书中心管理系统中必不可少的部分。具体表如下。
 
 

4.1.2 会员信息表
会员信息表(MarketMember)用于存购书中心会员的信息,购书中心管理重要的部分,具体表如下。
 
 


4.1.3 库存信息表
库存信息表(Stock)用于存放仓库中商品信息,库存商品是进货的主要依据。具体表如下。
  

4.2 数据表关系图
在购书中心管理系统中各个数据表的关系图如下图所示。
 


5 编码
5.1 login后台代码
namespace 购书中心管理信息系统
{
    /// <summary>
    /// Login 的摘要说明。
    /// </summary>
    public class Login : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button Exitlogin;
        private System.Windows.Forms.Button loginbutt;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.TextBox PwdTxt;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox UserNameTxt;
        private System.Windows.Forms.Label label2;
        
        public static bool CanLogin = false;  //记录能否检验通过
        public static string strUser = "";      //记录用户名
        public static string strUserRole = "";      //记录用户权限    
        public static string strUserId = "";      //记录用户编号    
        private string connectionString = "workstation id=localhost;Integrated Security=SSPI;database=MarketMagSys";
        //与数据库的连接
        private SqlConnection myConnection;
        private SqlDataAdapter da;
        
        private DataSet ds = new DataSet();
        private DataTable LogTable;
        private DataRow LogRow;

        private string StrSQL = "SELECT * from SyUser";
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.Container components = null;

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

            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
            this.myConnection = new SqlConnection(connectionString);
            this.da = new SqlDataAdapter(this.StrSQL,this.myConnection);
            this.ds.Clear();
            this.da.Fill(ds,"SyUser");
            this.LogTable = ds.Tables[0];
            
        }

        /// <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.Exitlogin = new System.Windows.Forms.Button();
            this.loginbutt = new System.Windows.Forms.Button();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.PwdTxt = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.UserNameTxt = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            // 
            // Exitlogin
            // 
            this.Exitlogin.BackColor = System.Drawing.Color.Transparent;
            this.Exitlogin.Location = new System.Drawing.Point(279, 252);
            this.Exitlogin.Name = "Exitlogin";
            this.Exitlogin.Size = new System.Drawing.Size(88, 24);
            this.Exitlogin.TabIndex = 12;
            this.Exitlogin.Text = "退出";
            this.Exitlogin.UseVisualStyleBackColor = false;
            this.Exitlogin.Click += new System.EventHandler(this.Exitlogin_Click);
            // 
            // loginbutt
            // 
            this.loginbutt.BackColor = System.Drawing.Color.Transparent;
            this.loginbutt.Location = new System.Drawing.Point(46, 252);
            this.loginbutt.Name = "loginbutt";
            this.loginbutt.Size = new System.Drawing.Size(88, 24);
            this.loginbutt.TabIndex = 11;
            this.loginbutt.Text = "登陆";
            this.loginbutt.UseVisualStyleBackColor = false;
            this.loginbutt.Click += new System.EventHandler(this.loginbutt_Click);
            // 
            // groupBox1
            // 
            this.groupBox1.BackColor = System.Drawing.Color.Transparent;
            this.groupBox1.Controls.Add(this.PwdTxt);
            this.groupBox1.Controls.Add(this.label3);
            this.groupBox1.Controls.Add(this.UserNameTxt);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Location = new System.Drawing.Point(110, 96);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(208, 100);
            this.groupBox1.TabIndex = 10;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "用户信息输入";
            // 
            // PwdTxt
            // 
            this.PwdTxt.Location = new System.Drawing.Point(88, 56);
            this.PwdTxt.Name = "PwdTxt";
            this.PwdTxt.PasswordChar = '*';
            this.PwdTxt.Size = new System.Drawing.Size(104, 21);
            this.PwdTxt.TabIndex = 4;
            // 
            // label3
            // 
            this.label3.Location = new System.Drawing.Point(8, 64);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(72, 16);
            this.label3.TabIndex = 3;
            this.label3.Text = "*用户密码:";
            // 
            // UserNameTxt
            // 
            this.UserNameTxt.Location = new System.Drawing.Point(88, 32);
            this.UserNameTxt.Name = "UserNameTxt";
            this.UserNameTxt.Size = new System.Drawing.Size(104, 21);
            this.UserNameTxt.TabIndex = 2;
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(8, 40);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(72, 16);
            this.label2.TabIndex = 1;
            this.label2.Text = "*用户姓名:";
            // 
            // Login
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
            this.BackColor = System.Drawing.Color.Cornsilk;
            this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
            this.ClientSize = new System.Drawing.Size(430, 372);
            this.Controls.Add(this.Exitlogin);
            this.Controls.Add(this.loginbutt);
            this.Controls.Add(this.groupBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.Name = "Login";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "欢迎来到购书中心管理系统";
            this.Load += new System.EventHandler(this.Login_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.ResumeLayout(false);

        }
        #endregion

        private void loginbutt_Click(object sender, System.EventArgs e)
        {
            for (int i=0;i<LogTable.Rows.Count;i++)
            {
                this.LogRow = LogTable.Rows[i];
                //只有当输入的用户名和密码同时对应上数据库中记录时,才能通过校验
                if (LogRow[1].ToString().Trim()==this.UserNameTxt.Text.ToString().Trim() && LogRow[2].ToString().Trim()==this.PwdTxt.Text.ToString().Trim())
                {                    
                    CanLogin = true;
                    strUser = LogRow[1].ToString().Trim();//保存用户名
                    strUserRole = LogRow[3].ToString().Trim();//保存用户权限
                    strUserId=LogRow[0].ToString().Trim();//保存用户权限
                    this.Close();//关闭窗体
                    return;
                }
            }
            MessageBox.Show( "您输入的用户号或密码不正确!");
            return;
        }

        private void Exitlogin_Click(object sender, System.EventArgs e)
        {
            CanLogin = false;
            this.Close();
        }

        private void Login_Load(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
    }
}


6 项目测试
6.1 登录界面
 
6.2 主界面登录
 
6.3 商品管理
 
6.4 购书中心会员管理
 

6.5 销售录入
 
6.6 用户管理
 
6.7 密码修改
 


结  论

本系统的工作时间主要集中在需求分析上,尽可能实现表结构的完整性与合理性,但是实际的情况有所出入,在不断地学习中,随着相关技术知识的积累,对本设计的认识也在不断地改变,其最根本所在还是对表结构的修改,尤其是随着视图、存储过程的实现过程中,不断地思索出本系统中需要解决的问题,不断地发现问题解决问题,所以在最后的设计阶段省去了很大的精力与时间。通过这次的数据库课程设计让我们对数据库有了更加深入的了解,以及如何用数据库和C#语言进行连接,在遇到不会的问题的时候先要自己通过查课本,上网来解决,实在解决不掉的问题,问老师和同学。在不断的遇到问题解决问题的过程中,让我们学到了很多的知识。就现在而言,我们对数据库还不能应用自如,所以我们还应该继续努力的来学习数据库的相关知识。
 

猜你喜欢

转载自blog.csdn.net/weixin_55459367/article/details/113924246