private void listView1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { currentItem = this.listView1.GetItemAt(e.X, e.Y); if (currentItem == null) { return; } if (currentItem.Tag is Fire_Hot) { Fire_Hot hot = currentItem.Tag as Fire_Hot; if (hot.status == 0) { this.MenuItem_Examine.Visible = false; } else if (hot.status == 1) { this.MenuItem_Feedback.Visible = false; } else { } } this.contextMenuStrip1.Show(this, e.Location); } }
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { if (this.listView1.SelectedItems.Count > 0) { ListViewItem item = this.listView1.SelectedItems[0]; if (item.Tag != null && item.Tag is Fire_Hot) { this.currentHot = item.Tag as Fire_Hot; this.navigationControl1.BtnEdit.Enabled = true; this.navigationControl1.BtnDelete.Enabled = true; } else { this.currentHot = null; this.navigationControl1.BtnDelete.Enabled = false; this.navigationControl1.BtnEdit.Enabled = false; } } else { this.currentHot = null; this.navigationControl1.BtnDelete.Enabled = false; this.navigationControl1.BtnEdit.Enabled = false; } }
public void EditTest() { HotController hotController; // 测试用例1 hotController = new HotController(); hotController.Edit((Fire_Hot)null); Assert.IsNotNull((object)hotController); Assert.IsNull((object)(hotController.FeedbackEvent)); Assert.IsNull((object)(hotController.AuditEvent)); Assert.IsNull((object)(hotController.GetDetailsEvent)); Assert.AreEqual <string>("127.0.0.1", ((BaseService)hotController).Server); Assert.AreEqual <int>(8080, ((BaseService)hotController).Port); // 测试用例2 hotController = new HotController(); Fire_Hot s0 = new Fire_Hot(); s0.OBJECTID = 0; s0.shape = (string)null; s0.no = (string)null; s0.satellite = (string)null; s0.longitude = 0; s0.latitude = 0; s0.pixels = 0; s0.smoke = 0; s0.continuous = 0; s0.landtype = (string)null; s0.county = (string)null; s0.type = 0; s0.receiptt = (string)null; s0.note = (string)null; s0.reporter = (string)null; s0.reporttime = (string)null; s0.opinion = (string)null; s0.duty = (string)null; s0.cre_time = (string)null; s0.cre_pers = (string)null; s0.mod_time = (string)null; s0.mod_pers = (string)null; s0.source = (string)null; s0.id = (string)null; s0.pac = (string)null; s0.status = 0; s0.hotFeedback = (HotFeedback)null; s0.mediaByteDict = (Dictionary <string, object>)null; s0.mediaFiles = (List <MediaFile>)null; hotController.Edit(s0); Assert.IsNotNull((object)hotController); Assert.IsNull((object)(hotController.FeedbackEvent)); Assert.IsNull((object)(hotController.AuditEvent)); Assert.IsNull((object)(hotController.GetDetailsEvent)); Assert.AreEqual <string>("127.0.0.1", ((BaseService)hotController).Server); Assert.AreEqual <int>(8080, ((BaseService)hotController).Port); }
private void MenuItem_Examine_Click(object sender, EventArgs e) { if (currentItem != null && currentItem.Tag is Fire_Hot) { Fire_Hot hot = currentItem.Tag as Fire_Hot; FormHotDetails form = new FormHotDetails(hot, HotOperate.Examine); if (form.ShowDialog() == DialogResult.OK) { this.GetHotList(this.navigationControl1.Pac); } } }
private void FillDetails(Fire_Hot hot) { if (this.hotOperate == HotOperate.Feedback) { this.panel_feedback.Visible = false; this.tabControl1.TabPages.Remove(this.tabPage_ExamineInfo); this.btnExamine.Visible = false; } else { this.tbx_hly_name.Text = this.currentHot.hotFeedback.initiator_name; try { this.dtp_createTime.Value = Convert.ToDateTime(this.currentHot.hotFeedback.createTime); } catch { } this.tbx_HotDetails.Text = this.currentHot.hotFeedback.description; if (this.currentHot.hotFeedback.mediaFiles != null) { this.mediaControl1.MediaFiles = this.currentHot.hotFeedback.mediaFiles; } this.tbx_hly_name.Enabled = false; this.dtp_createTime.Enabled = false; this.tbx_HotDetails.Enabled = false; if (this.hotOperate == HotOperate.Examine) { this.label_county_name.Visible = false; this.tbx_county_name.Visible = false; this.label_examineTime.Visible = false; this.dtp_ExamineTime.Visible = false; this.btnFeedback.Visible = false; } else { this.tbx_county_name.Text = this.currentHot.hotFeedback.examineUser_name; try { this.dtp_ExamineTime.Value = Convert.ToDateTime(this.currentHot.hotFeedback.examineTime); } catch { } this.tbx_county_option.Text = this.currentHot.hotFeedback.examineOption; this.tbx_county_name.Enabled = false; this.dtp_ExamineTime.Enabled = false; this.tbx_county_option.Enabled = false; this.btnFeedback.Visible = false; this.btnExamine.Visible = false; } } }
public FormHot(OperationType type, Fire_Hot hot = null) { InitializeComponent(); this.m_OperationType = type; this.currentHot = hot; this.m_AreaCodeController = new AreaCodeController(); this.m_AreaCodeController.QueryEvent += m_AreaCodeController_QueryEvent; this.m_HotController = new HotController(); this.m_HotController.AddEvent += m_HotController_AddEvent; this.m_HotController.EditEvent += m_HotController_EditEvent; }
public FormHotDetails(Fire_Hot hot, HotOperate hotOperate) { InitializeComponent(); this.currentHot = hot; this.hotOperate = hotOperate; this.hotControler = new HotController(); this.hotControler.GetDetailsEvent += new EventHandler <ServiceEventArgs>(HotControler_GetDetailsEvent); this.hotControler.AuditEvent += new EventHandler <ServiceEventArgs>(HotControler_AuditEvent); this.hotControler.FeedbackEvent += new EventHandler <ServiceEventArgs>(HotControler_FeedbackEvent); this.m_AreaCodeController = new AreaCodeController(); this.m_AreaCodeController.QueryEvent += m_AreaCodeController_QueryEvent; }
private void FillData(List <Fire_Hot> hotList) { this.pager1.Bind(); this.pager1.bindingSource.DataSource = hotList; this.pager1.bindingNavigator.BindingSource = this.pager1.bindingSource; this.listView1.Items.Clear(); if (hotList != null) { for (int i = 0; i < hotList.Count; i++) { Fire_Hot hot = hotList[i]; ListViewItem item = new ListViewItem(); item.SubItems.Add(hot.no); AreaCodeInfo county = null; try { if (this.navigationControl1.AreaList != null) { county = this.navigationControl1.AreaList.Where(a => a.code == hot.pac).First(); } } catch { } item.SubItems.Add((hot.county == null && county != null) ? county.name : hot.county); item.SubItems.Add(Enum.GetName(typeof(HotType), hot.type)); item.SubItems.Add(hot.reporter); item.SubItems.Add(hot.reporttime); item.Tag = hot; this.listView1.Items.Add(item); } } }
private void btnOK_Click(object sender, EventArgs e) { if (this.coordinatesInputControl1.Longitude == 0 || this.coordinatesInputControl1.Latitude == 0) { MessageBox.Show(this, "请输入正确的经纬度信息", "信息提示"); this.coordinatesInputControl1.Focus(); return; } if (this.tbx_no.Text == "") { MessageBox.Show(this, "请输入热点编号", "信息提示"); this.tbx_no.Focus(); return; } if (this.tbx_pixels.Text == "") { MessageBox.Show(this, "请输入热点像素", "信息提示"); this.tbx_pixels.Focus(); return; } if (this.Pac == null && this.Pac == "" && this.Pac.EndsWith("00")) { MessageBox.Show(this, "请选择正确的行政区", "信息提示"); this.cbx_county.Focus(); return; } if (this.tbx_reporter.Text == "") { MessageBox.Show(this, "请输入上报人", "信息提示"); this.tbx_reporter.Focus(); return; } if (m_OperationType == OperationType.Add) { this.currentHot = new Fire_Hot(); } this.currentHot.longitude = this.coordinatesInputControl1.Longitude; this.currentHot.latitude = this.coordinatesInputControl1.Latitude; this.currentHot.no = this.tbx_no.Text; this.currentHot.pixels = Convert.ToInt32(this.tbx_pixels.Text); this.currentHot.satellite = this.tbx_satellite.Text; this.currentHot.smoke = Convert.ToInt32(this.cbx_smoke.SelectedValue); this.currentHot.continuous = Convert.ToInt32(this.cbx_continuous.SelectedValue); this.currentHot.landtype = this.tbx_landType.Text; this.currentHot.receiptt = this.dateTimePicker_receiptTime.Value.ToString("yyyy-MM-dd hh:mm:ss"); this.currentHot.reporttime = this.dateTimePicker_reportTime.Value.ToString("yyyy-MM-dd hh:mm:ss"); this.currentHot.county = this.cbx_county.Text; this.currentHot.pac = this.Pac; this.currentHot.duty = this.tbx_duty.Text; this.currentHot.reporter = this.tbx_reporter.Text; this.currentHot.type = Convert.ToInt32(this.cbx_type.SelectedValue); this.currentHot.opinion = this.tbx_opinion.Text; this.currentHot.cre_pers = this.tbx_cre_pers.Text; this.currentHot.note = this.tbx_note.Text; if (m_OperationType == OperationType.Add) { this.currentHot.status = 0; this.m_HotController.Add(this.currentHot); } else if (m_OperationType == OperationType.Edit) { this.m_HotController.Edit(this.currentHot); } }