加入所选商品.cs

来自「用C#实现超市的管理」· CS 代码 · 共 42 行

CS
42
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Yewucheng;

namespace Myproject
{
    public partial class 加入所选择商品 : Form
    {
        private 添加老商品 info;
        public 加入所选择商品(添加老商品 obj)
        {
            InitializeComponent();
            this.info = obj;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button2_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            wang t = new wang();
            t.insertmand("insert into SouXuanshanp values('" + this.txt1.Text + "','" + this.txt2.Text + "','" + this.txt3.Text + "','" + this.comboBox1.Text + "','" + this.txt5.Text + "','" + this.comboBox2.Text + "','" + this.txt7.Text + "','" + this.txt8.Text + "'," + this.txt9.Text + "," + this.txt10.Text + "," + this.txt11.Text + ")");
            MessageBox.Show("添加商品的基本信息成功记录一行","警告信息");
            this.Hide();
            DataSet ds = t.SelectMand("select *from SouXuanshanp ");
            this.info.dataGridView2.DataSource = ds.Tables[0].DefaultView;
        
        }
    }
}

⌨️ 快捷键说明

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