コード例 #1
0
ファイル: Recomendation.cs プロジェクト: hsescience/siteopros
        //method preparing default recomendations
        public static List<Recomendation> SetToDefault()
        {
            //string path = HttpContext.Current.Server.MapPath("~/v4/docs/Aldunin_dimensions_clasters.xls"­);
            string[] allStrings = File.ReadAllLines(HttpContext.Current.Server.MapPath("~/docs/default_en.txt"), Encoding.Default);
            //string[] allStrings = File.ReadAllLines(@"\\docs\\default_ru.txt", Encoding.Default);
            List<Recomendation> l = new List<Recomendation>();
            for (int i = 0; i < numberOfUIfeatures * numberOfDimensions * numberOfLevels; i += 3 * numberOfUIfeatures + 1)
            {
                int k = i;
                Recomendation s = new Recomendation(allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++]);

                l.Add(s);

                for (int j = 0; j < numberOfLevels - 1; j++)
                {
                    k++;
                    s = new Recomendation(allStrings[i],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++]);
                    l.Add(s);
                }
            }
            return l;
        }
コード例 #2
0
ファイル: Recomendation.cs プロジェクト: hsescience/siteopros
        public static List<Recomendation> SetToDefault()
        {
            string[] allStrings = File.ReadAllLines("default_ru.txt", Encoding.Default);
            List<Recomendation> l = new List<Recomendation>();
            for (int i = 0; i < numberOfUIfeatures * numberOfDimensions * numberOfLevels; i += 3 * numberOfUIfeatures + 1)
            {
                int k = i;
                Recomendation s = new Recomendation(allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++]);

                l.Add(s);

                for (int j = 0; j < numberOfLevels - 1; j++)
                {
                    k++;
                    s = new Recomendation(allStrings[i],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++],
                                                                allStrings[k++]);
                    l.Add(s);
                }
            }
            return l;
        }