private void BindMachine() { //ds = objserver.GetDateset("select '-Select-' partno,'-Select-' partno union select distinct partno,partno from tbl_PartNo order by 1 asc"); ds = new DataSet(); ds.Tables.Clear(); ds.Clear(); ds.Reset(); ds = objserver.GetDateset("select 0 Id ,'-Select-' Machine union select distinct Id,Machine from Machine order by Id asc"); if (ds.Tables[0].Rows.Count > 0) { Slct_machine_QC_chart.DataSource = ds.Tables[0]; Slct_machine_QC_chart.DataValueField = "Machine"; Slct_machine_QC_chart.DataTextField = "Machine"; Slct_machine_QC_chart.DataBind(); } }
protected void onselectedindexchanged_allrpt(object sender, EventArgs e) { lock (thisLock) { try { string unit = ddl_unit_QC_chart.Text.ToString(); if (unit == "MBU") { ds = objserver.GetDateset("select '-Select-' MBU,'-Select-' MBU union select distinct MBU,MBU from Machine_rpt_tble order by 1 asc"); Slct_machine_QC_chart.DataSource = ds.Tables[0]; Slct_machine_QC_chart.DataValueField = "MBU"; Slct_machine_QC_chart.DataTextField = "MBU"; Slct_machine_QC_chart.DataBind(); } else if (unit == "ABU") { ds = objserver.GetDateset("select '-Select-' ABU,'-Select-' ABU union select distinct ABU,ABU from Machine_rpt_tble order by 1 asc"); Slct_machine_QC_chart.DataSource = ds.Tables[0]; Slct_machine_QC_chart.DataValueField = "ABU"; Slct_machine_QC_chart.DataTextField = "ABU"; Slct_machine_QC_chart.DataBind(); } else if (unit == "ALL") { ds = objserver.GetDateset("SELECT '-Select-' ALLRPT,'-Select-' ALLRPT union select distinct MBU,MBU as ALLRPT FROM Machine_rpt_tble where MBU<>'' UNION ALL SELECT '-Select-' ALLRPT,'-Select-' ALLRPT union select distinct ABU,ABU as ALLRPT FROM Machine_rpt_tble where ABU<>'' "); Slct_machine_QC_chart.DataSource = ds.Tables[0]; Slct_machine_QC_chart.DataValueField = "ALLRPT"; Slct_machine_QC_chart.DataTextField = "ALLRPT"; Slct_machine_QC_chart.DataBind(); } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex); } finally { } } }
public void QC_chart_D1(string unit) { if (unit == "MBU") { ds = objserver.GetDateset("select '-Select-' MBU,'-Select-' MBU union select distinct MBU,MBU from Machine_rpt_tble order by 1 asc"); Slct_machine_QC_chart.DataSource = ds.Tables[0]; Slct_machine_QC_chart.DataValueField = "MBU"; Slct_machine_QC_chart.DataTextField = "MBU"; Slct_machine_QC_chart.DataBind(); } else if (unit == "ABU") { ds = objserver.GetDateset("select '-Select-' ABU,'-Select-' ABU union select distinct ABU,ABU from Machine_rpt_tble order by 1 asc"); Slct_machine_QC_chart.DataSource = ds.Tables[0]; Slct_machine_QC_chart.DataValueField = "ABU"; Slct_machine_QC_chart.DataTextField = "ABU"; Slct_machine_QC_chart.DataBind(); } else if (unit == "ALL") { ds = objserver.GetDateset("SELECT '-Select-' ALLRPT,'-Select-' ALLRPT union select distinct MBU,MBU as ALLRPT FROM Machine_rpt_tble where MBU<>'' UNION ALL SELECT '-Select-' ALLRPT,'-Select-' ALLRPT union select distinct ABU,ABU as ALLRPT FROM Machine_rpt_tble where ABU<>'' "); Slct_machine_QC_chart.DataSource = ds.Tables[0]; Slct_machine_QC_chart.DataValueField = "ALLRPT"; Slct_machine_QC_chart.DataTextField = "ALLRPT"; Slct_machine_QC_chart.DataBind(); } if (Session["Machine"] != null && Session["Machine"].ToString() != "") { Slct_machine_QC_chart.Value = Session["Machine"].ToString(); } else { } }