public static ContModelInfo GetModelByName(string strModelName) { List <ContModelInfo> list = (List <ContModelInfo>)ContModel.GetCacheModelList(); ContModelInfo result; if (list != null && list.Count > 0) { result = (from p in list where p.ModelName == strModelName select p).FirstOrDefault <ContModelInfo>(); } else { result = null; } return(result); }
public static IList <ContModelInfo> GetCacheUsingModelList() { IList <ContModelInfo> cacheModelList = ContModel.GetCacheModelList(); IList <ContModelInfo> list = new List <ContModelInfo>(); if (cacheModelList != null && cacheModelList.Count > 0) { foreach (ContModelInfo current in cacheModelList) { if (current.IsUsing) { list.Add(current); } } } return(list); }
public static ContModelInfo GetCacheModelByID(int modelID) { ContModelInfo result = null; IList <ContModelInfo> cacheModelList = ContModel.GetCacheModelList(); if (cacheModelList != null && cacheModelList.Count > 0) { foreach (ContModelInfo current in cacheModelList) { if (current.AutoID == modelID) { result = current; break; } } } return(result); }