-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrmGider.cs
76 lines (57 loc) · 2.08 KB
/
FrmGider.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace YurtKayitSistemi
{
public partial class FrmGider : Form
{
public FrmGider()
{
InitializeComponent();
}
SqlBaglantim bgl = new SqlBaglantim();
private void BtnKaydet_Click(object sender, EventArgs e)
{
// Gider ekleme
try
{
SqlCommand komut = new SqlCommand("insert into Gİderler (Elektrik, Su, Doğalgaz, intenet, Gıda, Personel, Diğer) values (@p1,@p2,@p3,@p4,@p5,@p6,@p7)", bgl.baglanti());
komut.Parameters.AddWithValue("@p1", TxtElektrik.Text);
komut.Parameters.AddWithValue("@p2", TxtSu.Text);
komut.Parameters.AddWithValue("@p3", TxtDogalgaz.Text);
komut.Parameters.AddWithValue("@p4", TxtInternet.Text);
komut.Parameters.AddWithValue("@p5", TxtGida.Text);
komut.Parameters.AddWithValue("@p6", TxtPersonel.Text);
komut.Parameters.AddWithValue("@p7", TxtDiger.Text);
komut.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kayıtar Eklendi");
}
catch (Exception)
{
MessageBox.Show("Hatalı Kayıt Girişi");
}
}
private void FrmOgrGider_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
TxtElektrik.Clear();
TxtSu.Clear();
TxtDogalgaz.Clear();
TxtInternet.Clear();
TxtGida.Clear();
TxtPersonel.Clear();
TxtDiger.Clear();
TxtElektrik.Focus();
}
}
}