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

📄 editprice_price_1.aspx.cs

📁 简单的Web平台。能够读取Excel文件
💻 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 EditPrice_Price : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string strVersion = Request.QueryString["version"];
            string strModels = Request.QueryString["models"];

            hidVersion.Value = strVersion;
            hidModels.Value = strModels;

            string[] aryModels = strModels.Split(',');
            string strModelCondition = "(";
            for (int i = 0; i < aryModels.Length; i++)
            {
                aryModels[i] = "'" + aryModels[i] + "',";
                strModelCondition += aryModels[i];
            }
            strModelCondition = strModelCondition.Remove(strModelCondition.Length - 1, 1);
            strModelCondition += ")";

            string strSQL_PriceInf = "SELECT 价格版本号,价格名称,级别名称,制作人,公司名称,priceInfo.备注 FROM priceInfo " +
                                     "INNER JOIN level ON priceInfo.价格层次=level.级别层次 " +
                                     "INNER JOIN userInfo ON priceInfo.制作人=userInfo.用户名 " +
                                     "INNER JOIN companyInfo ON userInfo.公司编号=companyInfo.ID " +
                                     "INNER JOIN MatchStatus ON priceInfo.价格版本号=MatchStatus.Version " +
                                     "WHERE 价格版本号 <> '" + strVersion + "' AND MatchStatus.ModelCode IN " + strModelCondition;
            DBConnector dbConn = new DBConnector();
            DataSet dsPriceInf = dbConn.Query(strSQL_PriceInf);
            gvPriceInfo.DataSource = dsPriceInf;
            gvPriceInfo.DataBind();

            string strSQL_TableName = "SELECT 数据表名称,导入上限,导入下限 FROM priceInfo WHERE 价格版本号 LIKE '" + strVersion + "'";
            DataSet dsOtherInfo = dbConn.Query(strSQL_TableName);
            hidTableName.Value = dsOtherInfo.Tables[0].Rows[0]["数据表名称"].ToString();
            txtImpUpper.Text = dsOtherInfo.Tables[0].Rows[0]["导入上限"].ToString();
            txtImpLower.Text = dsOtherInfo.Tables[0].Rows[0]["导入下限"].ToString();
        }    
    }

    /// <summary>
    /// 下一步
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnNextStep_Click(object sender, EventArgs e)
    {
        string strVersions = null;
        for (int i = 0; i < gvPriceInfo.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)gvPriceInfo.Rows[i].FindControl("chbSelect");
            if (cb.Checked)
            {
                string strVerItem = gvPriceInfo.Rows[i].Cells[6].Text;
                strVersions += strVerItem + ",";
            }
        }

        if (null == strVersions || string.Empty == strVersions)
        {
            return;
        }
        strVersions = strVersions.Remove(strVersions.Length - 1, 1);

        ////////////////////////////////////////////////////////////////////////////////
        // 导入的车系列表
        string strModels = hidModels.Value;
        string[] aryModels = strModels.Split('/');
        string strQueryCondition = "(";
        for (int i = 0; i < aryModels.Length; i++)
        {
            aryModels[i] = "'" + aryModels[i] + "',";
            strQueryCondition += aryModels[i];
        }
        strQueryCondition = strQueryCondition.Remove(strQueryCondition.Length - 1, 1);
        strQueryCondition += ")";
        ////////////////////////////////////////////////////////////////////////////////       

        string strScript = "<script language='javascript'>" +
                           "parent.frames['Main_Bottom_MainFrame'].location = 'EditPrice_Price_2.aspx?version=" + hidVersion.Value + "&models=" + hidModels.Value + "&items=" + strVersions + "';" +
                           "</script>";
        ClientScript.RegisterClientScriptBlock(this.GetType(), "clientScript", strScript);
    }


    protected void gvPriceInfo_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        e.Row.Cells[6].Visible = false;      
    }
}

⌨️ 快捷键说明

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