private void BindGrid12() { string connectionString = ConfigurationManager.ConnectionStrings["ERPconnectionstring"].ToString(); Ede.Uof.Utility.Data.DatabaseHelper m_db = new Ede.Uof.Utility.Data.DatabaseHelper(connectionString); StringBuilder cmdTxt = new StringBuilder(); StringBuilder QUERYS = new StringBuilder(); cmdTxt.AppendFormat(@" SELECT [ID] ,[KINDS] ,[NAMES] ,[MOQS] ,[INDAYS] ,[COMMENTS] FROM [TKBUSINESS].[dbo].[TBPURMOQ] WHERE [KINDS]=@KINDS ORDER BY [ID] "); m_db.AddParameter("@KINDS", "樣品"); //m_db.AddParameter("@EDATE", EDATE); DataTable dt = new DataTable(); dt.Load(m_db.ExecuteReader(cmdTxt.ToString())); Grid12.DataSource = dt; Grid12.DataBind(); }
protected void gridCallBack_Callback(object sender, CallBackEventArgs e) { hfMessage.Value = ""; int n = OrgList.SelectedIndex; try { if (e.Parameters[0] != "") { if (e.Parameters[1] == "Up") { UpData(e.Parameters[0]); } else if (e.Parameters[1] == "Down") { DownData(e.Parameters[0]); } else { DeleteData(e.Parameters[0]); } } else if (e.Parameters[0] == "") { BindGrid(n); } if (n == 0) { Grid1.RenderControl(e.Output); } else if (n == 1) { Grid2.RenderControl(e.Output); } else if (n == 2) { Grid3.RenderControl(e.Output); } else if (n == 3) { Grid4.RenderControl(e.Output); } else if (n == 4) { Grid5.RenderControl(e.Output); } else if (n == 5) { Grid6.RenderControl(e.Output); } else if (n == 6) { Grid7.RenderControl(e.Output); } else if (n == 7) { Grid8.RenderControl(e.Output); } else if (n == 8) { Grid9.RenderControl(e.Output); } else if (n == 9) { Grid10.RenderControl(e.Output); } else if (n == 10) { Grid11.RenderControl(e.Output); } else if (n == 11) { Grid12.RenderControl(e.Output); } else if (n == 12) { Grid13.RenderControl(e.Output); } else if (n == 13) { Grid14.RenderControl(e.Output); } } catch { BindGrid(n); } hfMessage.RenderControl(e.Output); }
private void BindGrid(int n) { if (n == 0) { EducationLevelBLL objBLL = new EducationLevelBLL(); IList <EducationLevel> objList = objBLL.GetAllEducationLevel(); Grid1.DataSource = objList; Grid1.DataBind(); Grid1.Visible = true; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; } if (n == 1) { PoliticalStatusBLL objBLL = new PoliticalStatusBLL(); IList <PoliticalStatus> objList = objBLL.GetAllPoliticalStatus(); Grid2.DataSource = objList; Grid2.DataBind(); Grid1.Visible = false; Grid2.Visible = true; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; } if (n == 2) { WorkGroupLeaderLevelBLL objBLL = new WorkGroupLeaderLevelBLL(); IList <WorkGroupLeaderLevel> objList = objBLL.GetAllWorkGroupLeaderLevel(); Grid3.DataSource = objList; Grid3.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = true; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; } if (n == 3) { TechnicianTypeBLL objBLL = new TechnicianTypeBLL(); IList <TechnicianType> objList = objBLL.GetAllTechnicianType(); Grid4.DataSource = objList; Grid4.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = true; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; } if (n == 4) { TechnicianTitleTypeBLL objBLL = new TechnicianTitleTypeBLL(); IList <TechnicianTitleType> objList = objBLL.GetAllTechnicianTitleType(); Grid5.DataSource = objList; Grid5.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = true; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; } if (n == 5) { EducationEmployeeTypeBLL objBLL = new EducationEmployeeTypeBLL(); IList <EducationEmployeeType> objList = objBLL.GetAllEducationEmployeeType(); Grid6.DataSource = objList; Grid6.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = true; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; } if (n == 6) { CommitteeHeadShipBLL objBLL = new CommitteeHeadShipBLL(); IList <CommitteeHeadShip> objList = objBLL.GetAllCommitteeHeadShip(); Grid7.DataSource = objList; Grid7.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = true; Grid8.Visible = false; Grid9.Visible = false; } if (n == 7) { RandomExamModularTypeBLL objBLL = new RandomExamModularTypeBLL(); IList <RandomExamModularType> objList = objBLL.GetAllRandomExamModularType(); Grid8.DataSource = objList; Grid8.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = true; Grid9.Visible = false; } if (n == 8) { OracleAccess oracle = new OracleAccess(); DataTable dt = oracle.RunSqlDataSet("select * from zj_trainplan_type order by trainplan_type_id").Tables[0]; Grid9.DataSource = dt; Grid9.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = true; } if (n == 9) { OracleAccess oracle = new OracleAccess(); DataTable dt = oracle.RunSqlDataSet("select * from zj_safe_level order by order_index").Tables[0]; Grid10.DataSource = dt; Grid10.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; Grid10.Visible = true; } if (n == 10) { OracleAccess oracle = new OracleAccess(); DataTable dt = oracle.RunSqlDataSet("select * from zj_certificate order by order_index").Tables[0]; Grid11.DataSource = dt; Grid11.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; Grid10.Visible = false; Grid11.Visible = true; } if (n == 11) { OracleAccess oracle = new OracleAccess(); DataTable dt = oracle.RunSqlDataSet(@"select a.*,b.certificate_name from zj_certificate_level a left join zj_certificate b on a.certificate_id=b.certificate_id order by a.order_index").Tables[0]; Grid12.DataSource = dt; Grid12.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; Grid10.Visible = false; Grid11.Visible = false; Grid12.Visible = true; } if (n == 12) { OracleAccess oracle = new OracleAccess(); DataTable dt = oracle.RunSqlDataSet(" select * from zj_certificate_unit order by order_index").Tables[0]; Grid13.DataSource = dt; Grid13.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; Grid10.Visible = false; Grid11.Visible = false; Grid12.Visible = false; Grid13.Visible = true; } if (n == 13) { OracleAccess oracle = new OracleAccess(); DataTable dt = oracle.RunSqlDataSet(" select * from zj_train_unit order by order_index").Tables[0]; Grid14.DataSource = dt; Grid14.DataBind(); Grid1.Visible = false; Grid2.Visible = false; Grid3.Visible = false; Grid4.Visible = false; Grid5.Visible = false; Grid6.Visible = false; Grid7.Visible = false; Grid8.Visible = false; Grid9.Visible = false; Grid10.Visible = false; Grid11.Visible = false; Grid12.Visible = false; Grid13.Visible = false; Grid14.Visible = true; } }