Exemple #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();
                    }
                }
            }
        }
Exemple #2
0
        private void CB_shorts_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (CB_shorts.CheckedItems.Count != 1)
            {
                return;
            }

            string s = CB_shorts.CheckedItems[0].ToString();

            //SelectedItem.ToString();
            memo(s);
            int aid = util.getid(s);

            memo("aid = " + aid);
            CB_shorts.SetItemCheckState(CB_shorts.CheckedIndices[0], CheckState.Unchecked);
            CB_shorts.ClearSelected();
            ChapterSong cs = (from c in db.ChapterSong where c.Id == aid select c).FirstOrDefault();

            if (cs == null)
            {
                return;
            }

            FormDoBook fd = new FormDoBook(db, cs.BookAlbum);

            fd.Show();
        }
        private void CB_books_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (CB_books.CheckedItems.Count != 1)
            {
                return;
            }

            string s = CB_books.CheckedItems[0].ToString();
            //SelectedItem.ToString();
            //memo(s);
            int aid = util.getid(s);

            //memo("aid = " + aid);
            CB_books.SetItemCheckState(CB_books.CheckedIndices[0], CheckState.Unchecked);
            CB_books.ClearSelected();

            FormDoBook fd = new FormDoBook(db, aid);

            fd.Show();
        }