ningshuxia
2025-03-13 25d1bf4c50f43cf6690c5ac92824959865c9d78f
WinFrmUI/PBS.WinFrmUI/01-place/00-core/BuildWizardForm.cs
@@ -16,26 +16,6 @@
        {
            bool isExist = true;
            this.dxErrorProvider1.ClearErrors();
            if (this.cbArea.Text == "请选择")
            {
                this.dxErrorProvider1.SetError(this.cbArea, "必填项");
                isExist = false;
            }
            if (this.cbCity.Text == "请选择")
            {
                this.dxErrorProvider1.SetError(this.cbCity, "必填项");
                isExist = false;
            }
            if (this.cbDist.Text == "请选择")
            {
                this.dxErrorProvider1.SetError(this.cbDist, "必填项");
                isExist = false;
            }
            if (string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                this.dxErrorProvider1.SetError(this.txtName, "必填项");
                isExist = false;
            }
            return isExist;
        }
@@ -45,7 +25,7 @@
            {
                return null;
            }
            var m = new PlaceBuildParasInfo()
            /*var m = new PlaceBuildParasInfo()
            {
                //  Address = txtAddress.Text,
                //   Area = (long?)this.cbArea.EditValue,
@@ -60,8 +40,67 @@
                PropertyType = 1,
                ProperTyYears = string.IsNullOrEmpty(txtProperTyYears.Text) ? 0 : int.Parse(txtProperTyYears.Text),
                TotalHouseHolds = string.IsNullOrEmpty(txtTotalHouseHolds.Text) ? 0 : int.Parse(txtTotalHouseHolds.Text)
            };
            };*/
            var m = new PlaceBuildParasInfo();
            // 处理 AreaSquare
            if (string.IsNullOrEmpty(txtAreaSquare.Text) || !decimal.TryParse(txtAreaSquare.Text, out decimal areaSquare))
            {
                m.AreaSquare = decimal.Zero;
            }
            else
            {
                m.AreaSquare = areaSquare;
            }
            // 处理 CompletionTime
            m.CompletionTime = txtCompletionTime.Text;
            // 处理 Developer
            m.Developer = txtDeveloper.Text;
            // 处理 GreeningRate
            if (string.IsNullOrEmpty(textGreeningRate.Text) || !decimal.TryParse(textGreeningRate.Text, out decimal greeningRate))
            {
                m.GreeningRate = decimal.Zero;
            }
            else
            {
                m.GreeningRate = greeningRate;
            }
            // 处理 PlotRatio
            if (string.IsNullOrEmpty(txtPlotRatio.Text) || !decimal.TryParse(txtPlotRatio.Text, out decimal plotRatio))
            {
                m.PlotRatio = decimal.Zero;
            }
            else
            {
                m.PlotRatio = plotRatio;
            }
            // 处理 PropertyType
            m.PropertyType = 1;
            // 处理 ProperTyYears
            if (string.IsNullOrEmpty(txtProperTyYears.Text) || !int.TryParse(txtProperTyYears.Text, out int properTyYears))
            {
                m.ProperTyYears = 0;
            }
            else
            {
                m.ProperTyYears = properTyYears;
            }
            // 处理 TotalHouseHolds
            if (string.IsNullOrEmpty(txtTotalHouseHolds.Text) || !int.TryParse(txtTotalHouseHolds.Text, out int totalHouseHolds))
            {
                m.TotalHouseHolds = 0;
            }
            else
            {
                m.TotalHouseHolds = totalHouseHolds;
            }
            return m;
        }
@@ -80,11 +119,6 @@
            //        cbArea.EditValue = model.Area;
            //       cbCity.EditValue = model.City;
            //      cbDist.EditValue = model.Dist;
        }
        public string getText()
        {
            return "a";
        }
        private void BuildWizardForm_Load(object sender, EventArgs e)