public void ekle(Hesaplamalar hesap) { baglan(); con.Open(); string sql = "insert into yolluk (yevmiye, yolmesafehesap, surehesap, tasitUcreti, toplam, yolmesafeucreti) values ('" + hesap.Yevmiye() + "','" + hesap.YolMesafeHesap() + "','" + hesap.SureHesap() + "','" + hesap.tasitUcreti() + "','" + hesap.total() + "','" + hesap.YolMesafeUcreti() + "') "; command = new OleDbCommand(sql, con); command.ExecuteNonQuery(); con.Close(); }
private void btnHesapla_Click(object sender, System.EventArgs e) { try { hesap = new Hesaplamalar(chkKendi.Checked, Int32.Parse(gosterge.Text), Int32.Parse(txKacKm.Text), Double.Parse(txTasicUcreti.Text), 1); richTextBox1.Text = "Kilometre :" + txKacKm.Text + "\nYevmiye : " + hesap.Yevmiye() + "\n" + "Yol Mesafe Ücreti : " + hesap.YolMesafeUcreti() + "\n" + "Süre : " + hesap.SureHesap() + "\n" + "Toplam : " + hesap.total(); } catch (Exception exception) { MessageBox.Show("Alanları Kontrol Edin!!!"); } }