Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            EditAddCharity editchar = new EditAddCharity();

            editchar.Show();
            prov = false;
        }
Exemple #2
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            index = dataGridView1.CurrentRow.Index + 1;
            if (e.ColumnIndex == 3)
            {
                EditAddCharity editchar = new EditAddCharity();
                SqlDataReader  sqlread;
                SqlCommand     select = new SqlCommand("Select CharityLogo from Charity where CharityId = '" + index + "'", sqlconn);
                sqlread = select.ExecuteReader();
                while (sqlread.Read())
                {
                    editchar.textBox2.Text = sqlread["CharityLogo"].ToString();
                }
                sqlread.Close();
                this.Hide();

                editchar.Show();
                editchar.textBox1.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString();
                editchar.textBox4.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString();
                editchar.pictureBox1.BackgroundImage = (Image)dataGridView1.CurrentRow.Cells[0].Value;
                prov = true;
            }
        }