Exemple #1
0
        public void ReadEnumeration(EnumModel model)
        {
            if (string.IsNullOrWhiteSpace(model.SqlSelect))
            {
                throw new ArgumentException("SQL is blank.");
            }

            Dictionary <int, string> source = null;
            string sql = model.SqlSelect;

            if (sql.Contains("T_Simple"))
            {
                source = T_Simple;
            }
            else if (sql.Contains("T_AwayType"))
            {
                source = T_AwayType;
            }
            else if (sql.Contains("T_MeetingType"))
            {
                source = T_MeetingType;
            }
            else if (sql.Contains("T_AwaySystem"))
            {
                source = T_AwaySystem;
            }
            else if (sql.Contains("T_Location"))
            {
                source = T_Location;
            }

            foreach (var entry in source)
            {
                model.FillFromDb(entry.Key, entry.Value);
            }
        }