Beispiel #1
0
    protected void txtPCH_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string CK  = this.hidCK.Value.Trim();
            string PCH = this.txtPCH.Text.Trim();
            if (!string.IsNullOrEmpty(PCH))
            {
                DataSet ds   = QTCKQuery.GetSXbyPCH(PCH, CK);
                DataSet dsSX = QTCKQuery.GetSXbyPCHNEW(PCH, CK);
                if (dsSX != null && dsSX.Tables[0].Rows.Count > 0)
                {
                    this.drpSX.DataSource     = dsSX;
                    this.drpSX.DataTextField  = "SX";
                    this.drpSX.ToolTip        = "属性";
                    this.drpSX.DataValueField = "SX";
                    this.drpSX.DataBind();

                    DataSet dsFree1 = QTCKQuery.GetFree1BySX(this.drpSX.SelectedValue, PCH, CK);
                    this.drpFree1.DataSource     = dsFree1;
                    this.drpFree1.DataTextField  = "vfree1";
                    this.drpFree1.ToolTip        = "自由项1";
                    this.drpFree1.DataValueField = "vfree1";
                    this.drpFree1.DataBind();

                    DataSet dsFree2 = QTCKQuery.GetFree2BySX(this.drpSX.SelectedValue, PCH, CK);
                    this.drpFree2.DataSource     = dsFree2;
                    this.drpFree2.DataTextField  = "vfree2";
                    this.drpFree2.ToolTip        = "自由项2";
                    this.drpFree2.DataValueField = "vfree2";
                    this.drpFree2.DataBind();

                    DataSet dsFree3 = QTCKQuery.GetFree3BySX(this.drpSX.SelectedValue, PCH, CK);
                    this.drpFree3.DataSource     = dsFree3;
                    this.drpFree3.DataTextField  = "vfree3";
                    this.drpFree3.ToolTip        = "自由项3";
                    this.drpFree3.DataValueField = "vfree3";
                    this.drpFree3.DataBind();


                    this.txtWLH.Text  = ds.Tables[0].Rows[0]["WLH"].ToString();
                    this.txtWLMC.Text = ds.Tables[0].Rows[0]["WLMC"].ToString();
                    this.txtPH.Text   = ds.Tables[0].Rows[0]["PH"].ToString();
                    this.txtGG.Text   = ds.Tables[0].Rows[0]["GG"].ToString();
                }
                else
                {
                    this.drpSX.Items.Clear();
                    this.drpFree1.Items.Clear();
                    this.drpFree2.Items.Clear();
                    this.drpFree3.Items.Clear();

                    this.txtWLH.Text  = "";
                    this.txtWLMC.Text = "";
                    this.txtPH.Text   = "";
                    this.txtGG.Text   = "";
                    this.txtJHSL.Text = "";
                    this.txtJHZL.Text = "";
                }
            }
        }
        catch (Exception ex)
        {
            this.PrintfError(ex.Message);
            return;
        }
    }