private void btnOK_Click(object sender, EventArgs e) { if (!IsCondition()) { return; } IDictionary <string, string> dict = new Dictionary <string, string>(); try { this.tabControl1.SelectedTab = this.tabPage_baseInfo; dict = m_Artificiallake.ObjectDescriptionToDict(); } catch (Exception ex) { MessageBox.Show(ex.Message); } if (!SmartForm.Validator(this.tabPage_baseInfo.Controls, dict)) { return; } if (m_OperationType == OperationType.Add) { this.m_Artificiallake = new Fire_Artificiallake(); } if (m_OperationType == OperationType.Add) { this.m_Artificiallake = new Fire_Artificiallake(); } this.m_Artificiallake.longitude = this.coordinatesInputControl1.Longitude; this.m_Artificiallake.latitude = this.coordinatesInputControl1.Latitude; this.m_Artificiallake.pac = this.pacControl11.LocalPac; this.m_Artificiallake.city_name = this.pacControl11.City; this.m_Artificiallake.county_name = this.pacControl11.County; this.m_Artificiallake.shape = Converters.LngLatToWKT(this.m_Artificiallake.longitude, this.m_Artificiallake.latitude); //自动从窗体控件上取值 m_Artificiallake = SmartForm.GetEntity <Fire_Artificiallake>(this.tabPage_baseInfo.Controls, this.m_Artificiallake); this.m_Artificiallake.note = this.tbx_note.Text.Trim(); this.m_Artificiallake.mediaByteDict = this.mediaControl1.MediaByteDict; if (m_OperationType == OperationType.Add) { this.m_ArtificiallakeController.Add(this.m_Artificiallake); } else if (m_OperationType == OperationType.Edit) { this.m_ArtificiallakeController.Edit(this.m_Artificiallake); } }
private void btnOK_Click(object sender, EventArgs e) { if (!IsCondition()) { return; } IDictionary <string, string> dict = new Dictionary <string, string>(); try { this.tabControl1.SelectedTab = this.tabPage_baseInfo; dict = m_FireDocument.ObjectDescriptionToDict(); } catch (Exception ex) { MessageBox.Show(ex.Message); } if (!SmartForm.Validator(this.tabPage_baseInfo.Controls, dict)) { return; } if (m_OperationType == OperationType.Add) { this.m_FireDocument = new Fire_Document(); } this.m_FireDocument.longitude = this.coordinatesInputControl1.Longitude; this.m_FireDocument.latitude = this.coordinatesInputControl1.Latitude; this.m_FireDocument.pac = this.pacControl11.LocalPac; this.m_FireDocument.code = this.m_FireDocument.pac; this.m_FireDocument.province = this.pacControl11.Province; this.m_FireDocument.city = this.pacControl11.City; this.m_FireDocument.county = this.pacControl11.County; this.m_FireDocument.town_name = this.tbx_town_name.Text.Trim(); this.m_FireDocument.village_name = this.tbx_village_name.Text.Trim(); this.m_FireDocument.shape = Converters.LngLatToWKT((double)this.m_FireDocument.longitude, (double)this.m_FireDocument.latitude); //自动从窗体控件上取值 m_FireDocument = SmartForm.GetEntity <Fire_Document>(this.tabPage_baseInfo.Controls, this.m_FireDocument); this.m_FireDocument.description = this.tbx_description.Text.Trim(); this.m_FireDocument.mediaByteDict = this.mediaControl1.MediaByteDict; if (m_OperationType == OperationType.Add) { this.m_FireDocumentController.Add(this.m_FireDocument); } else if (m_OperationType == OperationType.Edit) { this.m_FireDocumentController.Edit(this.m_FireDocument); } }
private void btnOK_Click(object sender, EventArgs e) { if (!IsCondition()) { return; } IDictionary <string, string> dict = new Dictionary <string, string>(); try { this.tabControl1.SelectedTab = this.tabPage_baseInfo; dict = m_RadioStation.ObjectDescriptionToDict(); } catch (Exception ex) { MessageBox.Show(ex.Message); } if (!SmartForm.Validator(this.tabPage_baseInfo.Controls, dict)) { return; } if (m_OperationType == OperationType.Add) { this.m_RadioStation = new Fire_RadioStation(); } this.m_RadioStation.longitude = this.coordinatesInputControl1.Longitude; this.m_RadioStation.latitude = this.coordinatesInputControl1.Latitude; this.m_RadioStation.pac = this.pacControl11.LocalPac; this.m_RadioStation.city = this.pacControl11.City; this.m_RadioStation.county = this.pacControl11.County; this.m_RadioStation.shape = Converters.LngLatToWKT(this.m_RadioStation.longitude, this.m_RadioStation.latitude); //自动从窗体控件上取值 this.m_RadioStation = SmartForm.GetEntity <Fire_RadioStation>(this.tabPage_baseInfo.Controls, this.m_RadioStation); this.m_RadioStation.build_year = this.dtp_build_year.Value.ToString("yyyy-MM-dd hh:mm:ss"); this.m_RadioStation.note = this.tbx_note.Text.Trim(); this.m_RadioStation.mediaByteDict = this.mediaControl1.MediaByteDict; if (m_OperationType == OperationType.Add) { this.m_RadioStationController.Add(this.m_RadioStation); } else if (m_OperationType == OperationType.Edit) { this.m_RadioStationController.Edit(this.m_RadioStation); } }
public void GetEntityTest() { object o; //测试用例1 o = SmartForm.GetEntity <object>((Control.ControlCollection)null, (object)null); //测试用例2 object s0 = new object(); o = SmartForm.GetEntity <object>((Control.ControlCollection)null, s0); //测试用例3 Control.ControlCollection controlCollection; controlCollection = new Control.ControlCollection((Control)null); o = SmartForm.GetEntity <object>(controlCollection, (object)null); }
private void btnOK_Click(object sender, EventArgs e) { if (!IsCondition()) { return; } IDictionary <string, string> dict = new Dictionary <string, string>(); try { this.tabControl1.SelectedTab = this.tabPage_baseInfo; dict = m_DangerousFacilities.ObjectDescriptionToDict(); } catch (Exception ex) { MessageBox.Show(ex.Message); } if (!SmartForm.Validator(this.tabPage_baseInfo.Controls, dict)) { return; } if (m_OperationType == OperationType.Add) { this.m_DangerousFacilities = new Fire_DangerousFacilities(); } this.m_DangerousFacilities.longitude = this.coordinatesInputControl1.Longitude; this.m_DangerousFacilities.latitude = this.coordinatesInputControl1.Latitude; this.m_DangerousFacilities.pac = this.pacControl11.LocalPac; this.m_DangerousFacilities.shape = Converters.LngLatToWKT(this.m_DangerousFacilities.longitude, this.m_DangerousFacilities.latitude); //自动从窗体控件上取值 m_DangerousFacilities = SmartForm.GetEntity <Fire_DangerousFacilities>(this.tabPage_baseInfo.Controls, this.m_DangerousFacilities); this.m_DangerousFacilities.mediaByteDict = this.mediaControl1.MediaByteDict; if (m_OperationType == OperationType.Add) { FormWaitingBox f = new FormWaitingBox((obj, args) => { this.m_DFacilitiesController.Add(this.m_DangerousFacilities); }, 10, "正在提交数据,请耐心等待....", false, false); f.ShowDialog(this); } else if (m_OperationType == OperationType.Edit) { this.m_DFacilitiesController.Edit(this.m_DangerousFacilities); } }
private void btnOK_Click(object sender, EventArgs e) { if (!IsCondition()) { return; } IDictionary <string, string> dict = new Dictionary <string, string>(); try { this.tabControl1.SelectedTab = this.tabPage_baseInfo; dict = m_FireImportantUnits.ObjectDescriptionToDict(); } catch (Exception ex) { MessageBox.Show(ex.Message); } if (!SmartForm.Validator(this.tabPage_baseInfo.Controls, dict)) { return; } if (m_OperationType == OperationType.Add) { this.m_FireImportantUnits = new Fire_ImportantUnits(); } this.m_FireImportantUnits.longitude = this.coordinatesInputControl1.Longitude; this.m_FireImportantUnits.latitude = this.coordinatesInputControl1.Latitude; this.m_FireImportantUnits.pac = this.pacControl11.LocalPac; this.m_FireImportantUnits.SHAPE = Converters.LngLatToWKT(this.m_FireImportantUnits.longitude, this.m_FireImportantUnits.latitude); //自动从窗体控件上取值 m_FireImportantUnits = SmartForm.GetEntity <Fire_ImportantUnits>(this.tabPage_baseInfo.Controls, this.m_FireImportantUnits); this.m_FireImportantUnits.mediaByteDict = this.mediaControl1.MediaByteDict; if (m_OperationType == OperationType.Add) { this.m_FireIUnitsController.Add(this.m_FireImportantUnits); } else if (m_OperationType == OperationType.Edit) { this.m_FireIUnitsController.Edit(this.m_FireImportantUnits); } }