public static Dictionary <int, List <ActiveConditionInfo> > LoadActiveConditionDb() { Dictionary <int, List <ActiveConditionInfo> > dictionary = new Dictionary <int, List <ActiveConditionInfo> >(); using (ProduceBussiness produceBussiness = new ProduceBussiness()) { ActiveConditionInfo[] allActiveConditionInfo = produceBussiness.GetAllActiveConditionInfo(); ActiveConditionInfo[] array = allActiveConditionInfo; for (int i = 0; i < array.Length; i++) { ActiveConditionInfo activeConditionInfo = array[i]; List <ActiveConditionInfo> list = new List <ActiveConditionInfo>(); if (!dictionary.ContainsKey(activeConditionInfo.ActiveID)) { list.Add(activeConditionInfo); dictionary.Add(activeConditionInfo.ActiveID, list); } else { dictionary[activeConditionInfo.ActiveID].Add(activeConditionInfo); } } } return(dictionary); }
public static Dictionary <int, List <ActiveConditionInfo> > LoadActiveConditionDb() { Dictionary <int, List <ActiveConditionInfo> > list = new Dictionary <int, List <ActiveConditionInfo> >(); using (ProduceBussiness db = new ProduceBussiness()) { ActiveConditionInfo[] infos = db.GetAllActiveConditionInfo(); ActiveConditionInfo[] array = infos; for (int i = 0; i < array.Length; i++) { ActiveConditionInfo info = array[i]; List <ActiveConditionInfo> temp = new List <ActiveConditionInfo>(); if (!list.ContainsKey(info.ActiveID)) { temp.Add(info); list.Add(info.ActiveID, temp); } else { list[info.ActiveID].Add(info); } } } return(list); }
public static Dictionary <int, List <ActiveConditionInfo> > LoadActiveConditionDb() { Dictionary <int, List <ActiveConditionInfo> > dictionary = new Dictionary <int, List <ActiveConditionInfo> >(); using (ProduceBussiness produceBussiness = new ProduceBussiness()) { foreach (ActiveConditionInfo activeConditionInfo in produceBussiness.GetAllActiveConditionInfo()) { List <ActiveConditionInfo> list = new List <ActiveConditionInfo>(); if (!dictionary.ContainsKey(activeConditionInfo.ActiveID)) { list.Add(activeConditionInfo); dictionary.Add(activeConditionInfo.ActiveID, list); } else { dictionary[activeConditionInfo.ActiveID].Add(activeConditionInfo); } } } return(dictionary); }