Exemple #1
0
        public static void ReadSolutionSetting()
        {
            customSolutionSettingList_ = new List <SolutionSetting>();
            DataTable dt = DB.Global().Select("Select * From solution_setting Order by solution, strategy");

            foreach (DataRow row in dt.Rows)
            {
                var setting = (from item in customSolutionSettingList_
                               where item.name_ == row["solution"].ToString()
                               select item).FirstOrDefault();

                if (setting == null)
                {
                    setting       = new SolutionSetting();
                    setting.name_ = row["solution"].ToString();
                    customSolutionSettingList_.Add(setting);
                }

                IStrategy strategy = grp_.strategy(row["strategy"].ToString());
                if (strategy == null)
                {
                    continue;
                }
                setting.straList_.Add(strategy);
            }
        }
Exemple #2
0
        public static void InstallAutoSolutionSetting()
        {
            autoSolutionSettingList_ = new List <SolutionSetting>();
            SolutionSetting allSolution = new SolutionSetting();

            allSolution.name_ = "$All";
            foreach (var stra in grp_.strategyList_)
            {
                SolutionSetting setting = new SolutionSetting();
                setting.name_ = "$" + stra.name();
                setting.straList_.Add(stra);
                autoSolutionSettingList_.Add(setting);
                allSolution.straList_.Add(stra);
            }
            autoSolutionSettingList_.Add(allSolution);
        }