示例#1
0
    private void initCode()
    {
        //初始化下拉列表
        string sql = "select distinct a.pline_code,b.pline_name from vw_user_role_program a left join code_product_line b on a.pline_code=b.pline_code where a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' and a.company_code='" + theCompanyCode + "'";

        //SqlCode.SelectCommand = sql;
        //SqlCode.DataBind();
        //SqlCode1.SelectCommand = sql;
        //SqlCode1.DataBind();
        SqlCode2.SelectCommand = sql;
        SqlCode2.DataBind();
        //txtPCode.SelectedIndex = txtPCode.Items.Count >= 0 ? 0 : -1;
        //txtPCode1.SelectedIndex = txtPCode.Items.Count >= 0 ? 0 : -1;
        //txtPCode2.SelectedIndex = txtPCode.Items.Count >= 0 ? 0 : -1;

        string Sql2 = "  select pt_part from copy_pt_mstr order by pt_part";

        SqlICode.SelectCommand = Sql2;
        SqlICode.DataBind();

        string Sql3 = "select distinct DETECT_NAME from code_detect where   ";

        if (txtPCode2.Text.Trim() != "")
        {
            Sql3 = Sql3 + "  pline_code='" + txtPCode2.Value.ToString() + "'";
        }
        else
        {
            Sql3 = Sql3 + "  pline_code in ( SELECT PLINE_ID FROM VW_USER_ROLE_PROGRAM WHERE USER_ID='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "')  ";
        }
        DataTable dt3 = dc.GetTable(Sql3);

        ASPxListBoxUnused.DataSource = dt3;
        ASPxListBoxUnused.DataBind();
    }
示例#2
0
 private void initCode()
 {
     //初始化生产线下拉列表
     string sql = "select distinct a.pline_code,b.pline_name from vw_user_role_program a left join code_product_line b on a.pline_code=b.pline_code where a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' and a.company_code='" + theCompanyCode + "'";
     SqlCode.SelectCommand = sql;
     SqlCode.DataBind();
     SqlCode2.SelectCommand = sql;
     SqlCode2.DataBind();
 }