private void LoadData() { try { EventTypeOR m_Even = new EventTypeDA().selectARowDate(Request.QueryString["id"]); txtEventname.Text = m_Even.Eventname;//事件名称 dpdAlarmlevel.SelectedValue = m_Even.Alarmlevel.ToString();//事件级别 string[] AlarmWay = m_Even.Alarmway.Split('-');//报警方式 if (AlarmWay[0] == "1") check_Sms.Checked = true; else check_Sms.Checked = false; if (AlarmWay[1] == "1") check_Phone.Checked = true; else check_Phone.Checked = false; if (AlarmWay[2] == "1") check_Media.Checked = true; else check_Media.Checked = false; if (AlarmWay[3] == "1") check_Emali.Checked = true; else check_Emali.Checked = false; string[] strAlarmTarget = m_Even.Alarmtarget.Split('-'); foreach (string str in strAlarmTarget) { foreach (ListItem li in cbAlertGroup.Items) { if (str == li.Value) li.Selected = true; } } txtIsenablefrequency.Checked = m_Even.Isenablefrequency.ToString() == "1" ? true : false;//是否班次报警 txtAlarmaudiofile.Text = m_Even.Alarmaudiofile;//电话语音文件 txtDisalarmaudiofile.Text = m_Even.Disalarmaudiofile;//电话语音文件 txtSmsmsg.Text = m_Even.Smsmsg;//短信、Email、语音报警内容格式 //txtDisarmid.Text = m_Even.Disarmid;//撤防时间 ShowSettedDisarmInfo ( m_Even.Disarmid);//撤防时间 } catch (Exception e) { Alert(e); } }
private void BindEvent() { DataTable dt = new EventTypeDA().selectAllDate(); DataRow dr = dt.NewRow(); dr["EventName"] = ""; dr["EventID"] = "-1"; dt.Rows.InsertAt(dr, 0); cmbEvent.DataSource = cmbEventLo.DataSource = cmbEventHi.DataSource = dt; cmbEvent.DataTextField = cmbEventLo.DataTextField = cmbEventHi.DataTextField = "EventName"; cmbEvent.DataValueField = cmbEventLo.DataValueField = cmbEventHi.DataValueField = "EventID"; cmbEvent.DataBind(); cmbEventLo.DataBind(); cmbEventHi.DataBind(); DataTable dtAlarm = m_devi.GetAllLightAlarm(); DataRow drAlarm = dtAlarm.NewRow(); drAlarm["LightID"] = -1; drAlarm["LightName"] = "未启用声光报警"; drAlarm["DeviceID"] = -1; drAlarm["ChannelNO"] = -1; dtAlarm.Rows.InsertAt(drAlarm, 0); ReleaseLightID.DataSource=LightID.DataSource = dtAlarm; ReleaseLightID.DataTextField = LightID.DataTextField = "LightName"; ReleaseLightID.DataValueField = LightID.DataValueField = "LightID"; LightID.DataBind(); ReleaseLightID.DataBind(); }