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

            // 创建勘探线实体
            var prospectingLineEntity = new ProspectingLine();

            // 勘探线名称
            prospectingLineEntity.prospecting_line_name = txtProspectingLineName.Text.Trim();
            // 勘探线钻孔
            var cnt = lstProspectingBoreholeSelected.Items.Count;
            var lstProspectingBoreholePts = new List <IPoint>(); //20140505 lyf 存储选择的钻孔点要素

            for (var i = 0; i < cnt; i++)
            {
                var strDisplayName = lstProspectingBoreholeSelected.Items[i].ToString();
                if (String.IsNullOrWhiteSpace(prospectingLineEntity.prospecting_borehole))
                {
                    prospectingLineEntity.prospecting_borehole = strDisplayName;
                }
                else
                {
                    prospectingLineEntity.prospecting_borehole = prospectingLineEntity.prospecting_borehole + "," +
                                                                 strDisplayName;
                }

                IPoint pt = new PointClass();
                pt = GetProspectingBoreholePointSelected(strDisplayName);
                if (pt != null && !lstProspectingBoreholePts.Contains(pt))
                {
                    lstProspectingBoreholePts.Add(pt);
                }
            }

            var bResult = false;

            if (_bllType == "add")
            {
                // BIDID
                prospectingLineEntity.binding_id = IdGenerator.NewBindingId();

                // 勘探线信息登录
                prospectingLineEntity.Save();

                ///20140505 lyf
                ///绘制勘探线图形
                DrawProspectingLine(prospectingLineEntity, lstProspectingBoreholePts);
            }
            else
            {
                // 主键
                prospectingLineEntity.prospecting_line_id = _iPK;
                // 勘探线信息修改
                prospectingLineEntity.Save();
                //20140506 lyf
                //获取勘探线的BID
                var sBid = ProspectingLine.Find(_iPK).binding_id;
                if (sBid != "")
                {
                    prospectingLineEntity.binding_id = sBid;
                    ModifyProspectingLine(prospectingLineEntity, lstProspectingBoreholePts); //修改图元
                }
            }

            // 添加/修改成功的场合
            if (bResult)
            {
            }
        }