예제 #1
0
        public Settings(string s, CMSDataContext Db, int OrgId)
            : this()
        {
            this.Db    = Db;
            this.OrgId = OrgId;
            org        = Db.LoadOrganizationById(OrgId);
            var parser = new Parser(s);

            while (parser.NextSection())
            {
                ParseSection(parser);
            }
            SetUniqueIds("AskDropdown");
            SetUniqueIds("AskExtraQuestions");
            SetUniqueIds("AskCheckboxes");
            SetUniqueIds("AskText");
            SetUniqueIds("AskMenu");
            var sglist = new List <string>();

            AskItems.ForEach(a => sglist.AddRange(a.SmallGroups()));
            var q = sglist.GroupBy(mi => mi).Where(g => g.Count() > 1).Select(g => g.Key).ToList();

            if (q.Any())
            {
                throw parser.GetException("Duplicate SmallGroup: " + string.Join(",", q));
            }

            parser.data = null;
        }
예제 #2
0
파일: Settings.cs 프로젝트: rossspoon/bvcms
        public Settings(string s, CMSDataContext Db, int OrgId)
            : this()
        {
            this.Db = Db;
            this.OrgId = OrgId;
            org = Db.LoadOrganizationById(OrgId);
            var parser = new Parser(s);

            while (parser.NextSection())
                ParseSection(parser);
            SetUniqueIds("AskDropdown");
            SetUniqueIds("AskExtraQuestions");
            SetUniqueIds("AskCheckboxes");
            SetUniqueIds("AskMenu");
            var sglist = new List<string>();
            AskItems.ForEach(a => sglist.AddRange(a.SmallGroups()));
            var q = sglist.GroupBy(mi => mi).Where(g => g.Count() > 1).Select(g => g.Key).ToList();
            if (q.Any())
                throw parser.GetException("Duplicate SmallGroup: " + string.Join(",", q));

            parser.data = null;
        }