using System; using System.Collections.Generic; using System.Linq; using Weee.Models.Paramemter; namespace Weee.DAL { public class NonYearlyParameterBuilder : ParameterBuilder { private NonYearlyParameterCategory _category { get; set; } private List _types { get; set; } private List _parameters { get; set; } public NonYearlyParameterBuilder(Categories cate) { _category = new NonYearlyParameterCategory() { Category = cate }; } public NonYearlyParameterBuilder BuildTypes(List TwNames, List CNNames, List ENNames) { if (_types == null) _types = new List(); var Names = CunstructMultiNames(TwNames, CNNames, ENNames); foreach (var Name in Names) { var newtype = new NonYearlyParameterType() { Category = _category, DisplayNameTW = Name.TWName, DisplayNameCN = Name.CNName, DisplayNameEN = Name.ENName }; _types.Add(newtype); } _category.Types = _types; return this; } public NonYearlyParameterBuilder BuildParameters(List ToBeBuilded) { if (_types == null || _types.Count() == 0) throw new Exception("The Type Is Empty , please build Type first"); if (_parameters == null) _parameters = new List(); for (int i = 0; i < _types.Count; i++) { var created= new NonYearlyParameter() { Value = i