private void btnIsEmriAc_Click(object sender, EventArgs e) { if (musNo != 0) { String komut = "INSERT INTO servis " + " (girisTarihi, sasiNo, musNo, perNo, girisTalimati, aracKm) VALUES " + " ('" + dtGiris.Value.ToString("yyyyMMdd HH:mm:ss") + "', '" + tbSasiNo.Text + "', " + musNo + ", " + personel.getPerNo() + ", '" + tbGirisTalimat.Text + "', " + tbArackm.Text + ") SELECT SCOPE_IDENTITY()"; SqlCommand sorgu = new SqlCommand(komut, baglanti); tbIsEmriNo.Text = Convert.ToInt64(sorgu.ExecuteScalar()).ToString(); } }
private void btnSatisYap_Click(object sender, EventArgs e) { if (musNo != 0) { String komut = "INSERT INTO satis " + " (tarih, sasiNo, musNo, perNo, tutar) VALUES " + " ('" + dtSatis.Value.ToString("yyyyMMdd HH:mm:ss") + "', '" + tbSasiNo.Text + "', " + musNo + ", " + personel.getPerNo() + ", " + tbSatisTutari.Text + ")SELECT SCOPE_IDENTITY()"; SqlCommand sorgu = new SqlCommand(komut, baglanti); Int32 primaryKey = Convert.ToInt32(sorgu.ExecuteScalar()); } }
public void kisiselDoldur() { tbPersonelNo.Text = personel.getPerNo().ToString(); btnPersonelNoDoldur_Click(this, new EventArgs()); }