saleaddprint.aspx.cs

来自「商品管理系统」· CS 代码 · 共 72 行

CS
72
字号
//文件名:SaleAddPrint.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;

public partial class SaleManage_SaleAddPrint : System.Web.UI.Page
{
    private SaleManage_SaleAddForm MyPrintForm;
    private static int MyID = 0;
    private static DataTable MyGoodsTable = new DataTable();
    protected void Page_Load(object sender, EventArgs e)
    {//打印商品销售出库信息
        if (Session["MyCompanyName"] != null)
        {
            this.Label1.Text = Session["MyCompanyName"].ToString() + "商品销售出库单";
        }
        this.Label2.Text = "打印日期:" + DateTime.Now.ToShortDateString();
        MyPrintForm = (SaleManage_SaleAddForm)Context.Handler;
        this.Label3.Text = "销售单号:" + MyPrintForm.MyPrint销售单号;
        this.Label4.Text = "客户名称:" + MyPrintForm.MyPrint客户名称;
        this.Label5.Text = "应收金额:" + MyPrintForm.MyPrint应收金额;
        this.Label6.Text = "实收金额:" + MyPrintForm.MyPrint实收金额;
        this.Label7.Text = "经办人员:" + MyPrintForm.MyPrint经办人员;
        this.Label8.Text = "收款方式:" + MyPrintForm.MyPrint收款方式;
        this.Label9.Text = "出库日期:" + MyPrintForm.MyPrint出库日期;
        this.Label10.Text = "补充说明:" + MyPrintForm.MyPrint补充说明;
        //创建无连接的数据表
        DataColumn[] MyKey = new DataColumn[1];
        MyGoodsTable = new DataTable("商品销售明细表");
        DataColumn MyColumn = new DataColumn();
        MyColumn.DataType = System.Type.GetType("System.Int16");
        MyColumn.ColumnName = "自编号";
        MyGoodsTable.Columns.Add(MyColumn);
        MyKey[0] = MyColumn;
        MyGoodsTable.PrimaryKey = MyKey;
        MyGoodsTable.Columns.Add("商品名称", System.Type.GetType("System.String"));
        MyGoodsTable.Columns.Add("规格型号", System.Type.GetType("System.String"));
        MyGoodsTable.Columns.Add("计量单位", System.Type.GetType("System.String"));
        MyGoodsTable.Columns.Add("商品单价", System.Type.GetType("System.Double"));
        MyGoodsTable.Columns.Add("销售数量", System.Type.GetType("System.Double"));
        MyGoodsTable.Columns.Add("销售金额", System.Type.GetType("System.Double"));
        this.GridView1.DataSource = MyGoodsTable;
        MyID = 0;
        foreach (DataRow MyPrintRow in MyPrintForm.MyPrintDataTable.Rows)
        {
            MyID = MyID + 1;
            DataRow MyRow = MyGoodsTable.NewRow();
            MyRow[0] = MyID;
            MyRow["商品名称"] = MyPrintRow[2].ToString();
            MyRow["规格型号"] = MyPrintRow[3].ToString();
            MyRow["计量单位"] = MyPrintRow[4].ToString();
            MyRow["商品单价"] = MyPrintRow[5].ToString();
            MyRow["销售数量"] = MyPrintRow[6].ToString();
            MyRow["销售金额"] = MyPrintRow[7].ToString();
            MyGoodsTable.Rows.Add(MyRow);
            this.GridView1.DataSource = MyGoodsTable;
            this.GridView1.DataBind();
        }
        if (Session["MyUserName"] != null)
        {
            this.Label31.Text = "库管员:" + Session["MyUserName"].ToString();
        }
    }
}

⌨️ 快捷键说明

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