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

📄 添加新商品.cs

📁 用C#实现超市的管理
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Yewucheng;
namespace Myproject
{
    public partial class 添加新商品 : Form
    {
       private  采购进货 mer;

        public 添加新商品(采购进货 obj)
        {
            InitializeComponent();
            this.mer = obj;
        }

        private void button2_Click(object sender, EventArgs e)
        {

            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            wang tianjiashangping = new wang();
            if(this.txt1.Text == "")
            {
                MessageBox.Show("商品编号不能为空!");
            }
            else
            {
                MessageBox.Show("添加成功!","系统消息");
            }
           
            tianjiashangping.insertmand("insert into NewTianjsp values('" + this.txt2.Text + "','" + this.combox4.Text + "','" + this.txt3.Text + "','" + this.comboBox3.Text + "'," + this.txt9.Text + "," + this.txt4.Text + "," + this.txt5.Text + ",'" + this.txt1.Text + "','" + this.txt8.Text + "')");
            this.Hide();
            DataSet ds = tianjiashangping.SelectMand("select *from NewTianjsp");
            this.mer.dbgname.DataSource = ds.Tables[0].DefaultView;
           
        }     
       
    }
}

⌨️ 快捷键说明

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