/// <summary> /// 提 交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSubmit_Click(object sender, EventArgs e) { // 验证 if (!Check()) { DialogResult = DialogResult.None; return; } DialogResult = DialogResult.OK; // 创建一个瓦斯含量点实体 if (GasPressure == null) { var gasPressure = new GasPressure { CoordinateX = Convert.ToDouble(txtCoordinateX.Text), CoordinateY = Convert.ToDouble(txtCoordinateY.Text), CoordinateZ = Convert.ToDouble(txtCoordinateZ.Text), Depth = Convert.ToDouble(txtDepth.Text), GasPressureValue = Convert.ToDouble(txtGasPressureValue.Text), MeasureDateTime = dtpMeasureDateTime.Value, Tunnel = selectTunnelSimple1.SelectedTunnel, CoalSeams = (CoalSeams)cboCoalSeams.SelectedItem, BindingId = IDGenerator.NewBindingID() }; // 坐标X gasPressure.Save(); DrawGasGushQuantityPt(gasPressure); } else { GasPressure.CoordinateX = Convert.ToDouble(txtCoordinateX.Text); GasPressure.CoordinateY = Convert.ToDouble(txtCoordinateY.Text); GasPressure.CoordinateZ = Convert.ToDouble(txtCoordinateZ.Text); GasPressure.Depth = Convert.ToDouble(txtDepth.Text); GasPressure.GasPressureValue = Convert.ToDouble(txtGasPressureValue.Text); GasPressure.MeasureDateTime = dtpMeasureDateTime.Value; GasPressure.Tunnel = selectTunnelSimple1.SelectedTunnel; GasPressure.CoalSeams = (CoalSeams)cboCoalSeams.SelectedValue; GasPressure.Save(); DelGasGushQuantityPt(GasPressure.BindingId, GasPressure.CoalSeams.CoalSeamsName); DrawGasGushQuantityPt(GasPressure); } }
/// <summary> /// 提 交 /// </summary> /// <params name="sender"></params> /// <params name="e"></params> private void btnSubmit_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; // 创建一个瓦斯含量点实体 if (GasPressure == null) { var gasPressure = new GasPressure { coordinate_x = Convert.ToDouble(txtCoordinateX.Text), coordinate_y = Convert.ToDouble(txtCoordinateY.Text), coordinate_z = Convert.ToDouble(txtCoordinateZ.Text), depth = Convert.ToDouble(txtDepth.Text), gas_pressure_value = Convert.ToDouble(txtGasPressureValue.Text), measure_date_time = dtpMeasureDateTime.Value, tunnel = selectTunnelSimple1.selected_tunnel, bid = IdGenerator.NewBindingId() }; // 坐标X gasPressure.Save(); DrawGasGushQuantityPt(gasPressure); } else { GasPressure.coordinate_x = Convert.ToDouble(txtCoordinateX.Text); GasPressure.coordinate_y = Convert.ToDouble(txtCoordinateY.Text); GasPressure.coordinate_z = Convert.ToDouble(txtCoordinateZ.Text); GasPressure.depth = Convert.ToDouble(txtDepth.Text); GasPressure.gas_pressure_value = Convert.ToDouble(txtGasPressureValue.Text); GasPressure.measure_date_time = dtpMeasureDateTime.Value; GasPressure.tunnel = selectTunnelSimple1.selected_tunnel; GasPressure.Save(); DelGasGushQuantityPt(GasPressure.bid, GasPressure.coal_seam); DrawGasGushQuantityPt(GasPressure); } }