tangxu
2024-05-06 f01d639477141399fd3e092f3f0acb3ced7e02bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
 
namespace CloudWaterNetwork.建模
{
    public partial class AddPumpForm : Form
    {
        public AddPumpForm()
        {
            InitializeComponent();
        }
 
        public string PumpName { get; set; } = "";
        public PumpType pumpType { get; set; } = PumpType.定速泵;
 
        public double 额定转速 { get; set; } = 1500;
 
        public double 额定流量 { get; set; } = 0;
 
        public double 额定扬程 { get; set; } = 0;
        public double 额定功率 { get; set; } = 0;
 
 
        private void btnAdd_Click(object sender, EventArgs e)
        {
 
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            PumpName = txtName.Text;
            pumpType = (PumpType)cmbType.SelectedItem;
            double d;
            额定转速 = double.TryParse(textBox1.Text,out d ) ? d: 0;
            额定流量 = double.TryParse(textBox2.Text, out d) ? d : 0;
            额定扬程 = double.TryParse(textBox3.Text, out d) ? d : 0;
            额定功率 = double.TryParse(textBox4.Text, out d) ? d : 0;
 
            DialogResult = DialogResult.OK;
            Close();
        }
 
        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }
 
        private void AddPumpForm_Load(object sender, EventArgs e)
        {
            textBox1.Text = 额定转速.ToString();
            textBox2.Text = 额定流量.ToString();
 
            textBox3.Text = 额定扬程.ToString();
            textBox4.Text = 额定功率.ToString();
 
            txtName.Text = PumpName;
            
 
 
            cmbType.DataSource = Enum.GetValues(typeof(PumpType));
            cmbType.SelectedItem = pumpType;
 
            
        }
 
        private void label5_Click(object sender, EventArgs e)
        {
 
        }
    }
 
}