コード例 #1
0
        /// <summary>
        ///     带参数的构造方法
        /// </summary>
        /// <param name="borehole"></param>
        public BoreholeInfoEntering(Borehole borehole)
        {
            InitializeComponent();

            // 设置窗体默认属性
            FormDefaultPropertiesSetter.SetEnteringFormDefaultProperties(this, Const_GM.UPDATE_BOREHOLE_INFO);
            using (new SessionScope())
            {
                borehole = Borehole.Find(borehole.BoreholeId);
                // 孔号
                txtBoreholeNumber.Text = borehole.BoreholeNumber;
                // 地面标高
                txtGroundElevation.Text = borehole.GroundElevation.ToString(CultureInfo.InvariantCulture);
                // X坐标
                txtCoordinateX.Text = borehole.CoordinateX.ToString(CultureInfo.InvariantCulture);
                // Y坐标
                txtCoordinateY.Text = borehole.CoordinateY.ToString(CultureInfo.InvariantCulture);
                // Z坐标
                txtCoordinateZ.Text = borehole.CoordinateZ.ToString(CultureInfo.InvariantCulture);

                // 获取岩性信息

                DataBindUtil.LoadLithology(LITHOLOGY);

                // 明细


                gvCoalSeamsTexture.RowCount = borehole.BoreholeLithologys.Count + 1;
                for (var i = 0; i < borehole.BoreholeLithologys.Count; i++)
                {
                    // 岩性名称
                    var iLithologyId = borehole.BoreholeLithologys[i].Lithology.LithologyId;

                    var lithology = Lithology.Find(iLithologyId);

                    gvCoalSeamsTexture[0, i].Value = lithology.LithologyName;
                    // 底板标高
                    gvCoalSeamsTexture[1, i].Value = borehole.BoreholeLithologys[i].FloorElevation;
                    // 厚度
                    gvCoalSeamsTexture[2, i].Value = borehole.BoreholeLithologys[i].Thickness;
                    // 煤层名称
                    gvCoalSeamsTexture[3, i].Value = borehole.BoreholeLithologys[i].CoalSeamsName;

                    // 坐标X
                    gvCoalSeamsTexture[4, i].Value =
                        borehole.BoreholeLithologys[i].CoordinateX.ToString(CultureInfo.InvariantCulture);

                    // 坐标Y
                    gvCoalSeamsTexture[5, i].Value =
                        borehole.BoreholeLithologys[i].CoordinateY.ToString(CultureInfo.InvariantCulture);

                    // 坐标Z
                    gvCoalSeamsTexture[6, i].Value =
                        borehole.BoreholeLithologys[i].CoordinateX.ToString(CultureInfo.InvariantCulture);
                }
            }
        }
コード例 #2
0
        /// <summary>
        ///     带参数的构造方法
        /// </summary>
        /// <params name="borehole"></params>
        public BoreholeInfoEntering(Borehole borehole)
        {
            InitializeComponent();
            using (new SessionScope())
            {
                borehole = Borehole.Find(borehole.id);
                // 孔号
                txtBoreholeNumber.Text = borehole.name;
                // 地面标高
                txtGroundElevation.Text = borehole.ground_elevation.ToString(CultureInfo.InvariantCulture);
                // X坐标
                txtCoordinateX.Text = borehole.coordinate_x.ToString(CultureInfo.InvariantCulture);
                // Y坐标
                txtCoordinateY.Text = borehole.coordinate_y.ToString(CultureInfo.InvariantCulture);
                // Z坐标
                txtCoordinateZ.Text = borehole.coordinate_z.ToString(CultureInfo.InvariantCulture);

                // 获取岩性信息


                // 明细
                gvCoalSeamsTexture.RowCount = borehole.sub_boreholes.Count + 1;
                for (var i = 0; i < borehole.sub_boreholes.Count; i++)
                {
                    gvCoalSeamsTexture[0, i].Value = LITHOLOGY.Selected;
                    // 底板标高
                    gvCoalSeamsTexture[1, i].Value = borehole.sub_boreholes[i].floor_elevation;
                    // 厚度
                    gvCoalSeamsTexture[2, i].Value = borehole.sub_boreholes[i].thickness;
                    // 煤层名称
                    gvCoalSeamsTexture[3, i].Value = borehole.sub_boreholes[i].coal_seam;

                    // 坐标X
                    gvCoalSeamsTexture[4, i].Value =
                        borehole.sub_boreholes[i].coordinate_x.ToString(CultureInfo.InvariantCulture);

                    // 坐标Y
                    gvCoalSeamsTexture[5, i].Value =
                        borehole.sub_boreholes[i].coordinate_y.ToString(CultureInfo.InvariantCulture);

                    // 坐标Z
                    gvCoalSeamsTexture[6, i].Value =
                        borehole.sub_boreholes[i].coordinate_x.ToString(CultureInfo.InvariantCulture);
                }
            }
        }