• MessageBox.Show("Malumot toliq emas"); } else { con.Open();
  • MessageBox.Show("Muvaffaqiyatli qoshildi"); con.Close(); populate(); } }
  • MessageBox.Show("Muvaffaqiyatli ochirildi"); con.Close(); populate(); } } private void button2_Click(object sender, EventArgs e)
  • LibPhone.Text = LibGridView1.SelectedRows[0].Cells[3].Value.ToString()




    Download 2,44 Mb.
    bet10/12
    Sana14.05.2024
    Hajmi2,44 Mb.
    #232837
    1   ...   4   5   6   7   8   9   10   11   12
    Bog'liq
    Abdulloyeva Sitora

    LibPhone.Text = LibGridView1.SelectedRows[0].Cells[3].Value.ToString();
    }


    public void populate()
    {
    con.Open();
    string query = "select* from Librarian";
    SqlDataAdapter da = new SqlDataAdapter(query, con);
    SqlCommandBuilder builder = new SqlCommandBuilder(da);
    var ds = new DataSet();
    da.Fill(ds);
    LibGridView1.DataSource = ds.Tables[0];
    con.Close();
    }
    private void button1_Click(object sender, EventArgs e)
    {

    if (LibID.Text == "" LibName.Text == "" LibPass.Text == "" LibPhone.Text == "" )
    {
    MessageBox.Show("Ma'lumot to'liq emas");
    }
    else
    {
    con.Open();
    SqlCommand cmd = new SqlCommand("insert into Librarian values(" + LibID.Text + ",'" + LibName.Text + "','" + LibPass.Text + "','" + LibPhone.Text + "')", con);
    cmd.ExecuteNonQuery();
    MessageBox.Show("Muvaffaqiyatli qo'shildi");
    con.Close();
    populate();
    }
    }

    private void label5_Click(object sender, EventArgs e)
    {

    }

    private void button3_Click(object sender, EventArgs e)
    {
    if (LibID.Text == "" )
    {
    MessageBox.Show("Ma'lumot to'liq emas");
    }
    else
    {
    con.Open();
    string query = "Delete from Librarian where LibID=" + LibID.Text + ";";
    SqlCommand cmd = new SqlCommand(query, con);
    cmd.ExecuteNonQuery();
    MessageBox.Show("Muvaffaqiyatli o'chirildi");
    con.Close();
    populate();
    }
    }
    private void button2_Click(object sender, EventArgs e)
    {


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




    Download 2,44 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    LibPhone.Text = LibGridView1.SelectedRows[0].Cells[3].Value.ToString()

    Download 2,44 Mb.