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

📄 sms_outgoodschk.cs

📁 库存管理系统,对企业仓库的产品进行管理,使用C#语句 .net 平台开发
💻 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.Data.SqlClient;

namespace FORU_SMS_
{
    public partial class SMS_OutGoodsChk : Form
    {
        BaseClass.DataConn Dconn = new FORU_SMS_.BaseClass.DataConn();
        BaseClass.DataClass Dclass = new FORU_SMS_.BaseClass.DataClass();
        DataSet ds;
        public string sql = "";
        public SMS_OutGoodsChk()
        {
            InitializeComponent();
        }

        private void SMS_OutGoodsChk_Load(object sender, EventArgs e)
        {
            dgvGInfo.Controls.Add(hScrollBar1);
            sql = sql + "SELECT GoodsID AS 产品编号,GoodsName AS 产品名称,SupName AS 仓库名称,SpecName AS 货物规格,GoodsNum AS 出库数量,"
                + "BorName AS 借货人,GoodsPeople AS 经手人,BorDeparment AS 借货单位,GoodsRemarks AS 备注 FROM SMS_Borrow";
            ds = Dclass.GetDataSet(sql, "SMS_Borrow");
            dgvGInfo.DataSource = ds.Tables[0];
        }

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

        private void btnLook_Click(object sender, EventArgs e)
        {
            string keyword = "";
            string sqlCondition = "";
            keyword = this.txtLKWord.Text.Trim();
            if (this.cboxLCondition.Text.Trim() == "")
            {
                MessageBox.Show("请选择查询类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.cboxLCondition.Focus();
            }
            else if (keyword == "")
            {
                MessageBox.Show("请输入关键字!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtLKWord.Focus();
            }
            else
            {
                try
                {
                    switch (this.cboxLCondition.Text.Trim())
                    {
                        case "货物编号":
                            sqlCondition = sqlCondition + " where GoodsID='" + keyword + "'";
                            break;
                        case "货物名称":
                            sqlCondition = sqlCondition + " where GoodsName like '%" + keyword + "%'";
                            break;
                        case "仓库名称":
                            sqlCondition = sqlCondition + " where SupName='" + keyword + "'";
                            break;
                    }
                    ds = Dclass.GetDataSet(sql + sqlCondition, "SMS_Borrow");
                    dgvGInfo.DataSource = ds.Tables[0];
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
    }
}

⌨️ 快捷键说明

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