| | |
| | | using DevExpress.XtraEditors.Controls; |
| | | using PBS.Model; |
| | | using System.Data; |
| | | using PBS.Model; |
| | | using PBS.Vmo; |
| | | |
| | | namespace PBS.WinFrmUI |
| | | { |
| | |
| | | return isExist; |
| | | } |
| | | |
| | | public PlaceBuildParasInfo GetData() |
| | | public PlaceBuildParasInfoVmo GetData() |
| | | { |
| | | if (!Valid()) |
| | | { |
| | |
| | | // 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 |
| | | { |
| | |
| | | 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 |
| | | { |
| | |
| | | } |
| | | |
| | | // 处理 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 |
| | | { |
| | |
| | | return m; |
| | | } |
| | | |
| | | public void SetData(PlaceBuildParasInfo model) |
| | | public void SetData(PlaceBuildParasInfoVmo model) |
| | | { |
| | | if (model == null) return; |
| | | // txtAddress.Text = model.Address; |
| | |
| | | // cbCity.EditValue = model.City; |
| | | // cbDist.EditValue = model.Dist; |
| | | } |
| | | |
| | | } |
| | | } |