Exemplo n.º 1
0
        private void Titlebutton_Click(object sender, EventArgs e)
        {
            FormFindTitle fa = new FormFindTitle(db);

            DialogResult faresult = fa.ShowDialog();
            var          tid      = fa.titleid;
            var          tit      = fa.titletype;

            memo("titleid = " + tid.ToString());
            memo("titletype = " + tit.ToString());

            if (faresult == DialogResult.OK)
            {
                if (tit == 1)
                {
                    FormDoArticle faa = new FormDoArticle(db, tid);
                    faa.Show();
                }
                else if (tit == 2)
                {
                    FormDoBook fb = new FormDoBook(db, tid);
                    fb.Show();
                }
                else
                {
                    ChapterSong cs = (from c in db.ChapterSong where c.Id == tid select c).FirstOrDefault();
                    if (cs != null)
                    {
                        FormDoBook fb = new FormDoBook(db, cs.BookAlbum);
                        fb.Show();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void Bookbutton_Click(object sender, EventArgs e)
        {
            FormFindTitle fa = new FormFindTitle(db);

            DialogResult faresult = fa.ShowDialog();
            var          tid      = fa.titleid;
            var          tit      = fa.titletype;

            if (faresult == DialogResult.OK)
            {
                //if (tit == 1) //article
                //{
                //    FormDoArticle faa = new FormDoArticle(db, tid);
                //    faa.Show();
                //}
                //else
                if (tit == 2) //book
                {
                    delete_book(tid);
                }
                //else //chapter
                //{
                //    ChapterSong cs = (from c in db.ChapterSong where c.Id == tid select c).FirstOrDefault();
                //    if (cs != null)
                //    {
                //        FormDoBook fb = new FormDoBook(db, cs.BookAlbum);
                //        fb.Show();
                //    }
                //}
            }
        }