数据库课设 超市管理系统

2026/1/12 6:59:22

5.5 商品信息模块

界面如图5-4所示。

图5-5 商品信息界面

主要实现代码如下:

using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;

using System.Windows.Forms;

namespace 超市系统 {

public partial class 商品 : Form

{

public 商品() {

InitializeComponent(); }

private void Bind(string sql) {

MyDataSource data = new MyDataSource(); DataSet ds = data.get_dataset(sql); dataGridView1.DataSource = ds.Tables[0]; }

private void 商品_Load(object sender, EventArgs e)

{

string sql = \; Bind(sql); }

private void button2_Click(object sender, EventArgs e) {

Form1 a = new Form1(); this.Hide();

a.ShowDialog(); }

private void button1_Click_1(object sender, EventArgs e) {

string deletedid =

dataGridView1.CurrentRow.Cells[\商品名称\].Value.ToString();

string sql = \商品名称='\ + deletedid + \;

MyDataSource data = new MyDataSource(); data.update(sql);

Bind(\); }

private void button3_Click(object sender, EventArgs e) {

string deletedid =

dataGridView1.CurrentRow.Cells[\商品名称\].Value.ToString();

string sql = \商品名称='\ + textBox1.Text + \单价='\ + textBox2.Text + \进货数量='\ + textBox3.Text + \供应商='\ + textBox4.Text + \商品类型='\ + textBox5.Text + \摆放位置='\ + textBox6.Text + \商品名称='\ + deletedid + \;

MyDataSource data = new MyDataSource(); data.update(sql);

Bind(\); }

private void button4_Click(object sender, EventArgs e) {

string sql = \into shangpin(商品名称,单价,进货数量,供应商,商品类型,摆放位

置)values('\+textBox1.Text+\+textBox2.Text+\+textBox3.Text+\+textBox4.Text+\+textBox5.Text+\+textBox6.Text+\;

MyDataSource data = new MyDataSource(); data.update(sql);

Bind(\); }


数据库课设 超市管理系统.doc 将本文的Word文档下载到电脑
搜索更多关于: 数据库课设 超市管理系统 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219