private void button2_Click(object sender, EventArgs e) { { if (tx巡检时间.Text == string.Empty) { MessageBox.Show("请填写[巡检时间]的相关信息 !", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); tx巡检时间.Focus(); return; } DateDef.巡检记录 巡检记录Info = new DateDef.巡检记录(strPointCode); 巡检记录Info.B巡检时间 = tx巡检时间.Text; 巡检记录Info.B室内湿度 = tx室内湿度.Text; 巡检记录Info.B直流总电流 = tx直流总电流.Text; 巡检记录Info.B室外消防 = tx室外消防.Text; 巡检记录Info.B开关电源 = tx开关电源.Text; 巡检记录Info.B发现隐患 = tx发现隐患.Text; 巡检记录Info.B板房 = tx板房.Text; 巡检记录Info.B蓄电池 = tx蓄电池.Text; 巡检记录Info.B室内卫生 = tx室内卫生.Text; 巡检记录Info.B天馈系统 = tx天馈系统.Text; 巡检记录Info.BBTS系统 = txBTS系统.Text; 巡检记录Info.B空调系统 = tx空调系统.Text; 巡检记录Info.B备注 = tx备注.Text; 巡检记录Info.B巡检人 = tx巡检人.Text; 巡检记录Info.B动力引入 = tx动力引入.Text; 巡检记录Info.B机房备品 = tx机房备品.Text; 巡检记录Info.B消防设施 = tx消防设施.Text; 巡检记录Info.B防雷系统 = tx防雷系统.Text; 巡检记录Info.B铁塔 = tx铁塔.Text; 巡检记录Info.B传输系统 = tx传输系统.Text; 巡检记录Info.B室内温度 = tx室内温度.Text; 巡检记录Info.B室外卫生 = tx室外卫生.Text; 巡检记录Info.B应急灯 = tx应急灯.Text; 巡检记录Info.B环监系统 = tx环监系统.Text; 巡检记录comend.UpDate巡检记录(巡检记录Info); SQLExecute.Operate = "用户" + DBUser.CURR_USERID + "更新巡检记录,支撑中心编号:" + strPointCode + ",巡检记录的巡检时间:" + tx巡检时间.Text; SQLExecute.SaveOperate(); MessageBox.Show("更新成功 !", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); InitDic(); } }
/// <summary> /// 初始化集合 /// </summary> private void InitDic() { dic巡检记录 = new Dictionary<string, DateDef.巡检记录>(); DateDef.巡检记录 巡检记录Info = null; DataTable dt = 巡检记录comend.Get巡检记录ByID(strPointCode); if (listBox1.Items.Count > 0) { listBox1.Items.Clear(); } if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { 巡检记录Info = new DateDef.巡检记录(dr["basedateID"].ToString()); 巡检记录Info.B巡检时间 = dr["巡检时间"].ToString(); 巡检记录Info.B室内湿度 = dr["室内湿度"].ToString(); 巡检记录Info.B直流总电流 = dr["直流总电流"].ToString(); 巡检记录Info.B室外消防 = dr["室外消防"].ToString(); 巡检记录Info.B开关电源 = dr["开关电源"].ToString(); 巡检记录Info.B发现隐患 = dr["发现隐患"].ToString(); 巡检记录Info.B板房 = dr["板房"].ToString(); 巡检记录Info.B蓄电池 = dr["蓄电池"].ToString(); 巡检记录Info.B室内卫生 = dr["室内卫生"].ToString(); 巡检记录Info.B天馈系统 = dr["天馈系统"].ToString(); 巡检记录Info.BBTS系统 = dr["BTS系统"].ToString(); 巡检记录Info.B空调系统 = dr["空调系统"].ToString(); 巡检记录Info.B备注 = dr["备注"].ToString(); 巡检记录Info.B巡检人 = dr["巡检人"].ToString(); 巡检记录Info.B动力引入 = dr["动力引入"].ToString(); 巡检记录Info.B机房备品 = dr["机房备品"].ToString(); 巡检记录Info.B消防设施 = dr["消防设施"].ToString(); 巡检记录Info.B防雷系统 = dr["防雷系统"].ToString(); 巡检记录Info.B铁塔 = dr["铁塔"].ToString(); 巡检记录Info.B传输系统 = dr["传输系统"].ToString(); 巡检记录Info.B室内温度 = dr["室内温度"].ToString(); 巡检记录Info.B室外卫生 = dr["室外卫生"].ToString(); 巡检记录Info.B应急灯 = dr["应急灯"].ToString(); 巡检记录Info.B环监系统 = dr["环监系统"].ToString(); dic巡检记录.Add(巡检记录Info.B巡检时间, 巡检记录Info); listBox1.Items.Add(巡检记录Info.B巡检时间); } } }
private void tx巡检时间_TextChanged(object sender, EventArgs e) { DateDef.巡检记录 巡检记录Info = new DateDef.巡检记录(strPointCode); //tx巡检时间.Text = 巡检记录Info.B巡检时间; tx室内湿度.Text = 巡检记录Info.B室内湿度; tx直流总电流.Text = 巡检记录Info.B直流总电流; tx室外消防.Text = 巡检记录Info.B室外消防; tx开关电源.Text = 巡检记录Info.B开关电源; tx发现隐患.Text = 巡检记录Info.B发现隐患; tx板房.Text = 巡检记录Info.B板房; tx蓄电池.Text = 巡检记录Info.B蓄电池; tx室内卫生.Text = 巡检记录Info.B室内卫生; tx天馈系统.Text = 巡检记录Info.B天馈系统; txBTS系统.Text = 巡检记录Info.BBTS系统; tx空调系统.Text = 巡检记录Info.B空调系统; tx备注.Text = 巡检记录Info.B备注; tx巡检人.Text = 巡检记录Info.B巡检人; tx动力引入.Text = 巡检记录Info.B动力引入; tx机房备品.Text = 巡检记录Info.B机房备品; tx消防设施.Text = 巡检记录Info.B消防设施; tx防雷系统.Text = 巡检记录Info.B防雷系统; tx铁塔.Text = 巡检记录Info.B铁塔; tx传输系统.Text = 巡检记录Info.B传输系统; tx室内温度.Text = 巡检记录Info.B室内温度; tx室外卫生.Text = 巡检记录Info.B室外卫生; tx应急灯.Text = 巡检记录Info.B应急灯; tx环监系统.Text = 巡检记录Info.B环监系统; }
/// <summary> /// 刷新画面 /// </summary> /// <param name="i">用liseBox中的第几个</param> private void FlashUI(int i) { DateDef.巡检记录 巡检记录Info = null; if (listBox1.Items.Count > 0 && dic巡检记录.Count > 0) { 巡检记录Info = dic巡检记录[listBox1.Items[i].ToString()]; if (巡检记录Info != null) { tx巡检时间.Text = 巡检记录Info.B巡检时间; tx室内湿度.Text = 巡检记录Info.B室内湿度; tx直流总电流.Text = 巡检记录Info.B直流总电流; tx室外消防.Text = 巡检记录Info.B室外消防; tx开关电源.Text = 巡检记录Info.B开关电源; tx发现隐患.Text = 巡检记录Info.B发现隐患; tx板房.Text = 巡检记录Info.B板房; tx蓄电池.Text = 巡检记录Info.B蓄电池; tx室内卫生.Text = 巡检记录Info.B室内卫生; tx天馈系统.Text = 巡检记录Info.B天馈系统; txBTS系统.Text = 巡检记录Info.BBTS系统; tx空调系统.Text = 巡检记录Info.B空调系统; tx备注.Text = 巡检记录Info.B备注; tx巡检人.Text = 巡检记录Info.B巡检人; tx动力引入.Text = 巡检记录Info.B动力引入; tx机房备品.Text = 巡检记录Info.B机房备品; tx消防设施.Text = 巡检记录Info.B消防设施; tx防雷系统.Text = 巡检记录Info.B防雷系统; tx铁塔.Text = 巡检记录Info.B铁塔; tx传输系统.Text = 巡检记录Info.B传输系统; tx室内温度.Text = 巡检记录Info.B室内温度; tx室外卫生.Text = 巡检记录Info.B室外卫生; tx应急灯.Text = 巡检记录Info.B应急灯; tx环监系统.Text = 巡检记录Info.B环监系统; } } else { 巡检记录Info = new DateDef.巡检记录(strPointCode); tx巡检时间.Text = 巡检记录Info.B巡检时间; tx室内湿度.Text = 巡检记录Info.B室内湿度; tx直流总电流.Text = 巡检记录Info.B直流总电流; tx室外消防.Text = 巡检记录Info.B室外消防; tx开关电源.Text = 巡检记录Info.B开关电源; tx发现隐患.Text = 巡检记录Info.B发现隐患; tx板房.Text = 巡检记录Info.B板房; tx蓄电池.Text = 巡检记录Info.B蓄电池; tx室内卫生.Text = 巡检记录Info.B室内卫生; tx天馈系统.Text = 巡检记录Info.B天馈系统; txBTS系统.Text = 巡检记录Info.BBTS系统; tx空调系统.Text = 巡检记录Info.B空调系统; tx备注.Text = 巡检记录Info.B备注; tx巡检人.Text = 巡检记录Info.B巡检人; tx动力引入.Text = 巡检记录Info.B动力引入; tx机房备品.Text = 巡检记录Info.B机房备品; tx消防设施.Text = 巡检记录Info.B消防设施; tx防雷系统.Text = 巡检记录Info.B防雷系统; tx铁塔.Text = 巡检记录Info.B铁塔; tx传输系统.Text = 巡检记录Info.B传输系统; tx室内温度.Text = 巡检记录Info.B室内温度; tx室外卫生.Text = 巡检记录Info.B室外卫生; tx应急灯.Text = 巡检记录Info.B应急灯; tx环监系统.Text = 巡检记录Info.B环监系统; } }