private void bunifuCustomDataGrid4_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex > -1) { label16.Text = _book.GetShort().Rows[e.RowIndex][4].ToString(); label24.Text = _book.GetShort().Rows[e.RowIndex][0].ToString(); label28.Text = _book.GetShort().Rows[e.RowIndex][3].ToString(); label14.Text = _book.GetShort().Rows[e.RowIndex][1].ToString(); label25.Text = _book.GetShort().Rows[e.RowIndex][2].ToString(); byte[] img; if (_book.GetByName(label24.Text, "MusicBook").Rows[0][8].ToString() != "NULL") { img = (byte[])(_book.GetByName(label24.Text, "MusicBook").Rows[0][8]); if (img == null) { pictureBox19.Image = null; } else { var ms = new MemoryStream(img); pictureBox19.Image = Image.FromStream(ms); } } } xtraTabPage8.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void accordionControlElement5_Click(object sender, EventArgs e) { try { bunifuCustomDataGrid4.Columns.Clear(); _book = new MusicBook(); if (_book.GetShort().Rows.Count > 0) { bunifuCustomDataGrid4.DataSource = _phones.GetShort(); AddButton(bunifuCustomDataGrid4); label16.Text = bunifuCustomDataGrid4.Rows[0].Cells[4].Value.ToString(); label24.Text = bunifuCustomDataGrid4.Rows[0].Cells[0].Value.ToString(); label28.Text = bunifuCustomDataGrid4.Rows[0].Cells[3].Value.ToString(); label14.Text = bunifuCustomDataGrid4.Rows[0].Cells[1].Value.ToString(); label25.Text = bunifuCustomDataGrid4.Rows[0].Cells[2].Value.ToString(); byte[] img; if (_phones.GetByName(label24.Text, "MusicBook").Rows[0][8].ToString() != "NULL") { img = (byte[])(_book.GetByName(label24.Text, "MusicBook").Rows[0][8]); if (img == null) { pictureBox18.Image = null; } else { var ms = new MemoryStream(img); pictureBox18.Image = Image.FromStream(ms); } } } xtraTabPage8.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }