Kutubxonani avtomatlashtirish tarixi 9




Download 2,44 Mb.
bet8/12
Sana14.05.2024
Hajmi2,44 Mb.
#232837
1   ...   4   5   6   7   8   9   10   11   12
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();

Download 2,44 Mb.
1   ...   4   5   6   7   8   9   10   11   12




Download 2,44 Mb.

Bosh sahifa
Aloqalar

    Bosh sahifa



Kutubxonani avtomatlashtirish tarixi 9

Download 2,44 Mb.