Ejemplo n.º 1
0
    /// <summary>
    /// Loads the story data.
    /// </summary>
    public void LoadStoryData()
    {
        string fileName = ShelfManager.selectedBook.ToLower() + ".json";

        pageNumber = 0;
        TextAsset charDataFile = ShelfManager.bundleLoaded.LoadAsset(fileName) as TextAsset;        // load the book specific json file

        if (charDataFile != null)
        {
            string json = charDataFile.ToString();
            storyBookJson = JsonUtility.FromJson <StoryBookJson>(json);           // serializing the the json into specific c# class
            noOfPages     = storyBookJson.pages.Length;

            //sending data directly to firebase using "72 hours rule"! (removed local data storage)
            //dataCollector.AddNewBook (storyBookJson.id.ToString());

            FirebaseHelper.AddBook(storyBookJson.id);
            left.SetActive(false);
            right.SetActive(true);
            LoadCompletePage();
        }
    }
Ejemplo n.º 2
0
        // Adding The Book To The Online Database
        private async void button4_Click(object sender, EventArgs e)
        {
            await firebasehelper.AddBook(title.Text, author.Text, desc.Text, isbn.Text, (int)numericUpDown1.Value, "");

            MessageBox.Show("Book Added", "The Book Has Beed Added to The Database", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Ejemplo n.º 3
0
 private async void Button_Clicked(object sender, EventArgs e)
 {
     await firebaseHelper.AddBook(Convert.ToInt32(1), Title.Text, Author.Text, Desc.Text, "10931809318", 1, "Random");
 }