| | |
| | | _vmo.Description = this.txtDescription.Text.Trim(); |
| | | _vmo.Material = this.txtMaterial.Text.Trim(); |
| | | _vmo.Hazen = double.Parse(this.TextEditHazenValue.EditValue?.ToString()); |
| | | _vmo.Manning = double.Parse(this.TextEditManningValue.EditValue?.ToString()); |
| | | _vmo.Darcy = double.Parse(this.TextEditDarcyValue.EditValue?.ToString()); |
| | | var id = await BLLFactory<HStation.BLL.AssetsPipeMain>.Instance.Insert(_vmo); |
| | | if (id < 1) |
| | | { |
| | |
| | | var allFactorList = await GetAllFactorList(); |
| | | if (allFactorList != null && allFactorList.Count > 0) |
| | | { |
| | | var name = this.txtName.Text.Trim(); |
| | | var material = this.txtMaterial.Text.Trim(); |
| | | double? caliber = this.txtCaliber.EditValue == null ? null : double.Parse(this.txtCaliber.EditValue.ToString()); |
| | | var factorList = allFactorList.ToList(); |
| | | if (!string.IsNullOrEmpty(name)) |
| | | if (!string.IsNullOrEmpty(material)) |
| | | { |
| | | factorList = factorList.Where(x => !string.IsNullOrEmpty(x.Name) && x.Name.Contains(name)).ToList(); |
| | | factorList = factorList.Where(x => !string.IsNullOrEmpty(x.Material) && x.Material.Contains(material)).ToList(); |
| | | } |
| | | if (caliber.HasValue) |
| | | { |
| | | factorList = factorList.Where(x => x.Caliber.HasValue && x.Caliber.Value == caliber.Value).ToList(); |
| | | } |
| | | var factor = factorList.FirstOrDefault(); |
| | | if (factor != null) |