public void init_jcxInfor(string newjcxbh) { if (jcxxx.Have_ThisLine(newjcxbh, "", "")) { try { JCXXXB newjcx = jcxxx.GetModelbyJcxbh(newjcxbh); textBoxJcxIP.Text = newjcx.GYJSJIP; textBoxJcxmc.Text = newjcx.JCXMC; if (newjcx.DPCGJBH != 0) { int cgjbh = newjcx.DPCGJBH; SYS.Model.SBXXB cgjsb = null; cgjsb = sbxx.Get_sb_by_bh(cgjbh); comboBoxCgj.Text = cgjsb.SBMC; } else { comboBoxCgj.Text = "无"; } if (newjcx.FQFXYBH != 0) { int cgjbh = newjcx.FQFXYBH; SYS.Model.SBXXB cgjsb = null; cgjsb = sbxx.Get_sb_by_bh(cgjbh); comboBoxFqfxy.Text = cgjsb.SBMC; } else { comboBoxFqfxy.Text = "无"; } if (newjcx.BTGYDJBH != 0) { int cgjbh = newjcx.BTGYDJBH; SYS.Model.SBXXB cgjsb = null; cgjsb = sbxx.Get_sb_by_bh(cgjbh); comboBoxYdj.Text = cgjsb.SBMC; } else { comboBoxYdj.Text = "无"; } if (newjcx.LLJBH != 0) { int cgjbh = newjcx.LLJBH; SYS.Model.SBXXB cgjsb = null; cgjsb = sbxx.Get_sb_by_bh(cgjbh); comboBoxLlj.Text = cgjsb.SBMC; } else { comboBoxLlj.Text = "无"; } if (newjcx.PCBH != 0) { int cgjbh = newjcx.PCBH; SYS.Model.SBXXB cgjsb = null; cgjsb = sbxx.Get_sb_by_bh(cgjbh); comboBoxPC.Text = cgjsb.SBMC; } else { comboBoxPC.Text = "无"; } if (newjcx.HJZBH != 0) { int cgjbh = newjcx.HJZBH; SYS.Model.SBXXB cgjsb = null; cgjsb = sbxx.Get_sb_by_bh(cgjbh); comboBoxHjz.Text = cgjsb.SBMC; } else { comboBoxHjz.Text = "无"; } if (newjcx.WYZSBBH != 0) { int cgjbh = newjcx.WYZSBBH; SYS.Model.SBXXB cgjsb = null; cgjsb = sbxx.Get_sb_by_bh(cgjbh); comboBoxZsj.Text = cgjsb.SBMC; } else { comboBoxZsj.Text = "无"; } textBoxRzbh.Text = newjcx.RZBH; textBoxZzcs.Text = newjcx.ZZCS; textBoxXh.Text = newjcx.XH; string cgjCK = newjcx.DPCGJPZ.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries)[0]; string fqyCK = newjcx.FQFXYPZ.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries)[0]; string ydjCK = newjcx.BTGYDJPZ.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries)[0]; string lljCK = newjcx.LLJPZ.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries)[0]; comboBoxCgjCk.Text = cgjCK; comboBoxFqyCk.Text = fqyCK; comboBoxYdjCk.Text = ydjCK; comboBoxLljCk.Text = lljCK; MessageBox.Show("查询成功!", "系统提示"); } catch { MessageBox.Show("检测线读取出错", "系统提示"); } } else { MessageBox.Show("不存在该检测线", "系统提示"); } }
public void ref_WaitCar() { try { dt_wait = new DataTable(); dt_wait.Columns.Add("检测线编号"); dt_wait.Columns.Add("检测线IP地址"); dt_wait.Columns.Add("检测线名称"); dt_wait.Columns.Add("测功机名称"); dt_wait.Columns.Add("测功机厂家"); dt_wait.Columns.Add("废气仪名称"); dt_wait.Columns.Add("废气仪厂家"); dt_wait.Columns.Add("烟度计名称"); dt_wait.Columns.Add("烟度计厂家"); dt_wait.Columns.Add("流量计名称"); dt_wait.Columns.Add("流量计厂家"); dt_wait.Columns.Add("检测线安装公司"); dt_wait.Columns.Add("认证编号"); DataTable dt = jcxxx.getAllJiancexian(); //DataTable dt = bjclxx.getAllCarWait(); DataRow dr = null; if (dt != null) { foreach (DataRow dR in dt.Rows) { dr = dt_wait.NewRow(); dr["检测线编号"] = dR["JCXBH"].ToString(); dr["检测线名称"] = dR["JCXMC"].ToString(); dr["检测线IP地址"] = dR["GYJSJIP"].ToString(); if (dR["DPCGJBH"].ToString() != "0") { int cgjbh = 0; SYS.Model.SBXXB cgjsb = null; if (int.TryParse(dR["DPCGJBH"].ToString(), out cgjbh)) { cgjsb = sbxx.Get_sb_by_bh(cgjbh); } dr["测功机名称"] = cgjsb.SBMC; dr["测功机厂家"] = cgjsb.SCCJ; } else { dr["测功机名称"] = "未配置"; dr["测功机厂家"] = "未配置"; } if (dR["FQFXYBH"].ToString() != "0") { int cgjbh = 0; SYS.Model.SBXXB cgjsb = null; if (int.TryParse(dR["FQFXYBH"].ToString(), out cgjbh)) { cgjsb = sbxx.Get_sb_by_bh(cgjbh); } dr["废气仪名称"] = cgjsb.SBMC; dr["废气仪厂家"] = cgjsb.SCCJ; } else { dr["废气仪名称"] = "未配置"; dr["废气仪厂家"] = "未配置"; } if (dR["BTGYDJBH"].ToString() != "0") { int cgjbh = 0; SYS.Model.SBXXB cgjsb = null; if (int.TryParse(dR["BTGYDJBH"].ToString(), out cgjbh)) { cgjsb = sbxx.Get_sb_by_bh(cgjbh); } dr["烟度计名称"] = cgjsb.SBMC; dr["烟度计厂家"] = cgjsb.SCCJ; } else { dr["烟度计名称"] = "未配置"; dr["烟度计厂家"] = "未配置"; } if (dR["LLJBH"].ToString() != "0") { int cgjbh = 0; SYS.Model.SBXXB cgjsb = null; if (int.TryParse(dR["LLJBH"].ToString(), out cgjbh)) { cgjsb = sbxx.Get_sb_by_bh(cgjbh); } dr["流量计名称"] = cgjsb.SBMC; dr["流量计厂家"] = cgjsb.SCCJ; } else { dr["流量计名称"] = "未配置"; dr["流量计厂家"] = "未配置"; } dr["检测线安装公司"] = dR["ZZCS"].ToString(); dr["认证编号"] = dR["RZBH"].ToString(); dt_wait.Rows.Add(dr); } } ref_zt = false; dataGrid_waitcar.DataSource = dt_wait; dataGrid_waitcar.FirstDisplayedScrollingRowIndex = Carwait_Scroll; dataGrid_waitcar.Sort(dataGrid_waitcar.Columns["检测线编号"], ListSortDirection.Ascending); ref_zt = true; } catch (Exception) { } }