duheng
2025-03-20 1ec65a7b983a7d519c3602d20a855ac1bac1825e
WinFrmUI/PBS.WinFrmUI/01-place/00-core/BuildWizardForm.cs
@@ -1,6 +1,5 @@
using DevExpress.XtraEditors.Controls;
using PBS.Model;
using System.Data;
using PBS.Model;
using PBS.Vmo;
namespace PBS.WinFrmUI
{
@@ -19,7 +18,7 @@
            return isExist;
        }
        public PlaceBuildParasInfo GetData()
        public PlaceBuildParasInfoVmo GetData()
        {
            if (!Valid())
            {
@@ -31,21 +30,21 @@
                //   Area = (long?)this.cbArea.EditValue,
                //    City = (long?)this.cbCity.EditValue,
                //    Dist = (long?)this.cbDist.EditValue,
                AreaSquare = string.IsNullOrEmpty(txtAreaSquare.Text) ? decimal.Zero : decimal.Parse(txtAreaSquare.Text),
                AreaSquare = string.IsNullOrEmpty(txtAreaSquare.Text) ? null : double.Parse(txtAreaSquare.Text),
                CompletionTime = txtCompletionTime.Text,
                Developer = txtDeveloper.Text,
                GreeningRate = string.IsNullOrEmpty(this.textGreeningRate.Text) ? decimal.Zero : decimal.Parse(textGreeningRate.Text),
                GreeningRate = string.IsNullOrEmpty(this.textGreeningRate.Text) ? null : double.Parse(textGreeningRate.Text),
                //  Name = txtName.Text,
                PlotRatio = string.IsNullOrEmpty(txtPlotRatio.Text) ? decimal.Zero : decimal.Parse(txtPlotRatio.Text),
                PlotRatio = string.IsNullOrEmpty(txtPlotRatio.Text) ? null : double.Parse(txtPlotRatio.Text),
                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))
            var m = new PlaceBuildParasInfoVmo();
            // 处理 AreaSquare
            if (string.IsNullOrEmpty(txtAreaSquare.Text) || !double.TryParse(txtAreaSquare.Text, out double areaSquare))
            {
                m.AreaSquare = decimal.Zero;
                m.AreaSquare = null;
            }
            else
            {
@@ -59,9 +58,9 @@
            m.Developer = txtDeveloper.Text;
            // 处理 GreeningRate
            if (string.IsNullOrEmpty(textGreeningRate.Text) || !decimal.TryParse(textGreeningRate.Text, out decimal greeningRate))
            if (string.IsNullOrEmpty(textGreeningRate.Text) || !double.TryParse(textGreeningRate.Text, out double greeningRate))
            {
                m.GreeningRate = decimal.Zero;
                m.GreeningRate = null;
            }
            else
            {
@@ -69,9 +68,9 @@
            }
            // 处理 PlotRatio
            if (string.IsNullOrEmpty(txtPlotRatio.Text) || !decimal.TryParse(txtPlotRatio.Text, out decimal plotRatio))
            if (string.IsNullOrEmpty(txtPlotRatio.Text) || !double.TryParse(txtPlotRatio.Text, out double plotRatio))
            {
                m.PlotRatio = decimal.Zero;
                m.PlotRatio = null;
            }
            else
            {
@@ -103,7 +102,7 @@
            return m;
        }
        public void SetData(PlaceBuildParasInfo model)
        public void SetData(PlaceBuildParasInfoVmo model)
        {
            if (model == null) return;
            //   txtAddress.Text = model.Address;
@@ -119,6 +118,5 @@
            //       cbCity.EditValue = model.City;
            //      cbDist.EditValue = model.Dist;
        }
    }
}