|
Kutubxonani avtomatlashtirish tarixi 9
|
bet | 8/12 | Sana | 14.05.2024 | Hajmi | 2,44 Mb. | | #232837 |
Bog'liq Abdulloyeva Sitora}
else
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into Bookdb values(" + BookName.Text + ",'"+ BAuthor.Text + "','" + BPublisher.Text + "','" + BPrice.Text + "','" + BQuality.Text + "')", con);
cmd.ExecuteNonQuery();
MessageBox.Show("Muvaffaqiyatli qo'shildi");
con.Close();
populate();
}
}
private void button2_Click(object sender, EventArgs e)
{
if (BookName.Text == "" BAuthor.Text == "" BPublisher.Text == "" BPrice.Text == "" BQuality.Text == "")
{
MessageBox.Show("Muvaffaqiyatli qo'shildi");
}
else
{
con.Open();
string query = "Update from Bookdb set BookName=" + BookName.Text + "',BAuthor='" + BAuthor.Text + "',BPublisher='" + BPublisher.Text + ",BPrice'" + BPrice.Text + ",BQuality'" + BQuality.Text + "''";
SqlCommand cmd = new SqlCommand(query, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Muvaffaqiyatli qo'shildi");
con.Close();
populate();
}
}
private void button3_Click(object sender, EventArgs e)
{
if (BookName.Text == "")
{
MessageBox.Show("Id ni kiriting");
}
else
{
con.Open();
string query = "Delete from Bookdb where BBookName=" + BookName.Text + ";";
SqlCommand cmd = new SqlCommand(query, con);
cmd.ExecuteNonQuery();
MessageBox.Show("Muvaffaqiyatli o'chirildi");
con.Close();
populate();
}
}
private void button4_Click(object sender, EventArgs e)
{
this.Hide();
MAINFORM main = new MAINFORM();
main.Show();
|
| |