Esempio n. 1
0
        public bool giderEkle(gelir_giderBilgi bilgiler)
        {
            bool result = false;

            using (var connection = Database.GetConnection())
            {
                var command = new SqlCommand("INSERT INTO gelir_gider(tip,kurum,tarih,fiyat,_not) " +
                                             "VALUES('" + bilgiler.tip + "','" + bilgiler.kurum +
                                             "','" + bilgiler.tarih + "','" + bilgiler.fiyat + "','" + bilgiler.not + "')");

                command.Connection = connection;
                connection.Open();
                if (command.ExecuteNonQuery() != -1)
                {
                    result = true;
                }
                connection.Close();
            }


            return(result);
        }
Esempio n. 2
0
        private void btn_gider_ekle_Click(object sender, EventArgs e)
        {
            DateTime myDateTime = dateTimePicker1.Value;


            gelir_giderBilgi bilgiler = new gelir_giderBilgi();

            bilgiler.tip   = "gider";
            bilgiler.kurum = txt_gider_kurum.Text.ToString();
            bilgiler.tarih = myDateTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
            bilgiler.fiyat = Convert.ToInt32(txt_gider_miktar.Text);
            bilgiler.not   = richTextBox_gider_not.Text.ToString();

            UserProvider islem = new UserProvider();

            if (islem.giderEkle(bilgiler))
            {
                MessageBox.Show("Başarıyla Eklendi.");
            }
            else
            {
                MessageBox.Show("Upss. Bir Hata Oluştu !");
            }
        }