-
Notifications
You must be signed in to change notification settings - Fork 5
/
frmMoney.cs
104 lines (95 loc) · 3.21 KB
/
frmMoney.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
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
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;
namespace RestoranOtomasyonu
{
public partial class frmMoney : Form
{
cDataController Controller = new cDataController();
public static DataSet dsMoney;
public frmMoney()
{
InitializeComponent();
}
private void frmMoney_Load(object sender, EventArgs e)
{
Controller.Select_HesapHareketi();
Controller.Select_Personel();
Controller.Select_OdemeTuru();
dataGridView1.DataSource = Controller.ds.Tables["Hesap Hareketleri"];
cbPersonel.DataSource = Controller.ds.Tables["Personeller"];
cbPersonel.ValueMember = "PersonelKodu";
cbPersonel.DisplayMember = "AdSoyad";
cbOdemeTuru.DataSource = Controller.ds.Tables["Ödeme Türleri"];
cbOdemeTuru.ValueMember = "OdemeTuruKodu";
cbOdemeTuru.DisplayMember = "OdemeTuru";
}
private void btnGoBack_Click(object sender, EventArgs e)
{
frmMain mn = new frmMain();
mn.Show();
this.Hide();
}
private void btnDoFilter_Click(object sender, EventArgs e)
{
try
{
if (nupMax.Value < nupMin.Value)
{
MessageBox.Show("Maksimum tutar minimum tutardan küçük olamaz!", "Hata");
}
else
{
Controller.Select_HesapHareketi(int.Parse(cbPersonel.SelectedValue.ToString()), int.Parse(cbOdemeTuru.SelectedValue.ToString()), nupMax.Value, nupMin.Value);
}
}
catch (Exception)
{
MessageBox.Show("Filtreler boş olamaz.", "Hata");
}
}
private void btnResetFilters_Click(object sender, EventArgs e)
{
cbOdemeTuru.SelectedIndex = 0;
cbPersonel.SelectedIndex = 0;
cbTumKayitlar.Checked = true;
nupMin.Value = 0M;
nupMax.Value = 100000M;
}
private void cbTumKayitlar_CheckedChanged(object sender, EventArgs e)
{
if (cbTumKayitlar.Checked)
{
cbOdemeTuru.Enabled = false;
cbPersonel.Enabled = false;
nupMax.Enabled = false;
nupMin.Enabled = false;
btnDoFilter.Enabled = false;
btnResetFilters.Enabled = false;
Controller.Select_HesapHareketi();
}
else
{
cbOdemeTuru.Enabled = true;
cbPersonel.Enabled = true;
nupMax.Enabled = true;
nupMin.Enabled = true;
btnDoFilter.Enabled = true;
btnResetFilters.Enabled = true;
}
}
private void btnShowReport_Click(object sender, EventArgs e)
{
frmMoneyReport mnr = new frmMoneyReport();
mnr.ds = Controller.ds;
mnr.Show();
this.Hide();
}
}
}