Beispiel #1
0
 public Service.ParamType GetParamTypeByTitle(string title)
 {
     foreach (Service.ParamType paramType in ParamsTypes)
     {
         if (paramType.Title == title)
         {
             return(paramType);
         }
     }
     Service.ParamType pt = new Service.ParamType {
         Title = title
     };
     paramsTypes.Add(pt);
     return(pt);
 }
Beispiel #2
0
 public Service.ParamUnit GetUnitByTitle(Service.ParamType paramType, string title)
 {
     foreach (Service.ParamType type in ParamsTypes)
     {
         if (type.Title == paramType.Title)
         {
             foreach (Service.ParamUnit unit in type.ListUnits)
             {
                 if (unit.Title == title)
                 {
                     return(unit);
                 }
             }
         }
     }
     Service.ParamUnit pu = new Service.ParamUnit {
         Title = title
     };
     paramType.ListUnits.Add(pu);
     return(pu);
 }