全套资源下载地址:https://download.csdn.net/download/sheziqiong/86795148
全套资源下载地址:https://download.csdn.net/download/sheziqiong/86795148
目录
1 题目与要求 4
1.1问题提出 4
1.2本系统涉及的知识点 4
1.3 实现功能 4
2 数据结构 5
2.1 用户表User 5
2.2 商品表commodity 5
2.3 订单表sales 5
3 程序简述与功能 6
2.1 程序简述 6
2.2 实现功能 6
2.3 程序流程图 7
2.3.1 主程序 7
2.3.2 商品管理模块流程图 8
2.3.4 收银台模块流程图 8
2.3.5 订单管理模块流程图 9
2.3.6 用户管理模块流程图 9
2.3.7 注册/编辑模块流程图 10
4 软件运行详情 11
4.1 登录模块 11
4.1.1 显示密码 11
4.1.2 注册 12
4.1.3 异常处理 12
4.2 主界面 13
4.2.1 库存补充 14
4.2.2 异常处理 14
4.3 商品管理模块 16
4.3.1 筛选与查询 16
4.3.2 添加 17
4.3.3 删除 18
4.3.4 编辑模式 18
4.3.4 异常处理 19
4.4收银台模块 21
4.4.1 异常处理 22
4.5 销售详情模块 23
4.5.1 属性与查询 23
4.5.2 异常处理 24
4.6 用户管理模块 25
4.6.1 添加与删除 26
4.6.2 筛选与查询 27
4.6.3 编辑用户 28
4.6.4 异常处理 28
4.7* 隐藏彩蛋 29
5 心得体会 30
6 参考文献 31
2 数据结构
本系统包含用户表、商品表、订单表三个表单,并在数据库中添加一些触发与引索,使用阿里云的RDS-MySQL数据库,本文转载自http://www.biyezuopin.vip/onews.asp?id=15318数据库版本为8.0.16。
2.1 用户表User
1.用户编号:int类型,真动增长,主键,字段名:_id;
2.姓名:varchar类型,非空,字段名:name;
3.用户名:varchar类型,非空,添加唯一引索,不可重复,字段名:uname;
4.密码:varchar类型,非空,字段名:password;
5.身份:varchar类型,非空,默认用户,字段名:role;
6.销售额:decimal类型,非空,默认为0.0,字段名:Sales;
2.2 商品表commodity
1.商品编号:int类型,真动增长,主键,字段名:id;
2.商品条码:varchar类型,非空,添加唯一引索,不可重复,字段名:Barcode;
3.商品名称:varchar类型,非空,字段名:name;
4.生产厂家:varchar类型,字段名:factory;
5.商品类别:varchar类型,字段名:category;
6.商品价格:decimal类型,非空,默认0.0,字段名:price;
7.商品销量:int类型,非空,默认0,字段名:sales;
8.商品库存:int类型,非空,默认0,字段名:sum;
2.3 订单表sales
1.订单编号:int类型,真动增长,主键,字段名:id;
2.订单详情:varchar类型,内容商品名*数量,用|分隔,字段名:val;
3.订单金额:decimal类型,非空,默认为0,字段名:amount;
4.操作编号:int类型,非空,对应用户编号,字段名:user_id;
5.操作姓名:varchar类型,对应用户姓名,字段名:user;
6.订单时间:timestamp类型,非空,自动填写插入时间,自动名:time;
触发:当插入时候,自动更新用户表的销售金额。
3 程序简述与功能
2.1 程序简述
本程序除了完成作业要求外,还美化了用户界面,优化了用户体验,包含了用户表、商品表、订单表三个数据源,并提供了商品管理、用户管理、订单管理、收银台等子系统。本系统可以提供用户检验、权限判断,商品的管理、用户的管理和收银,并将所有可能的异常进行了异常处理。
2.2 实现功能
1.登录验证与在线/权限检验;
2.用户注册;
3.商品管理:包括增删改查,条件筛选,模糊查询,批量修改;
4.收银台:包括添加商品、修改数量、移除商品、计算金额、统计订单;
5.订单管理:包括订单浏览,条件筛选,模糊查询,按时间过滤等;
6.用户管理:包括浏览用户,修改资料,删除用户,修改权限,模糊查询,条件筛选等;
7.补充、添加商品库存;
namespace 商品管理系统
{
partial class 管理系统主界面
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(管理系统主界面));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.用户名 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.label5 = new System.Windows.Forms.Label();
this.身份 = new System.Windows.Forms.Label();
this.商品管理按钮 = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.panel2 = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.panel3 = new System.Windows.Forms.Panel();
this.label7 = new System.Windows.Forms.Label();
this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.panel4 = new System.Windows.Forms.Panel();
this.label8 = new System.Windows.Forms.Label();
this.pictureBox4 = new System.Windows.Forms.PictureBox();
this.panel5 = new System.Windows.Forms.Panel();
this.label9 = new System.Windows.Forms.Label();
this.pictureBox5 = new System.Windows.Forms.PictureBox();
this.panel1.SuspendLayout();
this.商品管理按钮.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
this.panel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("一纸情书", 22F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(10, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(425, 58);
this.label1.TabIndex = 0;
this.label1.Text = "零售店商品管理系统";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(943, 17);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(117, 28);
this.label2.TabIndex = 1;
this.label2.Text = "当前用户:";
//
// 用户名
//
this.用户名.AutoSize = true;
this.用户名.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.用户名.Location = new System.Drawing.Point(1066, 17);
this.用户名.Name = "用户名";
this.用户名.Size = new System.Drawing.Size(75, 28);
this.用户名.TabIndex = 2;
this.用户名.Text = "用户名";
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(218)))), ((int)(((byte)(231)))), ((int)(((byte)(245)))));
this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.button1.Font = new System.Drawing.Font("微软雅黑", 9F);
this.button1.Location = new System.Drawing.Point(1045, 80);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(96, 39);
this.button1.TabIndex = 3;
this.button1.Text = "退出登录";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(218)))), ((int)(((byte)(231)))), ((int)(((byte)(245)))));
this.button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.button2.Font = new System.Drawing.Font("微软雅黑", 9F);
this.button2.Location = new System.Drawing.Point(933, 80);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(96, 39);
this.button2.TabIndex = 5;
this.button2.Text = "回到主页";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.身份);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.用户名);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1178, 135);
this.panel1.TabIndex = 6;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(985, 46);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(75, 28);
this.label5.TabIndex = 6;
this.label5.Text = "权限:";
//
// 身份
//
this.身份.AutoSize = true;
this.身份.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.身份.ForeColor = System.Drawing.Color.Red;
this.身份.Location = new System.Drawing.Point(1066, 47);
this.身份.Name = "身份";
this.身份.Size = new System.Drawing.Size(54, 28);
this.身份.TabIndex = 7;
this.身份.Text = "用户";
//
// 商品管理按钮
//
this.商品管理按钮.Controls.Add(this.label3);
this.商品管理按钮.Controls.Add(this.pictureBox1);
this.商品管理按钮.Location = new System.Drawing.Point(17, 215);
this.商品管理按钮.Name = "商品管理按钮";
this.商品管理按钮.Size = new System.Drawing.Size(200, 195);
this.商品管理按钮.TabIndex = 7;
this.商品管理按钮.Click += new System.EventHandler(this.商品管理按钮_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label3.Location = new System.Drawing.Point(34, 138);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(127, 36);
this.label3.TabIndex = 1;
this.label3.Text = "商品管理";
this.label3.Click += new System.EventHandler(this.商品管理按钮_Click);
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(53, 27);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(87, 95);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.商品管理按钮_Click);
//
// panel2
//
this.panel2.Controls.Add(this.label4);
this.panel2.Controls.Add(this.pictureBox2);
this.panel2.Location = new System.Drawing.Point(456, 182);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(272, 271);
this.panel2.TabIndex = 8;
this.panel2.Click += new System.EventHandler(this.pictureBox3_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.ForeColor = System.Drawing.Color.Black;
this.label4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label4.Location = new System.Drawing.Point(84, 221);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(107, 39);
this.label4.TabIndex = 1;
this.label4.Text = "收银台";
this.label4.Click += new System.EventHandler(this.pictureBox2_Click);
//
// pictureBox2
//
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
this.pictureBox2.Location = new System.Drawing.Point(42, 27);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(184, 180);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox2.TabIndex = 0;
this.pictureBox2.TabStop = false;
this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
//
// panel3
//
this.panel3.Controls.Add(this.label7);
this.panel3.Controls.Add(this.pictureBox3);
this.panel3.Location = new System.Drawing.Point(236, 215);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(200, 195);
this.panel3.TabIndex = 9;
this.panel3.Click += new System.EventHandler(this.pictureBox3_Click);
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label7.Location = new System.Drawing.Point(36, 138);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(127, 36);
this.label7.TabIndex = 1;
this.label7.Text = "库存补充";
this.label7.Click += new System.EventHandler(this.pictureBox3_Click);
//
// pictureBox3
//
this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
this.pictureBox3.Location = new System.Drawing.Point(53, 27);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.Size = new System.Drawing.Size(87, 95);
this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox3.TabIndex = 0;
this.pictureBox3.TabStop = false;
this.pictureBox3.Click += new System.EventHandler(this.pictureBox3_Click);
//
// panel4
//
this.panel4.Controls.Add(this.label8);
this.panel4.Controls.Add(this.pictureBox4);
this.panel4.Location = new System.Drawing.Point(747, 215);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(200, 195);
this.panel4.TabIndex = 10;
this.panel4.Click += new System.EventHandler(this.pictureBox4_Click);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label8.Location = new System.Drawing.Point(31, 138);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(127, 36);
this.label8.TabIndex = 1;
this.label8.Text = "销售详细";
this.label8.Click += new System.EventHandler(this.pictureBox4_Click);
//
// pictureBox4
//
this.pictureBox4.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox4.Image")));
this.pictureBox4.Location = new System.Drawing.Point(53, 27);
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.Size = new System.Drawing.Size(87, 95);
this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox4.TabIndex = 0;
this.pictureBox4.TabStop = false;
this.pictureBox4.Click += new System.EventHandler(this.pictureBox4_Click);
//
// panel5
//
this.panel5.Controls.Add(this.label9);
this.panel5.Controls.Add(this.pictureBox5);
this.panel5.Location = new System.Drawing.Point(962, 215);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(200, 195);
this.panel5.TabIndex = 11;
this.panel5.Click += new System.EventHandler(this.pictureBox5_Click);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label9.Location = new System.Drawing.Point(31, 138);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(127, 36);
this.label9.TabIndex = 1;
this.label9.Text = "用户管理";
this.label9.Click += new System.EventHandler(this.pictureBox5_Click);
//
// pictureBox5
//
this.pictureBox5.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox5.Image")));
this.pictureBox5.Location = new System.Drawing.Point(53, 27);
this.pictureBox5.Name = "pictureBox5";
this.pictureBox5.Size = new System.Drawing.Size(87, 95);
this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox5.TabIndex = 0;
this.pictureBox5.TabStop = false;
this.pictureBox5.Click += new System.EventHandler(this.pictureBox5_Click);
//
// 管理系统主界面
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(207)))), ((int)(((byte)(221)))), ((int)(((byte)(238)))));
this.ClientSize = new System.Drawing.Size(1178, 544);
this.Controls.Add(this.panel5);
this.Controls.Add(this.panel4);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel2);
this.Controls.Add(this.商品管理按钮);
this.Controls.Add(this.panel1);
this.Cursor = System.Windows.Forms.Cursors.Arrow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "管理系统主界面";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "商品管理系统-主界面";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.管理系统主界面_FormClosing);
this.Load += new System.EventHandler(this.管理系统主界面_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.商品管理按钮.ResumeLayout(false);
this.商品管理按钮.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label 用户名;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel 商品管理按钮;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label 身份;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.PictureBox pictureBox3;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.PictureBox pictureBox4;
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.PictureBox pictureBox5;
}
}
全套资源下载地址:https://download.csdn.net/download/sheziqiong/86795148
全套资源下载地址:https://download.csdn.net/download/sheziqiong/86795148