see.aspx.cs

来自「网上销售订单管理系统借助现代信息技术和管理理论」· CS 代码 · 共 63 行

CS
63
字号
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 See : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HeardConfig();
        if (!IsPostBack)
        {
            PersonInfo.Return_SessionPerson();
            if (QueryString.Get_CId != null)
            { IsPage_Bind(); }
            else
            { JScript.GoHistory("参数错误", -1); }
        }
    }
    #region 页面初始化必需的内容
    public void HeardConfig()
    {
        Header.Title = "销售订单管理系统-查看付款记录";
        HeaderTextInfo.GetHeader(this, null);
    }
    #endregion
    public void IsPage_Bind()
    {
        string cid = QueryString.Get_CId;
        string strsql = "select * from Reckoning where CommodityId=" + cid + "";
        SqlConnection strcon = new SqlConnection(ConfigurationManager.ConnectionStrings["SellOrder_ConnectionString"].ConnectionString);
        strcon.Open();
        SqlDataAdapter sda = new SqlDataAdapter(strsql, strcon);
        DataSet ds = new DataSet();
        sda.Fill(ds, "search");
        GridView1.DataSource = ds.Tables["search"];
        GridView1.DataKeyNames = new string[] { "id" };
        GridView1.DataBind();
    }
    //单击翻页
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        this.IsPage_Bind();
    }
    //文字绑定
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[0].Text = (e.Row.DataItemIndex + 2).ToString();
            e.Row.Cells[3].Text = Convert.ToString(Convert.ToDateTime(e.Row.Cells[3].Text).ToShortDateString());
        }
    }
}

⌨️ 快捷键说明

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