//初始化生产线下拉列表 private void initGzdd() { string sql = "SELECT DISTINCT PLINE_CODE, PLINE_NAME FROM VW_USER_ROLE_PROGRAM WHERE USER_ID = '" + theUserId + "' AND PROGRAM_CODE = '" + theProgramCode + "' AND COMPANY_CODE = '" + theCompanyCode + "' ORDER BY PLINE_CODE"; ComboGzdd.DataSource = dc.GetTable(sql); ComboGzdd.DataBind(); ComboGzdd.SelectedIndex = ComboGzdd.Items.Count >= 0 ? 0 : -1; }
protected void Page_Load(object sender, EventArgs e) { theProgramCode = "part2300"; userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); string sql = "SELECT DISTINCT PLINE_CODE, PLINE_NAME FROM VW_USER_ROLE_PROGRAM WHERE USER_ID = '" + theUserId + "' AND PROGRAM_CODE = '" + theProgramCode + "' AND COMPANY_CODE = '" + theCompanyCode + "' ORDER BY PLINE_CODE"; ComboGzdd.DataSource = dc.GetTable(sql); ComboGzdd.DataBind(); setCondition(); if (!IsPostBack) { ComboGzdd.SelectedIndex = ComboGzdd.Items.Count >= 0 ? 0 : -1; //初始化工位 string sql2 = " SELECT DISTINCT LOCATION_CODE FROM CODE_LOCATION WHERE PLINE_CODE=RH_GET_DATA('L','" + ComboGzdd.Value.ToString() + "','','','') order by LOCATION_CODE"; DataTable dt2 = dc.GetTable(sql2); cmbLocation.DataSource = dt2; cmbLocation.ValueField = "LOCATION_CODE"; cmbLocation.TextField = "LOCATION_CODE"; cmbLocation.DataBind(); //初始化保管员 string sql1 = " select distinct upper(in_qadc01) in_qadc01 from copy_in_mstr " + " where upper(in_site)= (SELECT DISTINCT SAP_CODE FROM CODE_PRODUCT_LINE WHERE PLINE_CODE = '" + ComboGzdd.Value.ToString() + "' ) " + " AND in_qadc01 is not null order by upper(in_qadc01) "; DataTable dt1 = dc.GetTable(sql1); cmbBgy.DataSource = dt1; cmbBgy.ValueField = "IN_QADC01"; cmbBgy.TextField = "IN_QADC01"; cmbBgy.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { theProgramCode = "part2900"; userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); modifyFlag = "0"; string sql = "SELECT DISTINCT PLINE_CODE, PLINE_NAME FROM VW_USER_ROLE_PROGRAM WHERE USER_ID = '" + theUserId + "' AND PROGRAM_CODE = '" + theProgramCode + "' AND COMPANY_CODE = '" + theCompanyCode + "' ORDER BY PLINE_CODE"; ComboGzdd.DataSource = dc.GetTable(sql); ComboGzdd.DataBind(); setCondition(); if (Request["opFlag"] == "getEditM") { string str1 = ""; string MCode = Request["MCODE"].ToString().Trim(); string sql88 = "select nvl(pt_desc2,' ') from copy_pt_mstr where UPPER(pt_part)='" + MCode + "'"; dc.setTheSql(sql88); DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string strMCode = dc.GetTable().Rows[0][0].ToString(); if (strMCode == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } else { str1 = strMCode; } this.Response.Write(str1); this.Response.End(); } if (Request["opFlag"] == "getEditGYS") { string str1 = ""; string GCode = Request["GCODE"].ToString().Trim(); string sql99 = "select nvl(ad_name,' ') from copy_ad_mstr where UPPER(ad_addr)='" + GCode + "'"; dc.setTheSql(sql99); DataTable dt = dc.GetTable(sql); if (dt.Rows.Count == 0) { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } string strGCode = dc.GetTable().Rows[0][0].ToString(); if (strGCode == "") { str1 = ""; this.Response.Write(str1); this.Response.End(); return; } else { str1 = strGCode; } this.Response.Write(str1); this.Response.End(); } if (!IsPostBack) { ComboGzdd.SelectedIndex = ComboGzdd.Items.Count >= 0 ? 0 : -1; //初始化工位 string sql2 = " select location_code from ms_location_time where gzdd='" + ComboGzdd.Value.ToString() + "' order by location_seq "; DataTable dt2 = dc.GetTable(sql2); cmbLocation.DataSource = dt2; cmbLocation.ValueField = "LOCATION_CODE"; cmbLocation.TextField = "LOCATION_CODE"; cmbLocation.DataBind(); } }