private void FormHotDetails_Load(object sender, EventArgs e) { #region 初始化控件内容 HotSmokeType smokeType = HotSmokeType.无; List <object> smokeTypeList = CommonHelper.GetDataSource <HotSmokeType>(smokeType); this.cbx_smoke.DisplayMember = "Name"; this.cbx_smoke.ValueMember = "Value"; this.cbx_smoke.DataSource = smokeTypeList; HotContinuousType continuousType = HotContinuousType.非连续; List <object> scontinuousTypeList = CommonHelper.GetDataSource <HotContinuousType>(continuousType); this.cbx_continuous.DisplayMember = "Name"; this.cbx_continuous.ValueMember = "Value"; this.cbx_continuous.DataSource = scontinuousTypeList; HotType hotType = HotType.其他; List <object> hotTypeList = CommonHelper.GetDataSource <HotType>(hotType); this.cbx_type.DisplayMember = "Name"; this.cbx_type.ValueMember = "Value"; this.cbx_type.DataSource = hotTypeList; #endregion //初始化行政区数据 this.Init(GlobeHelper.Instance.User); #region 编辑、查看时为控件赋值 if (this.currentHot != null) { this.coordinatesInputControl11.Longitude = this.currentHot.longitude; this.coordinatesInputControl11.Latitude = this.currentHot.latitude; this.tbx_no.Text = this.currentHot.no; this.tbx_pixels.Text = this.currentHot.pixels.ToString(); this.tbx_satellite.Text = this.currentHot.satellite; this.cbx_smoke.SelectedValue = this.currentHot.smoke; this.cbx_continuous.SelectedValue = this.currentHot.continuous; this.tbx_landType.Text = this.currentHot.landtype; this.dateTimePicker_receiptTime.Value = (this.currentHot.receiptt == "" || this.currentHot.receiptt == null) ? DateTime.Now : Convert.ToDateTime(this.currentHot.receiptt); this.dateTimePicker_reportTime.Value = (this.currentHot.reporttime == "" || this.currentHot.reporttime == null) ? DateTime.Now : Convert.ToDateTime(this.currentHot.reporttime); if (this.currentHot.pac != null && this.currentHot.pac != "") { this.cbx_province.SelectedValue = this.currentHot.pac.Substring(0, 2) + "0000"; this.cbx_city.SelectedValue = this.currentHot.pac.Substring(0, 4) + "00"; this.cbx_county.SelectedValue = this.currentHot.pac; } this.tbx_duty.Text = this.currentHot.duty; this.tbx_reporter.Text = this.currentHot.reporter; this.cbx_type.SelectedValue = this.currentHot.type; this.tbx_opinion.Text = this.currentHot.opinion; this.tbx_note.Text = this.currentHot.note; this.tbx_cre_pers.Text = this.currentHot.cre_pers; } #endregion this.hotControler.GetDetails(new Dictionary <string, object>() { { "id", this.currentHot.id } }); if (hotOperate != HotOperate.Feedback) { this.hotControler.GetDetails(new Dictionary <string, object>() { { "id", this.currentHot.id } }); } else { this.panel_feedback.Visible = false; this.tabControl1.TabPages.Remove(this.tabPage_ExamineInfo); this.btnExamine.Visible = false; } }
private void FormFireHot_Load(object sender, EventArgs e) { #region 初始化控件内容 if (m_OperationType == OperationType.Add) { this.Text = "新增热点"; } else if (m_OperationType == OperationType.Edit) { this.Text = "编辑热点"; } else if (m_OperationType == OperationType.Check) { this.Text = "查看热点"; } HotSmokeType smokeType = HotSmokeType.无; List <object> smokeTypeList = CommonHelper.GetDataSource <HotSmokeType>(smokeType); this.cbx_smoke.DisplayMember = "Name"; this.cbx_smoke.ValueMember = "Value"; this.cbx_smoke.DataSource = smokeTypeList; HotContinuousType continuousType = HotContinuousType.非连续; List <object> scontinuousTypeList = CommonHelper.GetDataSource <HotContinuousType>(continuousType); this.cbx_continuous.DisplayMember = "Name"; this.cbx_continuous.ValueMember = "Value"; this.cbx_continuous.DataSource = scontinuousTypeList; HotType hotType = HotType.其他; List <object> hotTypeList = CommonHelper.GetDataSource <HotType>(hotType); this.cbx_type.DisplayMember = "Name"; this.cbx_type.ValueMember = "Value"; this.cbx_type.DataSource = hotTypeList; this.tbx_cre_pers.Text = GlobeHelper.Instance.User.name; #endregion //初始化行政区数据 this.Init(GlobeHelper.Instance.User); #region 编辑、查看时为控件赋值 if (this.currentHot != null && this.m_OperationType != OperationType.Add) { this.coordinatesInputControl1.Longitude = this.currentHot.longitude; this.coordinatesInputControl1.Latitude = this.currentHot.latitude; this.tbx_no.Text = this.currentHot.no; this.tbx_pixels.Text = this.currentHot.pixels.ToString(); this.tbx_satellite.Text = this.currentHot.satellite; this.cbx_smoke.SelectedValue = this.currentHot.smoke; this.cbx_continuous.SelectedValue = this.currentHot.continuous; this.tbx_landType.Text = this.currentHot.landtype; this.dateTimePicker_receiptTime.Value = (this.currentHot.receiptt == "" || this.currentHot.receiptt == null) ? DateTime.Now : Convert.ToDateTime(this.currentHot.receiptt); this.dateTimePicker_reportTime.Value = (this.currentHot.reporttime == "" || this.currentHot.reporttime == null) ? DateTime.Now : Convert.ToDateTime(this.currentHot.reporttime); if (this.currentHot.pac != null && this.currentHot.pac != "") { this.cbx_province.SelectedValue = this.currentHot.pac.Substring(0, 2) + "0000"; this.cbx_city.SelectedValue = this.currentHot.pac.Substring(0, 4) + "00"; this.cbx_county.SelectedValue = this.currentHot.pac; } this.tbx_duty.Text = this.currentHot.duty; this.tbx_reporter.Text = this.currentHot.reporter; this.cbx_type.SelectedValue = this.currentHot.type; this.tbx_opinion.Text = this.currentHot.opinion; this.tbx_note.Text = this.currentHot.note; this.tbx_cre_pers.Text = this.currentHot.cre_pers; if (this.m_OperationType == OperationType.Check) { this.btnOK.Visible = false; } } #endregion }