?? frmgilook.cs
字號:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SMS.LookandSum
{
public partial class frmGILook : Form
{
SMS.BaseClass.DataCon datacon = new SMS.BaseClass.DataCon();
public frmGILook()
{
InitializeComponent();
}
private void frmGILook_Load(object sender, EventArgs e)
{
dgvGInfo.Controls.Add(hScrollBar1);
DataSet myds = datacon.getds("select GoodsID as 貨物編號,GoodsName as 貨物名稱,"
+ "StoreName as 倉庫名稱,GoodsSpec as 貨物規格,GoodsUnit as 計量單位,"
+ "GoodsNum as 貨物數量,GoodsInPrice as 進貨價格,GoodsOutPrice as 出貨價格,"
+ "GoodsLeast as 最低存儲,GoodsMost as 最高存儲,Editer as 修改人,EditDate as 修改日期 from tb_GoodsInfo", "tb_GoodsInfo");
dgvGInfo.DataSource = myds.Tables[0];
}
private void btnLook_Click(object sender, EventArgs e)
{
try
{
if (txtLKWord.Text.Trim() == "")
{
frmGILook_Load(sender, e);
}
else
{
if (cboxLCondition.Text.Trim() == "貨物編號")
{
DataSet myds = datacon.getds("select GoodsID as 貨物編號,GoodsName as 貨物名稱,"
+ "StoreName as 倉庫名稱,GoodsSpec as 貨物規格,GoodsUnit as 計量單位,"
+ "GoodsNum as 貨物數量,GoodsInPrice as 進貨價格,GoodsOutPrice as 出貨價格,"
+ "GoodsLeast as 最低存儲,GoodsMost as 最高存儲,Editer as 修改人,EditDate as 修改日期"
+ " from tb_GoodsInfo where GoodsID = " + txtLKWord.Text.Trim() + "", "tb_GoodsInfo");
dgvGInfo.DataSource = myds.Tables[0];
}
if (cboxLCondition.Text.Trim() == "貨物名稱")
{
DataSet myds = datacon.getds("select GoodsID as 貨物編號,GoodsName as 貨物名稱,"
+ "StoreName as 倉庫名稱,GoodsSpec as 貨物規格,GoodsUnit as 計量單位,"
+ "GoodsNum as 貨物數量,GoodsInPrice as 進貨價格,GoodsOutPrice as 出貨價格,"
+ "GoodsLeast as 最低存儲,GoodsMost as 最高存儲,Editer as 修改人,EditDate as 修改日期"
+ " from tb_GoodsInfo where GoodsName like '%" + txtLKWord.Text.Trim() + "%'", "tb_GoodsInfo");
dgvGInfo.DataSource = myds.Tables[0];
}
if (cboxLCondition.Text.Trim() == "倉庫名稱")
{
DataSet myds = datacon.getds("select GoodsID as 貨物編號,GoodsName as 貨物名稱,"
+ "StoreName as 倉庫名稱,GoodsSpec as 貨物規格,GoodsUnit as 計量單位,"
+ "GoodsNum as 貨物數量,GoodsInPrice as 進貨價格,GoodsOutPrice as 出貨價格,"
+ "GoodsLeast as 最低存儲,GoodsMost as 最高存儲,Editer as 修改人,EditDate as 修改日期"
+ " from tb_GoodsInfo where StoreName like '%" + txtLKWord.Text.Trim() + "%'", "tb_GoodsInfo");
dgvGInfo.DataSource = myds.Tables[0];
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void frmGILook_FormClosed(object sender, FormClosedEventArgs e)
{
this.Close();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -