添加销售商品.cs

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

CS
72
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Windows.Forms;
using Yewucheng;
namespace Myproject
{
    public partial class 添加销售商品 : Form
    {


        wang merThod = new wang();

        public 添加销售商品()
        {
            InitializeComponent();
        }

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

        private void 添加销售商品_Load(object sender, EventArgs e)
        {

            DataSet ds = merThod.SelectMand("select *from SouXuanshanp");
            this.dataGridView1.DataSource = ds.Tables[0].DefaultView;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {

                DataSet ds = merThod.SelectMand("select *from SouXuanshanp where 商品编号='" + this.txt1.Text + "'");
                this.dataGridView2.DataSource = ds.Tables[0].DefaultView;
               
            }
            catch(Exception)
              {
                MessageBox.Show("你输入的商品编号为空或输入错误","系统消息");
               }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            
            修改商品 xiugai = new 修改商品(this);
            xiugai.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            merThod.DeleteMand("delete SouXuanshanp where 商品编号='" + this.txt1.Text + "'");

         
        }

      
      
      
      

       
    }
}

⌨️ 快捷键说明

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