销售添加.cs

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

CS
47
字号
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 button1_Click(object sender, EventArgs e)
        {
            wang xiaoshou = new wang();

            if (this.txt1.Text == "")
            {
                MessageBox.Show("商品编号不能为空!");
            }
            else
            {
                MessageBox.Show("添加成功!", "系统消息");
            }

            xiaoshou.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=xiaoshou.SelectMand("select *from NewTianjsp");
            this.info.dbgname2.DataSource = ds.Tables[0].DefaultView;

        }

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

⌨️ 快捷键说明

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