-
Notifications
You must be signed in to change notification settings - Fork 0
/
FeeSubmit.cs
118 lines (106 loc) · 4.2 KB
/
FeeSubmit.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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.OleDb;
namespace school_management_system
{
public partial class FeeSubmit : Form
{
public FeeSubmit()
{
InitializeComponent();
}
private void textBox11_TextChanged(object sender, EventArgs e)
{
}
private void panel2_Paint(object sender, PaintEventArgs e)
{
}
model.Connection con = new model.Connection();
model.FeeCheck f = new model.FeeCheck();
private void FeeSubmit_Load(object sender, EventArgs e)
{
string query = "select * from info";
dataGridView1.DataSource = f.datagrid(query);
}
private void button1_Click(object sender, EventArgs e)
{
f.ID = textBox15.Text;
f.year = textBox3.Text;
f.role = textBox14.Text;
f.Jan = textBox2.Text;
f.feb = textBox1.Text;
f.mar = textBox5.Text;
f.apr = textBox4.Text;
f.may = textBox7.Text;
f.jun = textBox6.Text;
f.jul = textBox9.Text;
f.aug = textBox8.Text;
f.sep = textBox11.Text;
f.oct = textBox10.Text;
f.nov = textBox13.Text;
f.dec = textBox12.Text;
f.Submit(f);
MessageBox.Show("successfully inserting data fees..");
}
private void button2_Click(object sender, EventArgs e)
{
try
{
con.GetConnection();
OleDbCommand com = new OleDbCommand("Select * from fees where ID = '" + textBox15.Text + "' ", con.con);
OleDbDataReader rd = com.ExecuteReader();
while (rd.Read())
{
textBox2.Text = rd["Jan"].ToString();
textBox1.Text = rd["Feb"].ToString();
textBox5.Text = rd["Mar"].ToString();
textBox4.Text = rd["Apr"].ToString();
textBox7.Text = rd["May"].ToString();
textBox6.Text = rd["Jun"].ToString();
textBox9.Text = rd["Jul"].ToString();
textBox8.Text = rd["Aug"].ToString();
textBox11.Text = rd["Sep"].ToString();
textBox10.Text = rd["Oct"].ToString();
textBox13.Text = rd["Nov"].ToString();
textBox12.Text = rd["Dec"].ToString();
textBox3.Text = rd["Year"].ToString();
textBox14.Text = rd["Role"].ToString();
}
}
catch
{
MessageBox.Show("error");
}
}
private void button3_Click(object sender, EventArgs e)
{
model.Connection con = new model.Connection();
con.GetConnection();
model.Fee fd = new model.Fee();
fd.ID = textBox15.Text;
fd.role = textBox14.Text;
fd.year = textBox3.Text;
fd.Jan = "not paid";
fd.feb = "not paid";
fd.mar = "not paid";
fd.apr = "not paid";
fd.may = "not paid";
fd.jun = "not paid";
fd.jul = "not paid";
fd.aug = "not paid";
fd.sep = "not paid";
fd.oct = "not paid";
fd.nov = "not paid";
fd.dec = "not paid";
con.ExecuteQuery("insert into fees values('" + fd.ID + "','" + fd.year + "','" + fd.role + "','" + fd.Jan + "','" + fd.feb + "','" + fd.mar + "','" + fd.apr + "','" + fd.may + "','" + fd.jun + "','" + fd.jul + "','" + fd.aug + "','" + fd.sep + "','" + fd.oct + "','" + fd.nov + "','" + fd.dec + "')");
MessageBox.Show("successfully initialize the person");
}
}
}