private void dataGridView2_CellDoubleClick_1(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.ColumnIndex == 3)
         {
             string cellValue = dataGridView2.Rows[e.RowIndex].Cells[3].Value.ToString();
             cn.Open();
             SQLiteCommand    kmt = new SQLiteCommand("Select id from Kullanici where Ad='" + cellValue + "'", cn);
             SQLiteDataReader dr  = kmt.ExecuteReader(); dr.Read();
             int id = Convert.ToInt16(dr["id"]);
             cn.Close();
             Musteridetay m = new Musteridetay();
             m.id   = id; m.id2 = 1;
             m.frm1 = this;
             m.ShowDialog();
         }
         else if (e.ColumnIndex == 2)
         {
             string cellValue = dataGridView2.Rows[e.RowIndex].Cells[2].Value.ToString();
             cn.Open();
             SQLiteCommand    kmt = new SQLiteCommand("Select id from Arac where Plaka='" + cellValue + "'", cn);
             SQLiteDataReader dr  = kmt.ExecuteReader(); dr.Read();
             int id = Convert.ToInt16(dr["id"]);
             cn.Close();
             aracdetay a = new aracdetay();
             a.id = id; a.id2 = 1; a.frm1 = this;
             a.ShowDialog();
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 2
0
 private void dataGridView2_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     foreach (DataGridViewRow row in dataGridView2.SelectedRows)
     {
         id = Convert.ToInt16(row.Cells[0].Value.ToString());
         break;
     }
     aracdetay a = new aracdetay();
     a.id = id;
     a.a2 = this;
     a.ShowDialog();
 }