示例#1
0
        private void Btn_confirm_edit_Click(object sender, EventArgs e)
        {
            if ((txt_bookname_change.Text == "") || (txt_auther_change.Text == "") || (txt_price_change.Text == "") ||
                (txt_fineDay_change.Text == "") || (txt_location_change.Text == "") || (cmb_status_change.Text == "") ||
                (txt_search_book.Text == ""))
            {
                MessageBox.Show("Required Fields are Empty", "Empty Fields", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                Classes.Book book     = new Classes.Book();
                string       bname    = txt_bookname_change.Text;
                string       auth     = txt_auther_change.Text;
                string       genre    = cmb_se.Text;
                float        price    = (float)Convert.ToDouble(txt_price_change.Text);
                float        fine     = (float)Convert.ToDouble(txt_fineDay_change.Text);
                string       location = txt_location_change.Text;
                string       status   = cmb_status_change.Text;
                int          bid      = Convert.ToInt32(txt_search_book.Text);


                //int r = book.testAdd(bname, auth);
                int r = book.updateBook(bid, bname, auth, genre, price, fine, location, status);
                if (r != 0)
                {
                    MessageBox.Show("Book Details are Updated", "Data Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Error Updating Book", "Details are incorrect Try again", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                clear_search();
            }
        }
示例#2
0
 protected void btnSend_Click(object sender, EventArgs e)
 {
     Classes.Book b = new Classes.Book();
     b.bookId      = int.Parse(Session["bookId"].ToString());
     b.bookName    = txtBookName.Text;
     b.authorId    = int.Parse(drpAuthors.SelectedValue);
     b.bookIsbn    = txtIsbn.Text;
     b.publisherId = int.Parse(drpProducer.SelectedValue);
     b.bookIndex   = txtIndex.Text;
     b.bookNotes   = txtNotes.Text;
     if (chkIsDigitized.Checked)
     {
         b.isDigitized = 1;
     }
     else
     {
         b.isDigitized = 0;
     }
     b.updateBook();
     Response.Redirect("~/App/Book/listBooks.aspx");
 }
示例#3
0
 protected void btnSend_Click(object sender, EventArgs e)
 {
     Classes.Book b = new Classes.Book();
     b.bookId = int.Parse(Session["bookId"].ToString());
     b.bookName = txtBookName.Text;
     b.authorId = int.Parse(drpAuthors.SelectedValue);
     b.bookIsbn = txtIsbn.Text;
     b.publisherId = int.Parse(drpProducer.SelectedValue);
     b.bookIndex = txtIndex.Text;
     b.bookNotes = txtNotes.Text;
     if (chkIsDigitized.Checked)
     {
         b.isDigitized = 1;
     }
     else
     {
         b.isDigitized = 0;
     }
     b.updateBook();
     Response.Redirect("~/App/Book/listBooks.aspx");
 }