예제 #1
0
        private void dgv_konyvek_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            connectionString.Open();
            var result = new SqlCommand("select * from konyv inner join szerzo on konyv.szerzoId = szerzo.Id where konyv.id = " + int.Parse(dgv_konyvek.Rows[e.RowIndex].Cells[0].Value.ToString()) + "; ", connectionString).ExecuteReader();

            result.Read();
            var konyv = new KonyvModel()
            {
                Id       = result.GetInt32(0),
                Cim      = result.GetString(1),
                SzerzoId = result.GetInt32(2),
                Helyezes = result.GetInt32(3)
            };

            connectionString.Close();
            result.Close();

            var frm = new FrmKonyv(connectionString, false, konyv);

            frm.ShowDialog();
        }
예제 #2
0
        private void ujKonyvToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var frm = new FrmKonyv(connectionString, true, null);

            frm.ShowDialog();
        }