?? frmoslook.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 frmOSLook : Form
{
public frmOSLook()
{
InitializeComponent();
}
SMS.BaseClass.DataCon datacon = new SMS.BaseClass.DataCon();
private void frmOSLook_Load(object sender, EventArgs e)
{
dgvOSInfo.Controls.Add(hScrollBar1);
DataSet myds = datacon.getds("select OSID as 出庫編號,StoreName as 倉庫名稱,GoodsName as 貨物名稱,"
+ "GoodsSpec as 規(guī)格,GoodsUnit as 計量單位,GoodsNum as 出庫數(shù)量,GoodsPrice as 價格,GoodsAPrice as 總金額,"
+ "OSDate as 出庫日期,PGProvider as 提貨單位,PGPeople as 提貨人,"
+ "HandlePeople as 經(jīng)手人,OSRemark as 備注 from tb_OutStore", "tb_OutStore");
dgvOSInfo.DataSource = myds.Tables[0];
}
private void btnLook_Click(object sender, EventArgs e)
{
try
{
if (txtLKWord.Text.Trim() == "")
{
frmOSLook_Load(sender, e);
}
else
{
if (cboxLCondition.Text.Trim() == "出庫編號")
{
DataSet myds = datacon.getds("select OSID as 出庫編號,StoreName as 倉庫名稱,GoodsName as 貨物名稱,"
+ "GoodsSpec as 規(guī)格,GoodsUnit as 計量單位,GoodsNum as 出庫數(shù)量,GoodsPrice as 價格,GoodsAPrice as 總金額,"
+ "OSDate as 出庫日期,PGProvider as 提貨單位,PGPeople as 提貨人,"
+ "HandlePeople as 經(jīng)手人,OSRemark as 備注 from tb_OutStore where OSID = " + txtLKWord.Text.Trim() + "", "tb_OutStore");
dgvOSInfo.DataSource = myds.Tables[0];
}
if (cboxLCondition.Text.Trim() == "出庫日期")
{
string P_str_dtime = txtLKWord.Text.Trim();
DataSet myds = datacon.getds("select OSID as 出庫編號,StoreName as 倉庫名稱,GoodsName as 貨物名稱,"
+ "GoodsSpec as 規(guī)格,GoodsUnit as 計量單位,GoodsNum as 出庫數(shù)量,GoodsPrice as 價格,GoodsAPrice as 總金額,"
+ "OSDate as 出庫日期,PGProvider as 提貨單位,PGPeople as 提貨人,"
+ "HandlePeople as 經(jīng)手人,OSRemark as 備注 from tb_OutStore where year(OSDate)=" + P_str_dtime.Substring(0, 4)
+ " and month(OSDate)=" + P_str_dtime.Substring(5, P_str_dtime.Length - 6) + "", "tb_OutStore");
dgvOSInfo.DataSource = myds.Tables[0];
}
if (cboxLCondition.Text.Trim() == "倉庫名稱")
{
DataSet myds = datacon.getds("select OSID as 出庫編號,StoreName as 倉庫名稱,GoodsName as 貨物名稱,"
+ "GoodsSpec as 規(guī)格,GoodsUnit as 計量單位,GoodsNum as 出庫數(shù)量,GoodsPrice as 價格,GoodsAPrice as 總金額,"
+ "OSDate as 出庫日期,PGProvider as 提貨單位,PGPeople as 提貨人,"
+ "HandlePeople as 經(jīng)手人,OSRemark as 備注 from tb_OutStore where StoreName like '%"
+ txtLKWord.Text.Trim() + "%'", "tb_OutStore");
dgvOSInfo.DataSource = myds.Tables[0];
}
if (cboxLCondition.Text.Trim() == "貨物名稱")
{
DataSet myds = datacon.getds("select OSID as 出庫編號,StoreName as 倉庫名稱,GoodsName as 貨物名稱,"
+ "GoodsSpec as 規(guī)格,GoodsUnit as 計量單位,GoodsNum as 出庫數(shù)量,GoodsPrice as 價格,GoodsAPrice as 總金額,"
+ "OSDate as 出庫日期,PGProvider as 提貨單位,PGPeople as 提貨人,"
+ "HandlePeople as 經(jīng)手人,OSRemark as 備注 from tb_OutStore where GoodsName like '%"
+ txtLKWord.Text.Trim() + "%'", "tb_OutStore");
dgvOSInfo.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 cboxLCondition_SelectedIndexChanged(object sender, EventArgs e)
{
if (cboxLCondition.Text.Trim() == "出庫日期")
{
label2.Text = "查詢年月份";
}
else
{
label2.Text = "查詢關(guān)鍵字";
}
}
private void frmOSLook_FormClosed(object sender, FormClosedEventArgs e)
{
this.Close();
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -