Example #1
0
        private void Frm_Edit_Book_Load(object sender, EventArgs e)
        {
            BL_Frm_Edit_Book M = new BL_Frm_Edit_Book();

            for (int i = 0; i < M.Select().Rows.Count; i++)
            {
                cbSubject.Items.Add(M.Select().Rows[i][1].ToString());
                if (CaseBook == cbSubject.Items[i].ToString())
                {
                    cbSubject.SelectedIndex = i;
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            BL_Frm_Edit_Book M = new BL_Frm_Edit_Book();

            M.ISBN       = textBox1.Text;
            M.Title      = textBox2.Text;
            M.Subject    = comboBox1.SelectedIndex + 1;
            M.wirter     = textBox3.Text;
            M.publishers = textBox4.Text;
            M.Year_Date  = textBox5.Text;
            M.NumPage    = Convert.ToInt16(textBox6.Text);
            M.Price      = Convert.ToInt16(textBox7.Text);
            M.Update();
            this.Close();
        }
Example #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            BL_Frm_Edit_Book M = new BL_Frm_Edit_Book();

            M.ISBN      = txtISBN.Text;
            M.Title     = txtTitle.Text;
            M.Subject   = cbSubject.SelectedIndex + 1;
            M.Writer    = txtAuthor.Text;
            M.publisher = txtPublisher.Text;
            M.Year_Date = txtYear.Text;
            M.NumPage   = Convert.ToInt16(txtNbPages.Text);
            M.Price     = Convert.ToInt32(txtPrice.Text);
            M.Update();
            this.Close();
        }