库存管理/Shelves.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Car.库存管理
{
    public partial class Shelves : Form
    {
        public Shelves()
        {
            InitializeComponent();
        }
        int i;
        int start;
        int size = 7;
        string str = "server=.;database=car;uid=sa;pwd=51Aspx";
        string str1 = "select * from v_caigou_commodity_type where car_zhuangtai='未出售'";
        private void 刷新ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            text_select.Text = null;
            DataTable dt = DBHelper.GetDataTable(" select * from v_caigou_commodity_type where car_zhuangtai='未出售'");
            dgv_stock.DataSource = dt;
            DataTable dtt = DBHelper.GetDataTable(" select count(*) from v_caigou_commodity_type where car_zhuangtai='未出售'");
            text_count.Text = dtt.Rows[0][0].ToString();
        }

        private void bt_select_Click(object sender, EventArgs e)
        {
            string carname = text_select.Text;
            if (string.IsNullOrEmpty(carname))
            {
                MessageBox.Show("查询条件不能为空!");
                text_count.Text = null;
            }
            else
            {
                text_count.Text = null;
                string sql = string.Format("select * from v_caigou_commodity_type where commodity_name like '%{0}%' and car_zhuangtai='未出售' ", carname);
                DataTable dt = DBHelper.GetDataTable(sql);

                if (dt.Rows.Count == 0)
                {
                    MessageBox.Show("为查询到有关" + carname + "的汽车信息", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {

                    dgv_stock.DataSource = dt;
                    string sqlstr = string.Format("select count(commodity_name) from v_caigou_commodity_type where commodity_name='{0}'and car_zhuangtai='未出售' group by commodity_name", carname);
                    DataTable tables = DBHelper.GetDataTable(sqlstr);
                    string sqlstrs = string.Format("select count(type_name) from v_caigou_commodity_type where commodity_name like'%{0}%'and car_zhuangtai='未出售' group by type_name", carname);
                    DataTable table = DBHelper.GetDataTable(sqlstrs);
                    if (tables.Rows.Count > 0)
后面还有 97 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。