C# Form Projeleri 125 – Bankamatik Sistemi Uygulaması V6.0
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 |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Bankamatik_Sistemi { public partial class Bankamatik : Form { #region Değişkenler int i = 1; #endregion public Bankamatik() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { button1.Text = "İşleminiz Gerçekleştiriliyor..."; button1.Enabled = false; timer1.Start(); } private void timer1_Tick(object sender, EventArgs e) { if (i < 13) { pictureBox1.Image = Image.FromFile(Application.StartupPath + "\\" + i + ".jpg"); i++; } else { timer1.Stop(); Giriş grfrm = new Giriş(); this.Hide(); grfrm.ShowDialog(); this.Show(); } } private void Bankamatik_Load(object sender, EventArgs e) { } } } |
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.OleDb; namespace Bankamatik_Sistemi { public partial class Giriş : Form { #region Metodlar public void bağlan() { try { bağlantı = new OleDbConnection(yol); } catch (OleDbException ex) { MessageBox.Show(" " + ex, "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error); } } public void verial() { sorgu = "Select Adi,Soyadi,Kart_No from Kişiler"; komut = new OleDbCommand(sorgu,bağlantı); kayıt = new OleDbDataAdapter(komut); tablo = new DataTable(); bağlantı.Open(); kayıt.Fill(tablo); bağlantı.Close(); } public void yöneticiverial() { sorgu2 = "Select * from Yönetici"; komut2 = new OleDbCommand(sorgu2,bağlantı); kayıt2 = new OleDbDataAdapter(komut2); tablo2 = new DataTable(); bağlantı.Open(); kayıt2.Fill(tablo2); bağlantı.Close(); } #endregion #region Değişkenler string yol="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=İşBankası.accdb"; string sorgu,sorgu2; OleDbConnection bağlantı; OleDbCommand komut,komut2; OleDbDataAdapter kayıt,kayıt2; DataTable tablo,tablo2; static public int i,j; static public string kartno; static public string ad,ad2,soyad2, soyad; string yöneticino; int b = 0; #endregion public Giriş() { InitializeComponent(); } private void button1_Click_1(object sender, EventArgs e) { bağlan(); yöneticiverial(); yöneticino = textBox2.Text; int c = tablo2.Rows.Count; int d = 0; for (j = 0; j < c; j++) { if (yöneticino == tablo2.Rows[j]["Yonetici_no"].ToString()) { ad2 = tablo2.Rows[j]["Adi"].ToString(); soyad2 = tablo2.Rows[j]["Soyadi"].ToString(); d++; break; } } if (d != 0) { Yönetici yöneticifrm = new Yönetici(); this.Hide(); yöneticifrm.ShowDialog(); this.Show(); } else { MessageBox.Show("Bu kart numarası geçersizdir.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } private void button7_Click(object sender, EventArgs e) { kartno = textBox1.Text; bağlan(); verial(); int a = tablo.Rows.Count; b = 0; for (i = 0; i < a; i++) { if (kartno == tablo.Rows[i]["Kart_No"].ToString()) { ad = tablo.Rows[i]["Adi"].ToString(); soyad = tablo.Rows[i]["Soyadi"].ToString(); b++; break; } } if (b != 0) { Müşteri nfrm = new Müşteri(); this.Hide(); nfrm.ShowDialog(); this.Show(); } else { MessageBox.Show("Bu kart numarası geçersizdir.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } } |
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.OleDb; namespace Bankamatik_Sistemi { public partial class Form1 : Form { #region Değişkenler string yol = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=İşBankası.accdb"; string sorgu,sorgu2,sorgu3; OleDbConnection bağlantı; OleDbCommand komut,komut2,komut3; OleDbDataAdapter kayıt; DataTable tablo,tablo2,tablo3; int t; int alınanpara; int beş, on, yirmi, elli, yüz, ikiyüz, beş2, on2, yirmi2, elli2, yüz2, ikiyüz2; int para,para1; DateTime zaman; #endregion #region Metodlar public void parayıver(int x) { if (para<alınanpara) { MessageBox.Show("Çekmek istediğiniz miktar hesabınızda bulunmamaktadır","Uyarı",MessageBoxButtons.OK,MessageBoxIcon.Error); } else { parasayısı[0] = x / 200; x = x % 200; parasayısı[1] = x / 100; x = x % 100; parasayısı[2] = x / 50; x = x % 50; parasayısı[3] = x / 20; x = x % 20; parasayısı[4] = x / 10; x = x % 10; parasayısı[5] = x / 5; x = x % 5; if (x != 0) { MessageBox.Show("Şu anda bankamatikte bu işleminizi gerçekleştirecek banknot bulunmamaktadır", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information); } int z = 5; int e = 0; foreach (int parax in parasayısı) { if (parax > parasayısı2[z]) { e++; } z--; } if (e != 0) { MessageBox.Show("Şu anda bu isteğinizi karşılayacak banknot bulunmamaktadır ATM de.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (e == 0) { groupBox1.Visible = true; label7.Text = parasayısı[0].ToString() + " Adet"; label6.Text = parasayısı[1].ToString() + " Adet"; label5.Text = parasayısı[2].ToString() + " Adet"; label4.Text = parasayısı[3].ToString() + " Adet"; label3.Text = parasayısı[4].ToString() + " Adet"; label2.Text = parasayısı[5].ToString() + " Adet"; } } } public void bağlan() { try { bağlantı = new OleDbConnection(yol); } catch (OleDbException ex) { MessageBox.Show(" " + ex, "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error); } } public void kişibilgileri() { sorgu = "Select * from Kişiler"; komut = new OleDbCommand(sorgu,bağlantı); kayıt = new OleDbDataAdapter(komut); tablo = new DataTable(); bağlantı.Open(); kayıt.Fill(tablo); bağlantı.Close(); } public void butondurumu() { if (para>=200) { button1.Enabled = true; button2.Enabled = true; button3.Enabled = true; button4.Enabled = true; button5.Enabled = true; button6.Enabled = true; } else if (para>=100) { button1.Enabled = true; button2.Enabled = true; button3.Enabled = true; button4.Enabled = true; button5.Enabled = true; } else if (para>=50) { button1.Enabled = true; button2.Enabled = true; button3.Enabled = true; button4.Enabled = true; } else if (para>=20) { button1.Enabled = true; button2.Enabled = true; button3.Enabled = true; } else if (para>=10) { button1.Enabled = true; button2.Enabled = true; } else if (para>=5) { button1.Enabled = true; } } public void butonfalse() { button1.Enabled = false; button2.Enabled = false; button3.Enabled = false; button4.Enabled = false; button5.Enabled = false; button6.Enabled = false; } public void paragüncelle() { zaman = DateTime.Now; sorgu2 = "Update Kişiler set Karttaki_Miktar='"+para+"', Son_Islem='"+zaman+"' where Kimlik="+(t+1)+""; komut2 = new OleDbCommand(sorgu2,bağlantı); bağlantı.Open(); komut2.ExecuteNonQuery(); bağlantı.Close(); } public void banknotgüncelle() { int y = 5,k=0, kimlik=1; for (k = 0; k < 6; k++) { parasayısı2[y] = parasayısı2[y] - parasayısı[k]; y--; } sorgu3 = sorgu2 = "update Para set ikiyüzlük='" + parasayısı2[5] + "', yüzlük='" + parasayısı2[4] + "', ellilik='" + parasayısı2[3] + "', yirmilik='" + parasayısı2[2] + "', onluk='" + parasayısı2[1] + "', beşlik='" + parasayısı2[0] + "' where Kimlik=" + kimlik + " "; komut3 = new OleDbCommand(sorgu3,bağlantı); bağlantı.Open(); komut3.ExecuteNonQuery(); bağlantı.Close(); } public void labeltemizle() { label2.Text = "?"; label3.Text = "?"; label4.Text = "?"; label5.Text = "?"; label6.Text = "?"; label7.Text = "?"; textBox1.Clear(); } public void paradurumu() { sorgu = "Select * from Para"; komut = new OleDbCommand(sorgu, bağlantı); kayıt = new OleDbDataAdapter(komut); tablo2 = new DataTable(); bağlantı.Open(); kayıt.Fill(tablo2); bağlantı.Close(); parasayısı2[0] = Convert.ToInt32(tablo2.Rows[0]["beşlik"]); parasayısı2[1] = Convert.ToInt32(tablo2.Rows[0]["onluk"]); parasayısı2[2] = Convert.ToInt32(tablo2.Rows[0]["yirmilik"]); parasayısı2[3] = Convert.ToInt32(tablo2.Rows[0]["ellilik"]); parasayısı2[4] = Convert.ToInt32(tablo2.Rows[0]["yüzlük"]); parasayısı2[5] = Convert.ToInt32(tablo2.Rows[0]["ikiyüzlük"]); } #endregion # region Tanımlamalar int[] parasayısı=new int[6]; int[] parasayısı2 = new int[6]; #endregion public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { butonfalse(); bağlan(); paradurumu(); kişibilgileri(); t = Giriş.i; para = Convert.ToInt32(tablo.Rows[t]["Karttaki_Miktar"]); label11.Text = tablo.Rows[t]["Karttaki_Miktar"].ToString()+" TL"; label13.Text = tablo.Rows[t]["Son_Islem"].ToString().Substring(0, 10); timer1.Start(); groupBox1.Visible = false; label9.Text = Giriş.ad + " " + Giriş.soyad; butondurumu(); } private void timer1_Tick(object sender, EventArgs e) { label15.Text = DateTime.Now.ToLongTimeString(); label14.Text = DateTime.Now.ToLongDateString(); } private void button7_Click(object sender, EventArgs e) { try { alınanpara = Convert.ToInt32(textBox1.Text); parayıver(alınanpara); } catch (Exception) { MessageBox.Show("Lütfen Geçerli Bir Değer Giriniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void button1_Click_1(object sender, EventArgs e) { alınanpara = int.Parse(button1.Text.Substring(0, 1)); parayıver(alınanpara); } private void button4_Click_1(object sender, EventArgs e) { parayıver(int.Parse(button4.Text.Substring(0, 3))); alınanpara = int.Parse(button4.Text.Substring(0, 2)); } private void button2_Click_1(object sender, EventArgs e) { parayıver(int.Parse(button2.Text.Substring(0, 2))); alınanpara = int.Parse(button2.Text.Substring(0, 2)); } private void button5_Click_1(object sender, EventArgs e) { alınanpara = int.Parse(button5.Text.Substring(0, 3)); parayıver(alınanpara); } private void button3_Click_1(object sender, EventArgs e) { parayıver(int.Parse(button3.Text.Substring(0, 2))); alınanpara = int.Parse(button3.Text.Substring(0, 2)); } private void button6_Click(object sender, EventArgs e) { parayıver(int.Parse(button6.Text.Substring(0, 3))); alınanpara = int.Parse(button6.Text.Substring(0, 3)); } private void button8_Click_1(object sender, EventArgs e) { para = para - alınanpara; bağlan(); paradurumu(); paragüncelle(); kişibilgileri(); para = Convert.ToInt32(tablo.Rows[t]["Karttaki_Miktar"]); label11.Text = tablo.Rows[t]["Karttaki_Miktar"].ToString() + " TL"; label13.Text = tablo.Rows[t]["Son_Islem"].ToString(); butonfalse(); butondurumu(); labeltemizle(); banknotgüncelle(); } private void button9_Click_1(object sender, EventArgs e) { Application.Exit(); } } } |
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.OleDb; namespace Bankamatik_Sistemi { public partial class Müşteri : Form { #region Metodlar public void bağlan() { try { bağlantı = new OleDbConnection(yol); } catch (OleDbException ex) { MessageBox.Show(" " + ex, "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error); } } public void kişibilgileri() { sorgu = "Select * from Kişiler"; komut = new OleDbCommand(sorgu, bağlantı); kayıt = new OleDbDataAdapter(komut); tablo = new DataTable(); bağlantı.Open(); kayıt.Fill(tablo); bağlantı.Close(); } #endregion #region Değişkenler string yol = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=İşBankası.accdb"; string sorgu; OleDbConnection bağlantı; OleDbCommand komut; OleDbDataAdapter kayıt; DataTable tablo; #endregion #region Tanımlamalar Form1 nfrm2 = new Form1(); Parayatır nfrm3 = new Parayatır(); #endregion public Müşteri() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { this.Hide(); nfrm3.ShowDialog(); this.Show(); } private void Müşteri_Load(object sender, EventArgs e) { bağlan(); kişibilgileri(); int t = Giriş.i; timer1.Start(); label9.Text = Giriş.ad + " " + Giriş.soyad; label11.Text = tablo.Rows[t]["Karttaki_Miktar"].ToString() + " TL"; label13.Text = tablo.Rows[t]["Son_Islem"].ToString(); } private void timer1_Tick(object sender, EventArgs e) { label15.Text = DateTime.Now.ToLongTimeString(); label1.Text = DateTime.Now.ToLongDateString(); } private void button1_Click(object sender, EventArgs e) { this.Hide(); nfrm2.ShowDialog(); this.Show(); } } } |
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.OleDb; namespace Bankamatik_Sistemi { public partial class Yönetici : Form { #region Değişkenler string yol = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=İşBankası.accdb"; string sorgu, sorgu2; OleDbConnection bağlantı, bağlantı2; OleDbCommand komut, komut2; OleDbDataAdapter kayıt, kayıt2; DataTable tablo, tablo2; static public string kartno; static public string ad, ad2, soyad2, soyad; string yöneticino; long toplam = 0; int beş, on, yirmi, elli, yüz, ikiyüz, beş2, on2, yirmi2, elli2, yüz2, ikiyüz2; #endregion #region Metodlar public void bağlan() { try { bağlantı = new OleDbConnection(yol); } catch (OleDbException ex) { MessageBox.Show(" " + ex, "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error); } } public void paradurumu() { sorgu = "Select * from Para"; komut = new OleDbCommand(sorgu,bağlantı); kayıt = new OleDbDataAdapter(komut); tablo = new DataTable(); bağlantı.Open(); kayıt.Fill(tablo); bağlantı.Close(); beş = Convert.ToInt32(tablo.Rows[0]["beşlik"]) * 5; on = Convert.ToInt32(tablo.Rows[0]["onluk"]) * 10; yirmi = Convert.ToInt32(tablo.Rows[0]["yirmilik"]) * 20; elli = Convert.ToInt32(tablo.Rows[0]["ellilik"]) * 50; yüz = Convert.ToInt32(tablo.Rows[0]["yüzlük"]) * 100; ikiyüz = Convert.ToInt32(tablo.Rows[0]["ikiyüzlük"]) * 200; beş2 = Convert.ToInt32(tablo.Rows[0]["beşlik"]) ; on2 = Convert.ToInt32(tablo.Rows[0]["onluk"]) ; yirmi2 = Convert.ToInt32(tablo.Rows[0]["yirmilik"]) ; elli2 = Convert.ToInt32(tablo.Rows[0]["ellilik"]) ; yüz2 = Convert.ToInt32(tablo.Rows[0]["yüzlük"]) ; ikiyüz2 = Convert.ToInt32(tablo.Rows[0]["ikiyüzlük"]); } public void paraekle() { int kimlik = 1; beş2=Convert.ToInt32(maskedTextBox1.Text)+beş2; on2=Convert.ToInt32(maskedTextBox2.Text)+on2; yirmi2=Convert.ToInt32(maskedTextBox3.Text)+yirmi2; elli2=Convert.ToInt32(maskedTextBox4.Text)+elli2; yüz2=Convert.ToInt32(maskedTextBox5.Text)+yüz2; ikiyüz2=Convert.ToInt32(maskedTextBox6.Text)+ikiyüz2; sorgu2 = "update Para set ikiyüzlük='" + ikiyüz2 + "', yüzlük='" + yüz2 + "', ellilik='" + elli2 + "', yirmilik='" + yirmi2 + "', onluk='" + on2 + "', beşlik='" + beş2 + "' where Kimlik=" + kimlik + " "; komut2 = new OleDbCommand(sorgu2, bağlantı); bağlantı.Open(); komut2.ExecuteNonQuery(); bağlantı.Close(); MessageBox.Show("Başarılı Bir Şekilde İşlem Tamamlandı.","Bilgi",MessageBoxButtons.OK,MessageBoxIcon.Information); } public void maskedsıfırla() { maskedTextBox1.Text = "0"; maskedTextBox2.Text = "0"; maskedTextBox3.Text = "0"; maskedTextBox4.Text = "0"; maskedTextBox5.Text = "0"; maskedTextBox6.Text = "0"; } #endregion #region Tanımlamalar #endregion public Yönetici() { InitializeComponent(); } private void Yönetici_Load(object sender, EventArgs e) { } private void tabControl1_Layout(object sender, LayoutEventArgs e) { bağlan(); paradurumu(); label2.Text = tablo.Rows[0]["beşlik"].ToString() + " Adet"; label3.Text = tablo.Rows[0]["onluk"].ToString() + " Adet"; label4.Text = tablo.Rows[0]["yirmilik"].ToString() + " Adet"; label5.Text = tablo.Rows[0]["ellilik"].ToString() + " Adet"; label6.Text = tablo.Rows[0]["yüzlük"].ToString() + " Adet"; label7.Text = tablo.Rows[0]["ikiyüzlük"].ToString() + " Adet"; toplam = beş + on + yirmi + elli + yüz + ikiyüz; label9.Text = toplam.ToString()+" TL"; } private void button7_Click(object sender, EventArgs e) { try { if (maskedTextBox1.Text=="0" && maskedTextBox2.Text=="0" && maskedTextBox3.Text=="0" && maskedTextBox4.Text=="0" && maskedTextBox5.Text=="0" && maskedTextBox6.Text=="0") { MessageBox.Show("Hiç Bir Değişiklik Yapmadınız Para Adetlerinde","Uyarı",MessageBoxButtons.OK,MessageBoxIcon.Warning); } else { bağlan(); paradurumu(); paraekle(); maskedsıfırla(); } } catch (Exception) { MessageBox.Show("Lütfen Değerleri Kontrol Edip Tekrar Giriniz","Hata",MessageBoxButtons.OK,MessageBoxIcon.Error); } } } } |