sale.aspx.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Data;
using System.Data.SqlClient;
using DbPrvd;
using Common;

public partial class sale : DetailPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
            Response.Write("<script type='text/javascript'>parent.parent.document.location='timeout.htm';</script>");

        InitMember();
        if (CurrentPageType == MyPageType.Modify)
        {
            lblPageTitle.Text = "[修改销售信息]";
            if (!IsPostBack)
            {
                BindInfo();
            }
        }
        else { lblPageTitle.Text = "[添加销售信息]"; }
    }
    private void BindInfo()
    {
        string Query = "select * from [" + SqlHelper.Tbpre + "sale] as A inner join [" + SqlHelper.Tbpre + "product] as B " +
            " on A.pid=B.sid where A.id=" + CurrentInfoID;
        SqlDataReader tempReader = SqlHelper.ExecuteReader(SqlHelper.ConStr, CommandType.Text, Query);
        while (tempReader.Read())
        {
            tbxpid.Value = tempReader["pid"].ToString();
            tbxquantity.Value = tempReader["quantity"].ToString();
            tbxprice.Value = tempReader["price"].ToString();
            tbxtotalprice.Value = tempReader["totalprice"].ToString();
            txtremark.Value = tempReader["remark"].ToString();
        }
    }
    protected void btmSubmit_Click(object sender, EventArgs e)
    {
        string pid = tbxpid.Value;
        string price = tbxprice.Value;
        string totalprice = tbxtotalprice.Value;
        string quantity = tbxquantity.Value;
        string tidian = tbxtidian.Value;
        string ticheng = tbxticheng.Value;
        string remark = txtremark.Value;

        #region  验证是否存在商品编号 checkResult
        string checkSql = "select sid from [" + SqlHelper.Tbpre + "product] where sid='" + pid + "'";
        object checkResult = DB.ExecuteScalar(checkSql);
        #endregion

        if (checkResult != null)
后面还有 56 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。