/// <summary>
        ///     提  交
        /// </summary>
        /// <params name="sender"></params>
        /// <params name="e"></params>
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;

            // 创建井筒实体
            var pitshaftEntity = new Pitshaft { pitshaft_name = txtPitshaftName.Text.Trim() };
            // 井口标高
            double dWellheadElevation = 0;
            if (double.TryParse(txtWellheadElevation.Text.Trim(), out dWellheadElevation))
            {
                pitshaftEntity.wellhead_elevation = dWellheadElevation;
            }
            // 井底标高
            double dWellbottomElevation = 0;
            if (double.TryParse(txtWellbottomElevation.Text.Trim(), out dWellbottomElevation))
            {
                pitshaftEntity.wellbottom_elevation = dWellbottomElevation;
            }
            // 井筒坐标X
            double dPitshaftCoordinateX = 0;
            if (double.TryParse(txtPitshaftCoordinateX.Text.Trim(), out dPitshaftCoordinateX))
            {
                pitshaftEntity.pitshaft_coordinate_x = Math.Round(dPitshaftCoordinateX, 3);
            }
            // 井筒坐标Y
            double dPitshaftCoordinateY = 0;
            if (double.TryParse(txtPitshaftCoordinateY.Text.Trim(), out dPitshaftCoordinateY))
            {
                pitshaftEntity.pitshaft_coordinate_y = Math.Round(dPitshaftCoordinateY, 3);
            }
            // 图形坐标X
            double dFigureCoordinateX = 0;
            if (double.TryParse(txtFigureCoordinateX.Text.Trim(), out dFigureCoordinateX))
            {
                pitshaftEntity.figure_coordinate_x = Math.Round(dFigureCoordinateX, 3);
            }
            // 图形坐标Y
            double dFigureCoordinateY = 0;
            if (double.TryParse(txtFigureCoordinateY.Text.Trim(), out dFigureCoordinateY))
            {
                pitshaftEntity.figure_coordinate_y = Math.Round(dFigureCoordinateY, 3);
            }
            // 图形坐标Z
            double dFigureCoordinateZ = 0;
            if (double.TryParse(txtFigureCoordinateZ.Text.Trim(), out dFigureCoordinateZ))
            {
                pitshaftEntity.figure_coordinate_z = dFigureCoordinateZ;
            }

            var bResult = false;
            if (_bllType == "add")
            {
                // BID
                pitshaftEntity.bid = IdGenerator.NewBindingId();
                pitshaftEntity.Save();

                DrawJingTong(pitshaftEntity);
            }
            else
            {
                // 主键
                pitshaftEntity.id = _iPk;
                // 井筒信息修改
                pitshaftEntity.Save();

                //20140428 lyf
                //获取井筒BID,为后面修改绘制井筒赋值所用
                var sBID = "";
                sBID = Pitshaft.Find(_iPk).bid;
                pitshaftEntity.bid = sBID;
                //修改图元
                ModifyJingTong(pitshaftEntity);
            }

            // 添加/修改成功的场合
            Close();
        }
Ejemplo n.º 2
0
        /// <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;

            // 创建井筒实体
            var pitshaftEntity = new Pitshaft {
                PitshaftName = txtPitshaftName.Text.Trim()
            };
            // 井筒名称
            // 井筒类型
            var iPitshaftTypeId = 0;

            if (int.TryParse(Convert.ToString(cobPitshaftType.SelectedValue), out iPitshaftTypeId))
            {
                pitshaftEntity.PitshaftType.PitshaftTypeId = iPitshaftTypeId;
            }
            // 井口标高
            double dWellheadElevation = 0;

            if (double.TryParse(txtWellheadElevation.Text.Trim(), out dWellheadElevation))
            {
                pitshaftEntity.WellheadElevation = dWellheadElevation;
            }
            // 井底标高
            double dWellbottomElevation = 0;

            if (double.TryParse(txtWellbottomElevation.Text.Trim(), out dWellbottomElevation))
            {
                pitshaftEntity.WellbottomElevation = dWellbottomElevation;
            }
            // 井筒坐标X
            double dPitshaftCoordinateX = 0;

            if (double.TryParse(txtPitshaftCoordinateX.Text.Trim(), out dPitshaftCoordinateX))
            {
                pitshaftEntity.PitshaftCoordinateX = Math.Round(dPitshaftCoordinateX, 3);
            }
            // 井筒坐标Y
            double dPitshaftCoordinateY = 0;

            if (double.TryParse(txtPitshaftCoordinateY.Text.Trim(), out dPitshaftCoordinateY))
            {
                pitshaftEntity.PitshaftCoordinateY = Math.Round(dPitshaftCoordinateY, 3);
            }
            // 图形坐标X
            double dFigureCoordinateX = 0;

            if (double.TryParse(txtFigureCoordinateX.Text.Trim(), out dFigureCoordinateX))
            {
                pitshaftEntity.FigureCoordinateX = Math.Round(dFigureCoordinateX, 3);
            }
            // 图形坐标Y
            double dFigureCoordinateY = 0;

            if (double.TryParse(txtFigureCoordinateY.Text.Trim(), out dFigureCoordinateY))
            {
                pitshaftEntity.FigureCoordinateY = Math.Round(dFigureCoordinateY, 3);
            }
            // 图形坐标Z
            double dFigureCoordinateZ = 0;

            if (double.TryParse(txtFigureCoordinateZ.Text.Trim(), out dFigureCoordinateZ))
            {
                pitshaftEntity.FigureCoordinateZ = dFigureCoordinateZ;
            }

            var bResult = false;

            if (_bllType == "add")
            {
                // BID
                pitshaftEntity.BindingId = IDGenerator.NewBindingID();
                pitshaftEntity.Save();

                DrawJingTong(pitshaftEntity);
            }
            else
            {
                // 主键
                pitshaftEntity.PitshaftId = _iPk;
                // 井筒信息修改
                pitshaftEntity.Save();


                //20140428 lyf
                //获取井筒BID,为后面修改绘制井筒赋值所用
                var sBID = "";
                sBID = Pitshaft.Find(_iPk).BindingId;
                pitshaftEntity.BindingId = sBID;
                //修改图元
                ModifyJingTong(pitshaftEntity);
            }

            // 添加/修改成功的场合
            Close();
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     提  交
        /// </summary>
        /// <params name="sender"></params>
        /// <params name="e"></params>
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;

            // 创建井筒实体
            var pitshaftEntity = new Pitshaft {
                pitshaft_name = txtPitshaftName.Text.Trim()
            };
            // 井口标高
            double dWellheadElevation = 0;

            if (double.TryParse(txtWellheadElevation.Text.Trim(), out dWellheadElevation))
            {
                pitshaftEntity.wellhead_elevation = dWellheadElevation;
            }
            // 井底标高
            double dWellbottomElevation = 0;

            if (double.TryParse(txtWellbottomElevation.Text.Trim(), out dWellbottomElevation))
            {
                pitshaftEntity.wellbottom_elevation = dWellbottomElevation;
            }
            // 井筒坐标X
            double dPitshaftCoordinateX = 0;

            if (double.TryParse(txtPitshaftCoordinateX.Text.Trim(), out dPitshaftCoordinateX))
            {
                pitshaftEntity.pitshaft_coordinate_x = Math.Round(dPitshaftCoordinateX, 3);
            }
            // 井筒坐标Y
            double dPitshaftCoordinateY = 0;

            if (double.TryParse(txtPitshaftCoordinateY.Text.Trim(), out dPitshaftCoordinateY))
            {
                pitshaftEntity.pitshaft_coordinate_y = Math.Round(dPitshaftCoordinateY, 3);
            }
            // 图形坐标X
            double dFigureCoordinateX = 0;

            if (double.TryParse(txtFigureCoordinateX.Text.Trim(), out dFigureCoordinateX))
            {
                pitshaftEntity.figure_coordinate_x = Math.Round(dFigureCoordinateX, 3);
            }
            // 图形坐标Y
            double dFigureCoordinateY = 0;

            if (double.TryParse(txtFigureCoordinateY.Text.Trim(), out dFigureCoordinateY))
            {
                pitshaftEntity.figure_coordinate_y = Math.Round(dFigureCoordinateY, 3);
            }
            // 图形坐标Z
            double dFigureCoordinateZ = 0;

            if (double.TryParse(txtFigureCoordinateZ.Text.Trim(), out dFigureCoordinateZ))
            {
                pitshaftEntity.figure_coordinate_z = dFigureCoordinateZ;
            }

            var bResult = false;

            if (_bllType == "add")
            {
                // BID
                pitshaftEntity.bid = IdGenerator.NewBindingId();
                pitshaftEntity.Save();

                DrawJingTong(pitshaftEntity);
            }
            else
            {
                // 主键
                pitshaftEntity.id = _iPk;
                // 井筒信息修改
                pitshaftEntity.Save();


                //20140428 lyf
                //获取井筒BID,为后面修改绘制井筒赋值所用
                var sBID = "";
                sBID = Pitshaft.Find(_iPk).bid;
                pitshaftEntity.bid = sBID;
                //修改图元
                ModifyJingTong(pitshaftEntity);
            }

            // 添加/修改成功的场合
            Close();
        }