Пример #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();
                    }
                }
            }
        }
Пример #2
0
        private void CB_articles_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (CB_articles.CheckedItems.Count != 1)
            {
                return;
            }

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

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

            memo("aid = " + aid);
            CB_articles.ClearSelected();

            FormDoArticle fd = new FormDoArticle(db, aid);

            fd.Show();
        }