示例#1
0
        public FormNewShorts(Librarydb dbpar, FormNewBook parentpar, string mainauthorpar)
        {
            InitializeComponent();
            db         = dbpar;
            parent     = parentpar;
            mainauthor = mainauthorpar;
            var q = from c in db.Author select c.Name;
            AutoCompleteStringCollection acs = new AutoCompleteStringCollection();

            foreach (string s in q)
            {
                acs.Add(s);
            }
            TB_author.AutoCompleteCustomSource = acs;
            TB_author.Text = mainauthor;
            ics            = (from c in db.ChapterSong select c.Id).Max() + 1;
            if (parent.shortslist.Count > 0)
            {
                int ics2 = (from c in parent.shortslist select c.Id).Max() + 1;
                ics = Math.Max(ics, ics2);
            }
            iac = (from c in db.AuthorChapter select c.Id).Max() + 1;
            if (parent.shortsauthorlist.Count > 0)
            {
                int iac2 = (from c in parent.shortsauthorlist select c.Id).Max() + 1;
                iac = Math.Max(iac, iac2);
            }
        }
示例#2
0
        private void Bookbutton_Click(object sender, EventArgs e)
        {
            FormFindAuthor fa = new FormFindAuthor(db);

            DialogResult faresult = fa.ShowDialog();
            var          auid     = fa.authorid;

            //memo("authorid = " + auid.ToString());

            if ((faresult == DialogResult.OK) && (auid >= 0))
            {
                FormNewBook fd = new FormNewBook(db, auid, null);
                fd.Show();
            }
        }
示例#3
0
        private void OKbutton_Click(object sender, EventArgs e)
        {
            if (savebook())
            {
                saveshorts();
                //Shorts:

                if (CB_another.Checked)
                {
                    FormNewBook fd = new FormNewBook(db, auid, null);
                    fd.Show();
                }

                this.Close();
            }
        }
示例#4
0
        private void button1_Click(object sender, EventArgs e)
        {
            FormNewBook fd = new FormNewBook(db, -1, bb);

            fd.Show();
        }