Ejemplo n.º 1
0
        private void Generatebutton_Click(object sender, EventArgs e)
        {
            //var q = from c in db.Author where c.Id > 63000 select c;

            if (RB_byauthor.Checked)
            {
                List <Author> alist = new List <Author>();
                foreach (Author aa in (from c in db.Author orderby c.Name select c))
                {
                    bool found = false;
                    foreach (AuthorBook ab in aa.AuthorBook)
                    {
                        if ((ab.BookAlbumBookAlbum.Type == 0) != music)
                        {
                            found = true;
                            break;
                        }
                    }
                    if (found)
                    {
                        alist.Add(aa);
                    }
                }
                FormBookList fb = new FormBookList(db, alist, music, CB_count.Checked, CB_location.Checked);
                fb.Show();
            }
            else if (RB_subjectlist.Checked)
            {
                Dictionary <string, int> subjdict = new Dictionary <string, int>();
                foreach (Article aa in (from c in db.Article select c))
                {
                    string s = aa.Subj1 + "." + aa.Subj2 + "." + aa.Subj3;
                    if (!subjdict.ContainsKey(s))
                    {
                        subjdict.Add(s, 0);
                    }
                    subjdict[s]++;
                }
                foreach (string s in subjdict.Keys)
                {
                    memo(s + ": " + subjdict[s]);
                }
            }
        }
Ejemplo n.º 2
0
        private void Bookbutton_Click(object sender, EventArgs e)
        {
            List <BookAlbum> booklist = new List <BookAlbum>();

            foreach (object item in CBmysubj.CheckedItems)
            {
                string  s  = item.ToString().Split('(')[0].Trim();
                Subject cs = (from c in db.Subject where c.Name == s select c).First();
                memo(s + ": " + cs.Id);
                foreach (BookAlbum ba in (from c in db.BookAlbum where c.Subject == cs.Id select c))
                {
                    booklist.Add(ba);
                }
            }
            if (booklist.Count > 0)
            {
                FormBookList fb = new FormBookList(db, booklist);
                fb.Show();
            }
        }