Esempio n. 1
0
 public FrmKonyv(SqlConnection connectionString, bool rogzit, KonyvModel konyv)
 {
     InitializeComponent();
     _connectionString = connectionString;
     this.rogzit       = rogzit;
     this.konyv        = konyv;
 }
Esempio n. 2
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();
        }