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

📄 querywarehouseoutform.aspx.cs

📁 基于w/s模式的资产管理系统,可以参考参考,忘了什么时候从网络下的,还可以
💻 CS
字号:
//文件名:QueryWarehouseOutForm.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_QueryWarehouseOutForm : 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("B4") > 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 销售单号,客户名称,计量单位,销售数量,商品单价,销售金额,出库日期,补充说明 FROM 销售出库明细视图 WHERE 出库日期 BETWEEN '" + this.TextBox1.Text + "' AND '" + this.TextBox2.Text + "' AND 商品编号 LIKE '" + this.DropDownList1.SelectedValue.ToString() + "' ";
        MyDate = "商品名称:" + this.DropDownList1.SelectedItem.Text.ToString() + "                   开始日期:" + this.TextBox1.Text + "  结束日期:" + this.TextBox2.Text;
        SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
        MyAdapter.Fill(MyQueryTable);
        this.GridView1.DataSource = MyQueryTable;
        this.GridView1.DataBind();
        if (MyConnection.State == ConnectionState.Open)
        {
            MyConnection.Close();
        }
    }
    protected void Button2_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 销售单号,客户名称,计量单位,销售数量,商品单价,销售金额,出库日期,补充说明 FROM 销售出库明细视图 WHERE 出库日期 BETWEEN '" + this.TextBox1.Text + "' AND '" + this.TextBox2.Text + "'";
        MyDate = "商品名称:公司全部销售出库商品                   开始日期:" + this.TextBox1.Text + "  结束日期:" + this.TextBox2.Text;
        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
    {//设置要传递到打印页的数据
        get
        {
            return MySQL;
        }
    }
    public String MyPrintDate
    {//设置要传递到打印页的数据
        get
        {
            return MyDate;
        }
    }
    public String MyPrintTitle
    {//设置要传递到打印页的数据
        get
        {
            return Session["MyCompanyName"].ToString() + "销售出库商品统计表";
        }
    }
    protected void Button3_Click(object sender, EventArgs e)
    {//打印出库商品信息
        Server.Transfer("~/GoodsManage/QueryWarehouseOutPrint.aspx");
    }
}

⌨️ 快捷键说明

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