protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.dataMng = WeatherDataMng.getInstance(); this.AlarmRB.Checked = true; for (int i = 0; i < this.dataMng.TypeSensorList.Count; i++) { this.AlarmCB.Items.Add((string)this.dataMng.TypeSensorList[i].Name); } for (int i = 0; i < this.dataMng.DeviceList.Count; i++) { WTypeDevice typeDevice = this.dataMng.GetTypeDevice(this.dataMng.DeviceList[i].TypeDevice); if (typeDevice.Name != "HSD" && typeDevice.Name != "DSD") { this.WDeviceTV.Nodes.Add(this.dataMng.DeviceList[i].PKID.ToString(), string.Format("{0}({1})", this.dataMng.DeviceList[i].Name, typeDevice.Name)); } } for (int i = 0; i < this.WDevice.Count; i++) { if (this.WDeviceTV.Nodes.ContainsKey(this.WDevice[i].ToString())) { this.WDeviceTV.Nodes[this.WDevice[i].ToString()].Checked = true; } } }
/// <summary> /// 폼이 로드될때 /// </summary> private void StatsForm_Load(object sender, EventArgs e) { this.dataMng = WeatherDataMng.getInstance(); this.dataMng.onDBDataSetEvt += new EventHandler <SetDBDataEventArgs>(dataMng_onDBDataSetEvt); string ip = Settings.Default.DbIp; string port = Settings.Default.DbPort; string id = Settings.Default.DbId; string pw = Settings.Default.DbPw; string sid = Settings.Default.DbSid; this.odec = new ADEng.Library.oracleDAC(id, pw, ip, port, sid); //측기 리스트 가져오기 getDeviceList(); //시간 리스트 넣어주기 getTimeList(); //차트 메뉴 막기 blockChartMenu(); //차트 기본 속성 세팅 setChartAttribute(); // 조회 조건의 Base 정보 로드 loadBaseData(); // 모든 데이터 클리어 chtWeather2.Data.Clear(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.init(); this.dataMng = WeatherDataMng.getInstance(); this.dataMng.onAddWDeviceEvt += new EventHandler <AddWDeviceEventArgs>(dataMng_onAddWDeviceEvt); this.dataMng.onUpdateWDeviceEvt += new EventHandler <UpdateWDeviceEventArgs>(dataMng_onUpdateWDeviceEvt); this.dataMng.onDeleteWDeviceEvt += new EventHandler <DeleteWDeviceEventArgs>(dataMng_onDeleteWDeviceEvt); this.DeviceInit(); }
/// <summary> /// 생성자 /// </summary> /// <param name="_code"> /// 1 - 등록, 2 - 수정 /// </param> /// <param name="_pkid"> /// 수정일 경우 선택한 사용자 /// </param> public SMSUserMng(byte _code, uint _pkid) { InitializeComponent(); this.dataMng = WeatherDataMng.getInstance(); this.code = _code; this.pkid = _pkid; for (int i = 0; i < this.dataMng.DeviceList.Count; i++) { WTypeDevice typeDevice = this.dataMng.GetTypeDevice(this.dataMng.DeviceList[i].TypeDevice); if (typeDevice.Name != "HSD" && typeDevice.Name != "DSD") { this.WDeviceTV.Nodes.Add(this.dataMng.DeviceList[i].PKID.ToString(), string.Format("{0}({1})", this.dataMng.DeviceList[i].Name, typeDevice.Name)); } } if (_code == 1) //등록 { this.Text = string.Format("SMS 사용자 등록"); this.SmsUserMngPB.BackgroundImage = Resources.sms사용자등록_41; this.SmsUserMngLB.Text = string.Format("SMS 사용자를 등록합니다."); } else if (_code == 2) //수정 { this.Text = string.Format("SMS 사용자 수정"); this.SmsUserMngPB.BackgroundImage = Resources.sms사용자수정_22; this.SmsUserMngLB.Text = string.Format("SMS 사용자를 수정합니다."); WSmsUser wsu = this.dataMng.getSmsUser(_pkid); this.SmsUserNameTB.Text = wsu.Name; this.SmsUserTelNumTB.Text = wsu.TelNum; this.SmsUserRemarkTB.Text = wsu.Remark; List <MapSmsUser> tmpMsuList = new List <MapSmsUser>(); for (int i = 0; i < this.dataMng.MapSmsList.Count; i++) { if (this.dataMng.MapSmsList[i].FkSmsUser == _pkid) { tmpMsuList.Add(this.dataMng.MapSmsList[i]); } } for (int i = 0; i < tmpMsuList.Count; i++) { if (this.WDeviceTV.Nodes.ContainsKey(tmpMsuList[i].FkDevice.ToString())) { this.WDeviceTV.Nodes[tmpMsuList[i].FkDevice.ToString()].Checked = true; } } this.SaveBtn.Enabled = false; } }
public WeatherForm() { InitializeComponent(); this.init(); this.dataMng = WeatherDataMng.getInstance(); this.dataMng.onAddWDeviceEvt += new EventHandler <AddWDeviceEventArgs>(dataMng_onAddWDeviceEvt); this.dataMng.onUpdateWDeviceEvt += new EventHandler <UpdateWDeviceEventArgs>(dataMng_onUpdateWDeviceEvt); this.dataMng.onDeleteWDeviceEvt += new EventHandler <DeleteWDeviceEventArgs>(dataMng_onDeleteWDeviceEvt); this.dataMng.onAddRainDataEvt += new EventHandler <AddRainDataEventArgs>(dataMng_onAddRainDataEvt); this.dataMng.onAddWaterLevelDataEvt += new EventHandler <AddWaterLevelEventArgs>(dataMng_onAddWaterLevelDataEvt); this.dataMng.onAddFlowSpeedDataEvt += new EventHandler <AddFlowSpeedEventArgs>(dataMng_onAddFlowSpeedDataEvt); this.dataMng.onAddAlarmDataEvt += new EventHandler <AddAlarmEventArgs>(dataMng_onAddAlarmDataEvt); this.dataMng.onAddWDeviceItemDataEvt += new EventHandler <AddWDeviceItemDataEventArgs>(dataMng_onAddWDeviceItemDataEvt); this.dataMng.onAddWDeviceRequestEvt += new EventHandler <AddWDeviceRequestEventArgs>(dataMng_onAddWDeviceRequestEvt); this.dataMng.onWDeviceAlarmEvt += new EventHandler <WDeviceAlarmItemsEventArgs>(dataMng_onWDeviceAlarmEvt); this.DeviceInit(); }
public WeatherCtrForm() { InitializeComponent(); this.dataMng = WeatherDataMng.getInstance(); this.dataMng.onAddWDeviceEvt += new EventHandler <AddWDeviceEventArgs>(dataMng_onAddWDeviceEvt); this.dataMng.onUpdateWDeviceEvt += new EventHandler <UpdateWDeviceEventArgs>(dataMng_onUpdateWDeviceEvt); this.dataMng.onDeleteWDeviceEvt += new EventHandler <DeleteWDeviceEventArgs>(dataMng_onDeleteWDeviceEvt); this.dataMng.onAddRainDataEvt += new EventHandler <AddRainDataEventArgs>(dataMng_onAddRainDataEvt); this.dataMng.onAddWaterLevelDataEvt += new EventHandler <AddWaterLevelEventArgs>(dataMng_onAddWaterLevelDataEvt); this.dataMng.onAddFlowSpeedDataEvt += new EventHandler <AddFlowSpeedEventArgs>(dataMng_onAddFlowSpeedDataEvt); this.dataMng.onAddWDeviceItemDataEvt += new EventHandler <AddWDeviceItemDataEventArgs>(dataMng_onAddWDeviceItemDataEvt); this.dataMng.onLatelyRainDataEvt += new EventHandler <LatelyRainDataEventArgs>(dataMng_onLatelyRainDataEvt); this.dataMng.onLatelyWaterLevelEvt += new EventHandler <LatelyWaterLevelDataEventArgs>(dataMng_onLatelyWaterLevelEvt); this.dataMng.onLatelyFlowSpeedEvt += new EventHandler <LatelyFlowSpeedDataEventArgs>(dataMng_onLatelyFlowSpeedEvt); this.init(); this.DeviceInit(); this.dataMng.GetAllLatelyData(); }
public SMSMainForm() { InitializeComponent(); this.dataMng = WeatherDataMng.getInstance(); this.dataMng.onAddSmsUserEvt += new EventHandler <AddSmsUserEventArgs>(dataMng_onAddSmsUserEvt); this.dataMng.onUpdateSmsUserEvt += new EventHandler <UpdateSmsUserEventArgs>(dataMng_onUpdateSmsUserEvt); this.dataMng.onDelSmsUserEvt += new EventHandler <DelSmsUserEventArgs>(dataMng_onDelSmsUserEvt); this.dataMng.onUpdateWDeviceEvt += new EventHandler <UpdateWDeviceEventArgs>(dataMng_onUpdateWDeviceEvt); this.dataMng.onDeleteWDeviceEvt += new EventHandler <DeleteWDeviceEventArgs>(dataMng_onDeleteWDeviceEvt); this.dataMng.onSendSmsUserMsgEvt += new EventHandler <SendSmsMsgEventArgs>(dataMng_onSendSmsUserMsgEvt); this.init(); //SMS 사용자 리스트뷰에 셋팅 for (int i = 0; i < this.dataMng.SmsUserList.Count; i++) { this.UserDetailLV.Items.Add(this.GetListviewItems(this.dataMng.SmsUserList[i].PKID, this.dataMng.SmsUserList[i].Name, this.dataMng.SmsUserList[i].TelNum, this.dataMng.SmsUserList[i].Remark)); } //SMS 사용자 트리뷰에 셋팅 for (int i = 0; i < this.dataMng.SmsUserList.Count; i++) { this.SmsUserTV.Nodes.Add(this.dataMng.SmsUserList[i].PKID.ToString(), string.Format("{0}({1})", this.dataMng.SmsUserList[i].Name, this.dataMng.SmsUserList[i].TelNum)); this.SmsUserTV.Nodes[this.dataMng.SmsUserList[i].PKID.ToString()].ImageIndex = 0; this.SmsUserTV.Nodes[this.dataMng.SmsUserList[i].PKID.ToString()].SelectedImageIndex = 0; List <WDevice> tmpWDeviceList = this.dataMng.GetWDeviceForSmsUser(this.dataMng.SmsUserList[i].PKID); for (int j = 0; j < tmpWDeviceList.Count; j++) { this.SmsUserTV.Nodes[this.dataMng.SmsUserList[i].PKID.ToString()].Nodes.Add(tmpWDeviceList[j].PKID.ToString(), string.Format("{0}({1})", tmpWDeviceList[j].Name, this.dataMng.GetTypeDevice(tmpWDeviceList[j].TypeDevice).Name)); this.SmsUserTV.Nodes[this.dataMng.SmsUserList[i].PKID.ToString()].Nodes[tmpWDeviceList[j].PKID.ToString()].ImageIndex = 1; this.SmsUserTV.Nodes[this.dataMng.SmsUserList[i].PKID.ToString()].Nodes[tmpWDeviceList[j].PKID.ToString()].SelectedImageIndex = 1; } } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.dataMng = WeatherDataMng.getInstance(); for (int i = 0; i < this.dataMng.TypeDeviceList.Count; i++) { this.WDeviceDivisionCB.Items.Add(string.Format("{0}({1})", this.dataMng.TypeDeviceList[i].Name, this.dataMng.TypeDeviceList[i].Remark)); } for (int i = 0; i < this.dataMng.TypeSensorList.Count; i++) { this.SensorKindLV.Items.Add(this.dataMng.TypeSensorList[i].Name); } if (this.mode == (byte)FType.add) { this.Text = "측기 등록"; this.WDeviceMainLB.Text = "측기를 등록합니다."; this.WDeviceMainPB.BackgroundImage = Resources.우량기정보관리_등록_41_40; } else if (this.mode == (byte)FType.update) { this.Text = "측기 수정"; this.WDeviceMainLB.Text = "측기를 수정합니다."; this.WDeviceMainPB.BackgroundImage = Resources.우량기정보관리_수정_41_40; this.WDeviceDivisionCB.Enabled = false; this.WDeviceIDTB.Enabled = false; if ((this.wDSensor & 0x01) == 0x01) //강수 { for (int i = 0; i < this.SensorKindLV.Items.Count; i++) { if (this.SensorKindLV.Items[i].Text == "우량계") { this.SensorKindLV.Items[i].Checked = true; } } } if ((this.wDSensor & 0x02) == 0x02) //수위 { for (int i = 0; i < this.SensorKindLV.Items.Count; i++) { if (this.SensorKindLV.Items[i].Text == "수위계") { this.SensorKindLV.Items[i].Checked = true; } } } if ((this.wDSensor & 0x04) == 0x04) //유속 { for (int i = 0; i < this.SensorKindLV.Items.Count; i++) { if (this.SensorKindLV.Items[i].Text == "유속계") { this.SensorKindLV.Items[i].Checked = true; } } } } this.WDeviceDivisionCB.SelectedItem = this.wDivision; this.EternetUseCB.Checked = this.wDEthernetUse; this.WDeviceRemarkTB.Text = this.WDRemark; this.SaveBtn.Enabled = false; }