?? querywarehousenowform.aspx.cs
字號(hào):
?//文件名:QueryWarehouseNowForm.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class GoodsManage_QueryWarehouseNowForm : System.Web.UI.Page
{
private static string MyDate;
private static string MySQL;
protected void Page_Load(object sender, EventArgs e)
{
string MyForbidString = Session["MyForbid"].ToString();
if (MyForbidString.IndexOf("B6") > 1)
{
Server.Transfer("~/SystemManage/AllErrorHelp.aspx");
}
}
protected void Button1_Click(object sender, EventArgs e)
{//查詢庫存商品匯總信息
DataTable MyQueryTable = new System.Data.DataTable();
SqlConnection MyConnection = new SqlConnection();
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings["MySaleDBConnectionString"].ConnectionString;
MyConnection.Open();
MySQL = "SELECT 商品編號(hào),商品名稱,規(guī)格型號(hào),計(jì)量單位,累計(jì)采購量,累計(jì)銷售量,當(dāng)前庫存量 FROM 商品信息";
MyDate = "打印日期:" + DateTime.Now.ToShortDateString();
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
MyAdapter.Fill(MyQueryTable);
this.GridView1.DataSource = MyQueryTable;
this.GridView1.DataBind();
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
}
public string MyPrintSQL
{//設(shè)置要傳遞到打印頁的數(shù)據(jù)
get
{
return MySQL;
}
}
public String MyPrintDate
{//設(shè)置要傳遞到打印頁的數(shù)據(jù)
get
{
return MyDate;
}
}
public String MyPrintTitle
{//設(shè)置要傳遞到打印頁的數(shù)據(jù)
get
{
return Session["MyCompanyName"].ToString() + "庫存商品分類匯總表";
}
}
protected void Button2_Click(object sender, EventArgs e)
{//打印庫存商品匯總信息
Server.Transfer("~/GoodsManage/QueryWarehouseNowPrint.aspx");
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -