Skip to content

Commit

Permalink
Merge pull request #33 from Ordisoftware/dev
Browse files Browse the repository at this point in the history
Improve db creation
  • Loading branch information
Ordisoftware committed Sep 19, 2019
2 parents 31a877b + def487f commit 4f41009
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Project/Source/Forms/MainForm/MainForm.DB.LoadFromFiles.cs
Expand Up @@ -58,9 +58,11 @@ void nextChapter()
book = DataSet.Books.NewBooksRow();
book.ID = Guid.NewGuid().ToString();
book.Number = (int)bookid + 1;
book.Original = BooksNames.Original[bookid];
book.Hebrew = BooksNames.Hebrew[bookid];
book.Name = bookid.ToString().Replace("_", " ");
book.Translation = "";
book.Memo = "";
DataSet.Books.AddBooksRow(book);
int countChapters = 0;
int countVerses = 0;
Expand All @@ -73,9 +75,10 @@ void nextChapter()
if ( chapter != null ) nextChapter();
countVerses = 0;
chapter = DataSet.Chapters.NewChaptersRow();
chapter.Number = ++countChapters;
chapter.ID = Guid.NewGuid().ToString(); ;
chapter.ID = Guid.NewGuid().ToString();
chapter.BookID = book.ID;
chapter.Number = ++countChapters;
chapter.Memo = "";
}
else
{
Expand All @@ -87,9 +90,9 @@ void nextChapter()
{
countWords = 0;
verse = DataSet.Verses.NewVersesRow();
verse.Number = ++countVerses;
verse.ID = Guid.NewGuid().ToString();
verse.ChapterID = chapter.ID;
verse.Number = ++countVerses;
verse.Comment = "";
listWordsOriginal = list[0].Replace("-", " ").Split(' ').Reverse().ToArray();
listWordsHebrew = Letters.ConvertToHebrewFont(list[0]).Split(' ').Reverse().ToArray();
Expand All @@ -104,9 +107,9 @@ void nextChapter()
if ( listWordsHebrew[i] != "" )
{
word = DataSet.Words.NewWordsRow();
word.Number = ++countWords;
word.ID = Guid.NewGuid().ToString();
word.VerseID = verse.ID;
word.Number = ++countWords;
word.Original = new string(listWordsOriginal[i].Reverse().ToArray());
word.Hebrew = listWordsHebrew[i];
word.Translation = "";
Expand Down

0 comments on commit 4f41009

Please sign in to comment.