1、梅安森瓦斯监控联网平台软件 V10源代码public partial class ALLbjselect : System.Web.UI.Page public DataTable dt = new DataTable(); public Color color = new Color(); public bool Closed1() bool Result = false; try Dictionary newdicttime1 = Sessiondicttime as Dictionary; Dictionary newdict1 = Sessiondict as Dictionary;
2、int newdt1 = 0; try newdict1.TryGetValue(Requestkbh as string, out newdt1); catch if (newdt1 10) Result = true; catch return Result; protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) protected void TimerControl1_Tick(object sender, EventArgs e) pageload(); public void pageload()
3、bool upFlag; upFlag = Closed1(); if (upFlag) dt = new DataTable(); dt.Columns.Add(point, System.Type.GetType(System.String); dt.Columns.Add(wz, System.Type.GetType(System.String); dt.Columns.Add(ssz, System.Type.GetType(System.String); dt.Columns.Add(point1, System.Type.GetType(System.String); dt.Co
4、lumns.Add(wz1, System.Type.GetType(System.String); dt.Columns.Add(ssz1, System.Type.GetType(System.String); using (SqlConnection objConn = new SqlConnection(CoolMethod.LuohuConStr) SqlCommand objCmd = new SqlCommand(); SqlDataReader objReader = null; objCmd.Connection = objConn; objConn.Open(); objC
5、md.CommandText = select JCws_DEF.point as point,jc_dev.wz as wz,JCws_DEF.ssz as ssz,jc_dev.xs1 as xs1 + from JCws_DEF + left join jc_dev on JCws_DEF.point=jc_dev.point and JCws_DEF.kbh=jc_dev.kbh + where JCws_DEF.alarm0 and JCws_DEF.kbh= + Requestkbh as string + order by JCws_DEF.point; SqlDataReade
6、r dr = objCmd.ExecuteReader(); while (dr.Read() DataRow drow = dt.NewRow(); drowpoint = drpoint; drowwz = drwz; if (drpoint.ToString() != null & drpoint.ToString() != & drpoint.ToString() != 000000) if (drpoint.ToString().Substring(3, 1).ToString() = 0) drowssz = 数据中断; else drowssz = 数据中断; else drow
7、ssz = 数据中断; if (dr.Read() drowpoint1 = drpoint; drowwz1 = drwz; if (drpoint.ToString() != null & drpoint.ToString() != & drpoint.ToString() != 000000) if (drpoint.ToString().Substring(3, 1).ToString() = 0) drowssz1 = 数据中断; else drowssz1 = 数据中断; else drowssz1 = 数据中断; dt.Rows.Add(drow); dr.Close(); ob
8、jConn.Close(); objConn.Dispose(); DataGrid1.DataSource = dt; DataGrid1.DataBind(); for (int i = 0; i 0 and JCws_DEF.kbh= + Requestkbh as string + order by JCws_DEF.point; SqlDataReader dr = objCmd.ExecuteReader(); while (dr.Read() DataRow drow = dt.NewRow(); drowpoint = drpoint; drowwz = drwz; if (d
9、rssz.ToString() != null & drssz.ToString() != & drpoint.ToString() != 000000) if (drpoint.ToString().Substring(3, 1).ToString() = A) if (drssz.ToString() != 断线) drowssz = drssz.ToString() + drxs1.ToString(); else drowssz = drssz.ToString(); else if (drssz.ToString() != 断线) drowssz = drssz.ToString()
10、; else drowssz = drssz.ToString(); else if (drpoint.ToString() != null & drpoint.ToString() != & drpoint.ToString() != 000000) if (drpoint.ToString().Substring(3, 1).ToString() = 0) drowssz = drssz.ToString(); else string point = drpoint.ToString().Substring(0, 3).ToString() + 000; SqlCommand objCmd
11、1 = new SqlCommand(select *from JCws_DEF where point= + point + , objConn); SqlDataReader sdr = objCmd1.ExecuteReader(); if (sdr.Read() if (sdralarm.ToString() = 0 | sdrssz.ToString() = 通讯正常) drowssz = 断线; else drowssz = ; sdr.Close(); else drowssz = ; if (dr.Read() drowpoint1 = drpoint; drowwz1 = d
12、rwz; if (drssz.ToString() != null & drssz.ToString() != & drpoint.ToString() != 000000) if (drpoint.ToString().Substring(3, 1).ToString() = A) if (drssz.ToString() != 断线) drowssz1 = drssz.ToString() + drxs1.ToString(); else drowssz1 = drssz.ToString(); else if (drssz.ToString() != 断线) drowssz1 = drs
13、sz.ToString(); else drowssz1 = drssz.ToString(); else if (drpoint.ToString() != null & drpoint.ToString() != & drpoint.ToString() != 000000) if (drpoint.ToString().Substring(3, 1).ToString() = 0) drowssz1 = drssz.ToString(); else string point = drpoint.ToString().Substring(0, 3).ToString() + 000; Sq
14、lCommand objCmd1 = new SqlCommand(select *from JCws_DEF where point= + point + , objConn); SqlDataReader sdr = objCmd1.ExecuteReader(); if (sdr.Read() if (sdralarm.ToString() = 0 | sdrssz.ToString() = 通讯正常) drowssz1 = 断线; else drowssz1 = ; sdr.Close(); else drowssz1 = ; dt.Rows.Add(drow); dr.Close()
15、; objConn.Close(); objConn.Dispose(); DataGrid1.DataSource = dt; DataGrid1.DataBind(); for (int i = 0; i 0) Svalue.Append(dt.Rows0value.ToString(); string strVal = Svalue.ToString().Split(】); foreach (string x in strVal) if (x.Length 0) ListItem itm = new ListItem(); string strx = x.Substring(x.Inde
16、xOf(【) + 1).Split(); itm.Text = x.ToString().Substring(0, x.ToString().IndexOf(【) + ( + strx1.ToString() + ); itm.Value = x.ToString().Substring(0, x.ToString().IndexOf(【); Select1.Items.Add(itm); Select1.Items.Insert(0, new ListItem(所有测点, %); private DataTable createBjtable() DataTable DtVal = new DataTable(); DtVal.Rows.Clear(); string cfqf = ConfigurationSettings.AppSettingscfqf.ToString(); if (cfqf = 0) DtVal.Columns.Add(测点号, System.Type.GetType(System.String); DtVal.Columns.Add(安装位置, System.Typ
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1