duheng
2024-09-15 c4d0807d911a3ee09cffaa9942638ea41cd414f6
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
namespace HStation.WinFrmUI.Assets
{
    public class CoefficientDisplayNameHelper
    {
        public CoefficientDisplayNameHelper()
        { }
 
        public string hazen { get; set; }
        public string darcy { get; set; }
        public string manning { get; set; }
 
        public static CoefficientDisplayNameHelper GetStringName(List<Vmo.PipeLineRoughnessCoefficientVmo> vmos)
        {
            var model = new CoefficientDisplayNameHelper();
            var hazenVmo = vmos.Find(x => x.eAlgorithmType == Service.Assets.eAlgorithmType.Hazen);
            if (hazenVmo != null)
            {
                if (hazenVmo.EndValue != string.Empty)
                {
                    model.hazen = string.Format("{0}~{1}", hazenVmo.StartValue, hazenVmo.EndValue);
                }
                else
                {
                    model.hazen = hazenVmo.StartValue;
                }
            }
            var darcyVmo = vmos.Find(x => x.eAlgorithmType == Service.Assets.eAlgorithmType.Darcy);
            if (darcyVmo != null)
            {
                if (darcyVmo.EndValue != string.Empty)
                {
                    model.darcy = string.Format("{0}~{1}", darcyVmo.StartValue, darcyVmo.EndValue);
                }
                else
                {
                    model.darcy = darcyVmo.StartValue;
                }
            }
            var manningVmo = vmos.Find(x => x.eAlgorithmType == Service.Assets.eAlgorithmType.Manning);
            if (manningVmo != null)
            {
                if (manningVmo.EndValue != string.Empty)
                {
                    model.manning = string.Format("{0}~{1}", manningVmo.StartValue, manningVmo.EndValue);
                }
                else
                {
                    model.manning = manningVmo.StartValue;
                }
            }
            return model;
        }
    }
}