예제 #1
0
        private static bool LoadModels(string fileName)
        {
            List <string> models = null;

            try
            {
                models = new List <string>();
                string[] lines = System.IO.File.ReadAllLines(fileName);
                int      i     = 0;
                while (i <= lines.Length)
                {
                    HaikuModel model = new HaikuModel();
                    model.FirstVerseModel  = lines[i];
                    model.SecondVerseModel = lines[i + 1];
                    model.ThirdVerseModel  = lines[i + 2];

                    HaikuDBAccess.SaveHaikuModel(model);
                    i += 4;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(false);
            }
            return(true);
        }