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;
|
}
|
}
|
}
|